Re: Alphabetize git config --list
- From
Jeff King <peff@peff.net>
- Date
- May 28, 2012, 21:23 UTC
- Message-ID
- <20120528212309.GA4220@sigill.intra.peff.net>
- In-Reply-To
- <CAFus=5=cp62hpLM_Odog--Q0vER8kkT5Doqo28i-yZQyfvv4gQ@mail.gmail.com>
On Mon, May 28, 2012 at 01:58:28PM -0700, Zach wrote:
Show 5 quoted lines
> I was wondering if it would be possible to alphabetically order git > config --list by default. > > Essentially this > $ git config --list | sort
No, it's not a good idea; the order of keys is important. For example, this config:
[color]
ui = true
ui = falseis different than this:
[color]
ui = false
ui = trueWhile that seems like a contrived example, consider something like a .git/config repo-specific config file overriding a user-wide ~/.gitconfig file. We do it by overwriting the old key.
There are also some "multi" values which accept multiple entries to create a list, and the list order may be relevant (I'd have to check, though; the only one that comes to mind is refspecs, and I don't know that order matters there).
-Peff