All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Revert a single commit in a single file
Date: Fri, 25 Feb 2011 10:53:04 -0800	[thread overview]
Message-ID: <7v8vx4aqun.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTikpdGfAAUMu_7DfA-GRUv7gKn5Yc9RnJwo2iKoM@mail.gmail.com> (Thomas Ferris Nicolaisen's message of "Fri\, 25 Feb 2011 11\:34\:18 +0100")

Thomas Ferris Nicolaisen <tfnico@gmail.com> writes:

> I tried asking the same question on the "newbie" list some time ago:
>
> http://groups.google.com/group/git-users/browse_thread/thread/d562b4eeac016711
>
> Basically, when I go
>> git revert <commit> <path>
>
> .. my expectation was that a new commit would be made reverting the
> changes from the old commit, but only for specified path/file.
>
> Maybe it's a bit of a corner-case, but still would be nice to have
> once in a while. What do you think?

I am afraid that it would lead to encouraging people to record a horribly
broken history, unless you think carefully about what the resulting commit
log message should describe.  It would look _as if_ you negated the effect
of the original commit as a whole, but in reality you are only reverting
just a part of what you chose to revert with <path>.

We do encourage people to record the _reason_ why the particular commit
was removed by not supporting "-m <message>" option to "git revert"
command, but the commit template in the editor given to the user should
make it absolutely clear that the particular partial revert is reverting
only a part of the original commit, and need additional words to strongly
encourage to record why only that part and not other parts are reverted.

  parent reply	other threads:[~2011-02-25 18:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 10:34 Revert a single commit in a single file Thomas Ferris Nicolaisen
2011-02-25 11:17 ` Ævar Arnfjörð Bjarmason
2011-02-25 12:37   ` Michael J Gruber
2011-02-25 12:48     ` Dario Rodriguez
2011-02-25 13:05       ` Michael J Gruber
2011-02-25 14:38         ` Thomas Ferris Nicolaisen
2011-02-25 15:19           ` Dario Rodriguez
2011-02-25 18:53 ` Junio C Hamano [this message]
2011-02-25 19:43   ` Ævar Arnfjörð Bjarmason
2011-02-25 19:54     ` Junio C Hamano
2011-02-25 20:05       ` Ævar Arnfjörð Bjarmason
2011-02-25 20:22       ` Jay Soffian
2011-02-26  0:27         ` Dario Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v8vx4aqun.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tfnico@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.