git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git branch --edit-description a custom file
Date: Wed, 30 Oct 2019 15:43:28 -0700	[thread overview]
Message-ID: <20191030224328.GB44961@generichostname> (raw)
In-Reply-To: <20191030202835.GB29013@sigill.intra.peff.net>

Hi Peff,

On Wed, Oct 30, 2019 at 04:28:35PM -0400, Jeff King wrote:
> On Wed, Oct 30, 2019 at 11:39:50AM -0700, Denton Liu wrote:
> 
> > 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.

Dscho brought up in the GGG thread[1] that perhaps we want to treat
branch descriptions like notes and have them all under something like
`refs/notes/branches`. This would certainly solve my problem of
having versioned descriptions and it would probably do it in a much more
general way than having a versioned included config.

Anyone see any potential problems with this approach?

> > 
> > 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).

Yeah, I've also wanted the same... I've thought about just symlinking
.git/config away but I think that causes other problems that I don't
want to deal with.

> 
> > 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?

I found the original thread that removed the functionality[2]. I'm
probably not going to go with this approach since the notes approach
seems more promising but going back to your question, I think that would
make sense since by specifying GIT_CONFIG, a user is explicitly
overriding .git/config so they should also be aware of the consequences.

Thanks for your thoughts,

Denton

[1]: https://github.com/gitgitgadget/git/issues/438
[2]: https://public-inbox.org/git/alpine.LNX.1.00.0806300328380.19665@iabervon.org/

> 
> -Peff

  reply	other threads:[~2019-10-30 22:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 18:39 git branch --edit-description a custom file Denton Liu
2019-10-30 20:28 ` Jeff King
2019-10-30 22:43   ` Denton Liu [this message]
2019-10-31  6:18     ` Jeff King
2019-10-31 10:22       ` Johannes Schindelin
2019-10-31 11:00         ` Phillip Wood
2019-10-31 11:30           ` Johannes Schindelin
2019-10-31 13:45             ` Philip Oakley
2019-10-31 15:42               ` Jeff King
2019-11-03 17:56                 ` Philip Oakley
2019-11-04 19:50                   ` Jeff King
2019-11-04  3:21                 ` Junio C Hamano
2019-10-31 18:19         ` Denton Liu
2019-10-31 19:53           ` Phillip Wood
2019-10-31 20:07             ` Jeff King
2019-11-01 12:29               ` Phillip Wood
2019-11-01 16:49                 ` Jeff King
2019-11-01 20:35                   ` Phillip Wood
2019-11-02  4:53               ` Junio C Hamano
2019-10-31 17:35       ` Denton Liu
2019-10-31 18:06         ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191030224328.GB44961@generichostname \
    --to=liu.denton@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).