Re: Revert a single commit in a single file

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

 



Thomas Ferris Nicolaisen <tfnico@xxxxxxxxx> 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.

--
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]