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

Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 4, 2009, 01:23 UTC
Message-ID
<7v639rnkvt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<55bacdd30911031551k1bfd3151t940864e4793f5a37@mail.gmail.com>
Erick Mattos <erick.mattos@gmail.com> writes:
> ... I had already sent another patch with the
> suggestions he made in a previous email.
That happens in real life with people working in different timezones.
Show 5 quoted lines
> The new option only touches on getting new author or copying the
> original so that is why I made the first check in whole and the others
> only by author.  If people think that this operation is so uncertain,
> then everything should be compared: parent, author and message on all
> tests.

You probably have misunderstood why we write tests; it is not about making sure _your_ implementation is Ok. If that were the case, using knowledge of implementation details to short-circuit the tests would perfectly be acceptable.

We write tests so that long after you get bored and stop visiting the git project mailing-list, if somebody _else_ changes the program and its behaviour gets changed in a way _you_ did not expect, such a mistake can be caught, even if you are not monitoring the mailing list to actively catch such a bad change to go into the system. So we prefer to test both sides of the coin without saying "this option only affects this codepath (currently) so it never can break this part, it is not worth checking this and that (right now)" when it is not too much trouble. It is a win in the long run.

In any case, I like --reset-author better than --mine. I didn't think of diamond-mine, though ;-)

Previous: Erick MattosNext: Erick Mattos
Message 4 of 6 in “commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author”
  1. commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-authorErick Mattos, Nov 3, 2009
  2. Nanako ShiraishiNov 3, 2009
  3. Erick MattosNov 3, 2009
  4. Junio C HamanoNov 4, 2009
  5. Erick MattosNov 4, 2009
  6. Junio C HamanoNov 4, 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.