TEXT   24

core values

Guest on 14th August 2022 01:05:50 AM

  1. [core]
  2.                 [.values]
  3.                         fixed = true
  4.                         nested = fine
  5.                         [..example]
  6.                                 test = Hell yes
  7.                 [.other]
  8.                         example = strange
  9.                 [.]
  10.                         name = hi
  11.  
  12.         [section]
  13.                 example = yet another
  14.  
  15. and that would result in a parse of
  16.  
  17.         core.values.fixed = true
  18.         core.values.nested = fine
  19.         core.values.example.test = Hell yes
  20.         core.other.example = strange
  21.         core.name = hi
  22.         secontion.example = yet another
  23.  
  24. and that seems reasonably clean. I'd also allow explicit
  25. multi-level section names:
  26.  
  27.         [core.values]
  28.                 fixed = true
  29.  
  30. so you could always write the above config file in an alternate format:
  31.  
  32.         [core.values] fixed = true
  33.         [core.values] nested = fine
  34.         [core.values.example] test = Hell yes
  35.         [core.other] example = strange
  36.         [core] name = hi
  37.         [section] example = yet another
  38.  
  39. instead, using no implicit nesting at all (or, indeed, even re-using
  40. sections like "core.values").
  41.  
  42. That would allow things like
  43.  
  44.         [branches]
  45.                 [.origin]
  46.                         url = master.kernel.org:/pub/scm/git/git.git
  47.                         pull = master:origin
  48.                 [.mine]
  49.                         url = my.domain.com:/other/repo
  50.                         pull = master:mine
  51.  
  52. (which could also be written as
  53.  
  54.         [branches.origin]
  55.                 url = master.kernel.org:/pub/scm/git/git.git
  56.                 pull = master:origin
  57.  
  58.         [branches.mine]
  59.                 url = my.domain.com:/other/repo
  60.                 pull = master:mine
  61.  
  62. and the following mixed-indentation usage would be technically correct,
  63. but perhaps crazy:
  64.  
  65.         [branches.origin]
  66.                 url = master.kernel.org:/pub/scm/git/git.git
  67.                 pull = master:origin
  68.  
  69.             [.mine]
  70.                 url = my.domain.com:/other/repo
  71.                 pull = master:mine

Raw Paste


Login or Register to edit or fork this paste. It's free.