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

Re: [PATCH 3/3] commit: add an option the reword HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2020, 16:54 UTC
Message-ID
<xmqq5z85lpla.fsf@gitster.c.googlers.com>
In-Reply-To
<52217e7a-5a51-48e4-5496-96ac68602200@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 13 quoted lines
>>>>> +test_reword_opt () {
>>>>> ...
>>> ... I should probably check that nothing is printed to stdout in
>>> these tests
>> Perhaps, but that is not the point of "do we diagnose options thare
>> are incompatble with --reword?" test.
>
> I think it depends if one views the test as checking "do we diagnose
> options there are incompatible with --reword?" or "what do we show the 
> user when there are options that are incompatible with --reword". For
> the former we just want to check that the correct error message is 
> printed, for the latter we want to check that only what we expect to
> be printed is actually printed.

I dunno. It is plausible that we will further give some advices (not directly related to --reword option being incompatible with other options) and output may evolve. I do not think we want to be updating each and every test that expects exact output.

In other words, the answer to "what do we show when --reword and another incompatible option are given?" is "we want to point it out that --reword and --amend are not to be used together" and not "and we should not ever say anything else".

Just like back when we started making sure everybody sets user.name configuration variable (and the way to do so was to give warnings and advices at strategic places), output can be added to commands where authors if each individual feature would not expect. I would want to see our tests prepared for such an occasion. We cannot be perfectly prepared, of course, but keeping the expectation focused enough to check what really matters for the objective at hand would help.

Thanks.
Previous: Phillip WoodNext: Christian Couder
Message 8 of 21 in “commit: add an option to reword the last commit”
  1. 0/3 commit: add an option to reword the last commitPhillip Wood via GitGitGadget, Sep 21, 2020
  2. 3/3 commit: add an option the reword HEADPhillip Wood via GitGitGadget, Sep 21, 2020
  3. Eric SunshineSep 21, 2020
  4. Phillip WoodSep 21, 2020
  5. Eric SunshineSep 21, 2020
  6. Junio C HamanoSep 21, 2020
  7. Phillip WoodSep 22, 2020
  8. Junio C HamanoSep 22, 2020
  9. Christian CouderSep 21, 2020
  10. Phillip WoodSep 21, 2020
  11. Johannes SchindelinSep 23, 2020
  12. Phillip WoodSep 23, 2020
  13. Johannes SchindelinSep 23, 2020
  14. Phillip WoodSep 24, 2020
  15. Junio C HamanoSep 24, 2020
  16. 1/3 commit docs: use backquotes when quoting optionsPhillip Wood via GitGitGadget, Sep 21, 2020
  17. 2/3 commit: reorder synopsisPhillip Wood via GitGitGadget, Sep 21, 2020
  18. Junio C HamanoSep 22, 2020
  19. Phillip WoodSep 22, 2020
  20. Junio C HamanoSep 22, 2020
  21. Junio C HamanoSep 21, 2020

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.