Skip to content

Commit

Permalink
git: fix the config output
Browse files Browse the repository at this point in the history
When setting values using the `git config --set` command, git formats
the file a bit differently. This changes the output so it maps to that
format.

Differences:

* each `key = value` in a section is prefixed by a tab character
* the `=` between the key and the value is surrounded by spaces
  • Loading branch information
zimbatm committed Mar 5, 2020
1 parent f3fbb50 commit 45439c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/programs/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ let

# generation for multiple ini values
mkKeyValue = k: v:
let mkKeyValue = generators.mkKeyValueDefault { } "=" k;
in concatStringsSep "\n" (map mkKeyValue (toList v));
let mkKeyValue = generators.mkKeyValueDefault { } " = " k;
in concatStringsSep "\n" (map (kv: "\t" + mkKeyValue kv) (toList v));

# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
gitFlattenAttrs = let
Expand Down

0 comments on commit 45439c2

Please sign in to comment.