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

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

 



Erick Mattos <erick.mattos@xxxxxxxxx> 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.
--
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]