* git merge --date --author
@ 2014-03-07 10:30 Yann Droneaud
2014-03-07 11:41 ` Michael Haggerty
2014-03-07 12:58 ` Andreas Schwab
0 siblings, 2 replies; 5+ messages in thread
From: Yann Droneaud @ 2014-03-07 10:30 UTC (permalink / raw)
To: git; +Cc: Yann Droneaud
Hi,
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
But I'd like to know if there's a specific reason for git merge to not
support --date and --author ?
Regards.
--
Yann Droneaud
OPTEYA
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git merge --date --author
2014-03-07 10:30 git merge --date --author Yann Droneaud
@ 2014-03-07 11:41 ` Michael Haggerty
2014-03-07 12:58 ` Andreas Schwab
1 sibling, 0 replies; 5+ messages in thread
From: Michael Haggerty @ 2014-03-07 11:41 UTC (permalink / raw)
To: Yann Droneaud; +Cc: git
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 <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/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git merge --date --author
2014-03-07 10:30 git merge --date --author Yann Droneaud
2014-03-07 11:41 ` Michael Haggerty
@ 2014-03-07 12:58 ` Andreas Schwab
2014-03-07 19:43 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2014-03-07 12:58 UTC (permalink / raw)
To: Yann Droneaud; +Cc: git
Yann Droneaud <ydroneaud@opteya.com> writes:
> But I'd like to know if there's a specific reason for git merge to not
> support --date and --author ?
It's rather unusual that a merge is performed on behalf of a different
author.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git merge --date --author
2014-03-07 12:58 ` Andreas Schwab
@ 2014-03-07 19:43 ` Junio C Hamano
2014-03-10 12:52 ` Yann Droneaud
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2014-03-07 19:43 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Yann Droneaud, git
Andreas Schwab <schwab@linux-m68k.org> writes:
> Yann Droneaud <ydroneaud@opteya.com> writes:
>
>> But I'd like to know if there's a specific reason for git merge to not
>> support --date and --author ?
>
> It's rather unusual that a merge is performed on behalf of a different
> author.
Yes. Michael's "Nobody bothered to implement it" is also correct
but the reason why nobody bothered to most likely is due to "why
would you want to lie?".
If the use case is to rebuild history, you would need to be able to
also lie about the committer, so
>> git merge \
>> --date "2013-12-31 23:59:59 +0000" \
>> --author "Happy New Year <happy.new-year@gregorian.calendar>" \
>> current-year
in such a history-rebuild script would not be sufficient. The
script can set necessary environment variables to lie about both
author and commiter, though, of course.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git merge --date --author
2014-03-07 19:43 ` Junio C Hamano
@ 2014-03-10 12:52 ` Yann Droneaud
0 siblings, 0 replies; 5+ messages in thread
From: Yann Droneaud @ 2014-03-10 12:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Andreas Schwab, git, Yann Droneaud
Hi,
Le vendredi 07 mars 2014 à 11:43 -0800, Junio C Hamano a écrit :
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
> > Yann Droneaud <ydroneaud@opteya.com> writes:
> >
> >> But I'd like to know if there's a specific reason for git merge to not
> >> support --date and --author ?
> >
> > It's rather unusual that a merge is performed on behalf of a different
> > author.
>
> Yes. Michael's "Nobody bothered to implement it" is also correct
> but the reason why nobody bothered to most likely is due to "why
> would you want to lie?".
>
When was Git changed in some kind of TSA agent one has to bribe to get
allowed to cross^Wcommit ? Why git lawyer is not implemented ? I want a
fair trial !
And before adding to Git a perfect lie detector (how will it able to
make the difference between truth and lie ? then, will it be able to
make the difference between good and bad ?, oh god, no !), I would
prefer to have it detect bugs before one could commit instead.
You seems to think I'm lying, but I'm not a liar: I just need to make
some arrangements with the history under another identity, as I could be
legally bound to. So it may sound like a lie for you, but ultimately,
it's the plain truth.
So as the tool is not in position to distinguish lie from truth, I'd
prefer to not see this concept brought here.
> If the use case is to rebuild history, you would need to be able to
> also lie about the committer, so
>
> >> git merge \
> >> --date "2013-12-31 23:59:59 +0000" \
> >> --author "Happy New Year <happy.new-year@gregorian.calendar>" \
> >> current-year
>
> in such a history-rebuild script would not be sufficient. The
> script can set necessary environment variables to lie about both
> author and commiter, though, of course.
>
Thanks for reminding this: I have to use GIT_COMMITER_DATE,
GIT_COMMITER_NAME and GIT_COMMITER_EMAIL.
As I'm not calling for adding --date and --author, I will continue to
use the environment variables: they're good enough for the job.
Regards.
--
Yann Droneaud
OPTEYA
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-10 12:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07 10:30 git merge --date --author Yann Droneaud
2014-03-07 11:41 ` Michael Haggerty
2014-03-07 12:58 ` Andreas Schwab
2014-03-07 19:43 ` Junio C Hamano
2014-03-10 12:52 ` Yann Droneaud
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).