Subject: Re: git merge --date --author

From: Michael Haggerty <[email-masked]>
Date: Fri, 07 Mar 2014 12:41:01 +0100

On 03/07/2014 11:30 AM, Yann Droneaud wrote:
> I was trying to rebuild some history and found myself trying to use some
> options with git merge which are available in git commit:
> 
>  git merge \
>      --date "2013-12-31 23:59:59 +0000" \
>      --author "Happy New Year <[email-masked]>" \
>      current-year
> 
> But unfortunately, unlike git commit, git merge doesn't support either
> --date or --author.
> 
> I can work around with environment variables:
> 
>  GIT_AUTHOR_DATE="2013-12-31 23:59:59 +0000" \
>  GIT_AUTHOR_NAME="Happy New Year" \
>  GIT_AUTHOR_EMAIL="[email-masked]"  \
>  git merge current-year

You can also use

    git merge --no-commit [...]
    git commit --date ... --author ...

> But I'd like to know if there's a specific reason for git merge to not
> support --date and --author ?

None that I can think of, except that nobody has implemented it.  Don't
forget that the merge invocation might not lead immediately to a commit
(if there is a conflict, or if --no-commit is used) so the metadata that
is passed to its command line would have to be tucked away safely
somewhere until the merge commit is finally ready to be created.

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/