git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git merge --date --author

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Mar 7, 2014, 11:41 UTC
Message-ID
<5319B04D.6080906@alum.mit.edu>
In-Reply-To
<1394188215.3257.17.camel@localhost.localdomain>
On 03/07/2014 11:30 AM, Yann Droneaud wrote:
Show 17 quoted lines
> 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 <happy.new-year@gregorian.calendar>" \
>      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="happy.new-year@gregorian.calendar"  \
>  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
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Yann DroneaudNext: Andreas Schwab
Message 2 of 5 in “git merge --date --author”
  1. Yann DroneaudMar 7, 2014
  2. Michael HaggertyMar 7, 2014
  3. Andreas SchwabMar 7, 2014
  4. Junio C HamanoMar 7, 2014
  5. Yann DroneaudMar 10, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.