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

Re: [PATCH] Changed timestamp behavior of options -c/-C/--amend

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2009, 00:10 UTC
Message-ID
<7vocnoe83m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<55bacdd30910301612xabe2071i1319d920191f080f@mail.gmail.com>
Erick Mattos <erick.mattos@gmail.com> writes:
> I don't see a use for comparing the author and committer because I can
> use as template my own commits or others'.

You _can_ use whichever irrelevant commit as a template, but "you _can_" is different from what it means, and what is and what is not _sensible_.

You may be rewriting somebody else's patch (e.g. fixing up a typo in the message, or changing the implementation, or both). If you are going to keep the authorship, you are saying that "it is still _his_ code, not mine". In such a case, it never makes sense to change the timestamp, if that author is somebody other than you. After all that other guy may not even be aware of what you are doing when you make this commit; he may be in bed sound asleep in a different timezone.

In another scenario, if your fix-up is very significant, even if you started from somebody else's patch, you may want to say "now this is my patch, the original author may have given me some inspiration, but the changes in this commit, including all the bugs, are mine". The same applies if you looked at the problem description of somebody' patch, and did your own solution without using anything from his commit.

At that point, you would want the resulting commit to say it was written by you at this moment. You do not want to see -c/-C/--amend to retain any part of the authorship (not just timestamp) from the original commit.

    Side note. You may be fixing your own patch, in which case you may or
    may not consider your change significant, but at the time of either
    old timestamp or current time, you were working on this change, so
    using the current timestamp instead of using the old one is not a big
    deal, and that is why I think committer==author may be a good
    heuristic when deciding to touch or not touch the timestamp.
    But in general I do not like such dwim that depends on who you are (it
    makes it harder to explain, even if the end result may be useful in
    practice), so I'd rather not to see such a code for this topic if we
    can avoid it.

In short, I do not think it makes sense to change only the timestamp while keeping the author. The issue is not "timestamp behaviour" with "use new timestamp" option, but rather is an ability to declare "Now this is a commit made _by me_ and _now_; iow, I take authorship for this change", even when you reuse the commit log message from somewhere else.

So what is needed is an option to tell -c/-C/--amend to reuse _only_ the message but no authorship information from the original commit, I think.

Previous: Erick MattosNext: Erick Mattos
Message 12 of 17 in “Changed timestamp behavior of options -c/-C/--amend”
  1. Changed timestamp behavior of options -c/-C/--amendErick Mattos, Oct 30, 2009
  2. Jeff KingOct 30, 2009
  3. Erick MattosOct 30, 2009
  4. Junio C HamanoOct 30, 2009
  5. Johannes SixtOct 30, 2009
  6. Paolo BonziniOct 31, 2009
  7. Junio C HamanoOct 30, 2009
  8. Junio C HamanoOct 30, 2009
  9. Erick MattosOct 30, 2009
  10. Junio C HamanoOct 30, 2009
  11. Erick MattosOct 30, 2009
  12. Junio C HamanoOct 31, 2009
  13. Erick MattosOct 31, 2009
  14. Johannes SixtOct 30, 2009
  15. Erick MattosOct 30, 2009
  16. Junio C HamanoOct 30, 2009
  17. Erick MattosOct 30, 2009

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.