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

Re: Revert a single commit in a single file

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 25, 2011, 20:05 UTC
Message-ID
<AANLkTimRu13gfyoprwugxb0D64LZmSkSoJZBVLpTXOo3@mail.gmail.com>
In-Reply-To
<7vei6vao0p.fsf@alter.siamese.dyndns.org>
On Fri, Feb 25, 2011 at 20:54, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> But just like we now have:
>>
>>     Revert "some commit"
>>
>>     This partially reverts commit <sha1>.
>>
>> We could have with <path>:
>>
>>     Revert "some commit"
>>
>>     This partially reverts commit <sha1>. Only the path <path> has
>>     been reverted, which is X out of Y files changed in the original
>>     commit.
>>
>> Or something like that.
>
> Yes, that is exactly what I was suggesting, no?

Yes in the second paragraph, I was mainly just going to expand on it and provide a suggestion.

But I mainly wanted to point out that not having this feature means that people do completely manual reverts. So I think we'd have less "broken" history (message), not more as a result of this sort of thing.

Show 9 quoted lines
> On the similar line of thought, it might be a good idea to update the
> commit template we give slightly perhaps like...
>
>     Revert "some commit"
>
>     This partially reverts commit <sha1>.
>    +#
>    +# DESCRBE HERE how the change in <sha1>
>    +# was a wrong thing to do.

Yes this looks very good. Aside from the UI issue of someone expanding on why they did that *inside the comment* because that's what it suggests :)

    This partially reverts commit <sha1>.
    # DESCRIBE ABOVE ...
Would probably be better.
Previous: Junio C HamanoNext: Jay Soffian
Message 11 of 13 in “Revert a single commit in a single file”
  1. Thomas Ferris NicolaisenFeb 25, 2011
  2. Ævar Arnfjörð BjarmasonFeb 25, 2011
  3. Michael J GruberFeb 25, 2011
  4. Dario RodriguezFeb 25, 2011
  5. Michael J GruberFeb 25, 2011
  6. Thomas Ferris NicolaisenFeb 25, 2011
  7. Dario RodriguezFeb 25, 2011
  8. Junio C HamanoFeb 25, 2011
  9. Ævar Arnfjörð BjarmasonFeb 25, 2011
  10. Junio C HamanoFeb 25, 2011
  11. Ævar Arnfjörð BjarmasonFeb 25, 2011
  12. Jay SoffianFeb 25, 2011
  13. Dario RodriguezFeb 26, 2011

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.