I'm using git-svn
to work with an SVN repository. One of the things I want to be able to do is review changes with git diff
and all its nice options.
Sometimes, "work-in-progress" changes are committed to SVN, and I want to wait until the work is finished before reviewing. I'm wondering if there's an invocation of git diff
that will let me see all these related changes, without any intervening commits.
Visually, I have:
* e00 yet more irrelevant stuff
* a04 finish work
* a03 more wip
* d00 irrelevant stuff
* a02 more wip
* c00 other irrelevant stuff
* a01 more wip
* a00 start wip
* b00 state of tree before wip starts
I want to be able to see what the cumulative effect of the a**
commits are on top of b00
, without c00
, d00
, or e00
. git diff b00 a04
has irrelevant changes. git show a0{0,1,2,3,4}
gives too much intermediate noise.
I'd like to be able to do this without creating a throw-away branch, as my current approach does.
You really do need a temporary place to aggregate the changes, so your current method is fine. But you can use an unnamed branch (a "detached HEAD") to make it automatically go away:
$ git checkout --detach b00
(or without --detach
, a00^
: either way, get current with b00
but also detach HEAD
), then exactly as before:
$ git cherry-pick a0{0,1,2,3,4}
$ git diff master...
$ git checkout master
and you're done: there's no branch to delete.