Re: Keep original author with git merge --squash?

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

 



On 02/12/2015 10:28 AM, Jeff King wrote:
> On Wed, Feb 11, 2015 at 09:21:04AM -0800, David Glasser wrote:
> 
>> (I'm not sure if this should be a flag to --squash or to commit.
>> Maybe `git merge --squash`; `git commit --use-squashed-author`?  Seems
>> like it should be not too hard to implement; SQUASH_MSG is pretty
>> parseable.  Or just a config value.)
> 
> It sounds like "git commit -c" is close to what you want, which will
> pull the author and commit message from a particular commit. But I don't
> think there is a convenient way to name the commit in your case (it is
> likely to be the first commit on the branch you are squash-merging, but
> there isn't a shorthand for that).
> 
> I assume you are already munging in your editor the template provided by
> "git commit" after the squash? What would be really nice, IMHO, is if
> there was a way to set the author during that edit (e.g., by moving one
> of the "Author:" lines to the top of the file). That would cover your
> use case, I think, and would also be useful in general.

If only Git supported options on todo list lines [1], this could be
implemented via a "--use-author" option:

    pick --use-author 1234556 blah
    squash 84392ab etc
    fixup 49106a5 another

Happily, this would work with fixup, too, without forcing the user to go
into the editor. Also, it wouldn't require metadata to be read in-band
from the commit message.

Michael

[1] http://article.gmane.org/gmane.comp.version-control.git/255410

-- 
Michael Haggerty
mhagger@xxxxxxxxxxxx

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