Re: "git revert" feature suggestion: revert the last commit to a file

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

 



Hi,

On Thu, 5 Feb 2009, Junio C Hamano wrote:

> Ingo Molnar <mingo@xxxxxxx> writes:
> 
> > * Junio C Hamano <gitster@xxxxxxxxx> wrote:
> >
> >> Ingo Molnar <mingo@xxxxxxx> writes:
> >> 
> >> > So i have to do something like:
> >> >
> >> >    git revert $(git log -1 --pretty=format:"%h" kernel/softlockup.c)
> >> >
> >> > (tucked away in a tip-revert-file helper script.)
> >> >
> >> > But it would be so much nicer if i could do the intuitive:
> >> >
> >> >    git revert kernel/softlockup.c
> >> >
> >> > Or at least, to separate it from revision names cleanly, something like:
> >> >
> >> >    git revert -- kernel/softlockup.c
> >> 
> >> All three shares one issue.  Does the syntax offer you a way to give
> >> enough information so that you can confidently say that it will find the
> >> commit that touched the path most recently?  How is the "most recently"
> >> defined?
> >> 
> >> At least you can restate the first one to:
> >> 
> >>     git revert $(git log -1 --pretty=format:"%h" core/softlockup -- kernel/softlockup.c)
> >> 
> >> to limit to "the one that touched this file _on this topic_".
> >
> > All in the current scope of the integration branch, sure. I.e. the same 
> > scope of commits that "git log kernel/softlockup.c" uses.
> 
> But that is not how ":/syntax" works, at least right now.  It traverses
> from tips of all refs and finds the newest one.  It might make sense to
> make the discovery start from the current branch not from all tips.

Yeah, it was a bad design, probably.

As it is, the syntax is not really useful to me, as my patch to make this 
a regular expression was not accepted.

Maybe it is time to rethink that syntax; I am pretty sure that there is no 
user out there.

Ciao,
Dscho

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

  Powered by Linux