Re: RFC: Adding an option to log-like commands to call an external command for each revision
- From
Mark Lodato <lodatom@gmail.com>
- Date
- Sep 11, 2010, 17:09 UTC
- Message-ID
- <AANLkTikmCA2Cidz1UEDGH5j94_HucvJPGj27g8p_pcEi@mail.gmail.com>
- In-Reply-To
- <AANLkTi=WokEQMDc92SoWXPJW67dy0q79WW9RajrBHRx3@mail.gmail.com>
On Sat, Sep 11, 2010 at 11:56 AM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 15 quoted lines
> `On Mon, Aug 30, 2010 at 03:08, Jeff King <peff@peff.net> 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 resetIn Ævar's case, he would just want:
git walk start --reverse 49ea7b8..e1ef3c
git walk run git show
git walk resetOr 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