Re: RFC: Adding an option to log-like commands to call an external command for each revision

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

 



On Sat, Sep 11, 2010 at 11:56 AM, Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> `On Mon, Aug 30, 2010 at 03:08, Jeff King <peff@xxxxxxxx> wrote:
>> I think it is not very Unix-y. We already have many ways to to call a
>> command once per commit, including:
>>
>>  - for i in `git rev-list "$@"`; do git show $i; done
>>
>>  - git rev-list "$@" | xargs -n 1 git show
>>
>>  - git log -z "$@" | perl -0ne 'open(LESS, "|less"); print LESS'
>>
>> [snip]
>
> Yeah, it's not very Unixy, I just find it so useful that I thought
> there might be interest in adding it to Git. It's easily in the list
> of top 5 git commands that I use.

I also find myself wanting to walk through commits in a particular
order.  In my case, I don't want to run a command per commit, but
instead I want to check them out a la "git bisect." Let's pretend such
a command is called "git walk".  In in my case, I would run:

    git walk start --reverse 49ea7b8..e1ef3c1
    <compile, test, ...>
    git walk next
    <compile, test, ...>
    git walk next
    <...>
    git walk reset

In Ævar's case, he would just want:

    git walk start --reverse 49ea7b8..e1ef3c
    git walk run git show
    git walk reset

Or perhaps a shortcut:

    git walk start --reverse 49ea7b8..e1ef3c --run git show

There is already a simple implementation by August Lilleaas [1], but
it would be nice to re-use the git-bisect machinery.

Mark

[1] http://github.com/augustl/binbin/blob/master/git-walk
--
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]