Re: Prompt for merge message?
- From
Shawn Pearce <spearce@spearce.org>
- Date
- Oct 6, 2011, 22:09 UTC
- Message-ID
- <CAJo=hJvFytscxyx2z+Fdw9E1DS02wSXgoE3SHkxKq2OYOMQHgQ@mail.gmail.com>
- In-Reply-To
- <7vsjn5ye0x.fsf@alter.siamese.dyndns.org>
On Thu, Oct 6, 2011 at 15:02, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> "Todd A. Jacobs" <nospam+listmail@codegnome.org> writes: > >> I often find myself using "--no-ff -m foo" for merging short-lived >> branches, because the merge commit usually needs to say something >> about having finished a feature rather than referring to a branch that >> will be deleted shortly anyway.... >> ... Is there currently a way to get git to prompt for the merge message, >> rather than using the default or requiring the -m flag? If not, isn't >> this a common-enough use case to have that ability added to the merge >> function? > > Others commented on the current practices and gave their own useful tips > already, but an additional hint is to name your branch more sensibly, so > that you do not feel it is useless to record it in the history. > > As to a real longer-term solution, I wouldn't mind a patch that teaches > "git merge" an "-e" option just like "git commit" has. > > $ git commit -m "Finish frotz feature" -e -a > ... editor opens with the first line filled already here ... > > is something I find myself using fairly often.
What about adding something like:
if (isatty(0) && isatty(1) && isatty(2)) {
do_interactive_commit();
}to git merge? I know the reason we don't want to do it all of the time is because git merge is already used in a lot of scripts. But how many of those are running with an active terminal on all 3 standard fds when it runs git merge?