Re: git branch --edit-description a custom file
- From
Jeff King <peff@peff.net>
- Date
- Oct 30, 2019, 20:28 UTC
- Message-ID
- <20191030202835.GB29013@sigill.intra.peff.net>
- In-Reply-To
- <20191030183950.GA21277@generichostname>
On Wed, Oct 30, 2019 at 11:39:50AM -0700, Denton Liu wrote:
Show 17 quoted lines
> It seems like everyone working on git.git has their own patch management > system. Currently, I keep all of my branch-specific configurations > (including CC lists) and patches in a worktree within the repo so that I > can keep my configs synced around on different computers. > > One thing that's missing about this setup is that I would like to > version my branch descriptions as well since I use those to generate > cover letters. Unfortunately, `git branch --edit-description` only > operates on .git/config. > > As a workaround, I rewrote `git branch --edit-description` as a > shell-script that can operate on any config file but I feel like a more > general solution should be warranted. > > Would changing the option to `git branch --edit-description[=<config>]` > make sense, where the `<config>` is optional but if it's specified, > it'll operate on that file instead of the .git/config.
That makes sense to me (though I don't use branch descriptions myself). I actually wish a lot of auto-written config (like branch.*.merge) was written to a file besides .git/config, and then just included. It would make it easier to keep your actual config file cleaner (I usually take the opposite route and version-control my own config in a separate file that I include from .git/config).
Show 5 quoted lines
> Alternately, would it make sense to support a $GIT_CONFIG environment > variable globally? That is, when $GIT_CONFIG is specified, git will > read/write from $GIT_CONFIG instead of .git/config? It'd be a little > heavy-handed for me to make the change just for this one use-case but > perhaps people may find other uses for it?
We used to have such a thing, and it opened a lot of weird corner cases. Just thinking about the case you mentioned: would people be confused if "GIT_CONFIG=foo git branch --edit-description" doesn't respect core.editor specified in .git/config?
-Peff