Re: Recording the current branch on each commit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Ursprungligt meddelande -----
> Från: "Jeremy Morton" <admin@xxxxxxxxxxxxxx>
> Till: git@xxxxxxxxxxxxxxx
> Skickat: söndag, 27 apr 2014 1:56:47
> Ämne: Recording the current branch on each commit?
> 
> Currently, git records a checksum, author, commit date/time, and commit
> message with every commit (as get be seen from 'git log').  I think it
> would be useful if, along with the Author and Date, git recorded the
> name of the current branch on each commit.  The branch name can provide
> useful contextual information.  For instance, let's say I'm developing a
> suite of games.  If the commit message says "Added basic options
> dialog", it might be useful to see that the branch name is
> "pacman-minigame" indicating that the commit pertains to the options
> dialog in the Pacman minigame.  Basically, I'm saying that well-named
> branches can and do carry useful contextual information that oughtn't to
> be thrown away.  Currently, when you delete that branch, you lose the
> branch name altogether.
> 
> So what do you think?  Would it be good to have a patch to add this feature?

Branch names are usually poorly named, so often you don't lose much. One way
some people to is to always merge with --no-ff, that way you see the branch
name in the merge commit. 

A very popular way of tracking context is to add some id, such as a bugzilla issue
number, to the header or footer of the commit message. Often a branch contains many
issues, but the branch itself isn't very interesting. Tools like gitblit, gitweb,
gerrit etc can easily be configured to link to the issue using a regular expression.

-- robin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]