Skip to contentSkip to conversation

Change in git-svn dcommit semantics?

DISCUSSION Seth Falcon 7 participants 13 messages Jun 15, 2016 – Aug 11, 2016

lore
Share & tools
lore
#8 lore raw
In reply to Jeff King
Quoted 8 lines · Jeff King
Quoted 6 lines · Brian Gernhardt
Quoted 5 lines
Quoted 3 lines

The --full-diff option helps because it shows the diff for other files (that do not have different number of substring COLLISION in the pre and postimage) in the same commit as well.

Yet another undocumented option. Sigh...

Quoted 8 lines
Quoted 5 lines

I'd send in a patch to fix that (little gnome work is what I do in Wikipedia, and seems to be what I do here), but the option seems to be in setup_revision.c:setup_revisions, which is used in several places. Is there a central place to put that in the documentation? Should there be?

Please read the rest of the thread for some explanation from Junio on how this option works.

I was trying to write quick documentation for this option, placing it in Documentation/diff-options.txt (is that the right place for it?), when I ran across --pickaxe-all. How do the two options differ?

~~ Brian

#5 lore raw
In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 5 lines · Brian Gernhardt

And is there an easier way to find these things than "git rev-list HEAD | git diff-tree -r -s --stdin -SCOLLISION | xargs git show"? I cobbled that together from poking around inside gitk (which mostly works in OS X, but has some issues that make me prefer the command line).

Quoted 7 lines

I typically do:

      git log --full-diff -p -SCOLLISION

The --full-diff option helps because it shows the diff for other files (that do not have different number of substring COLLISION in the pre and postimage) in the same commit as well.

Yet another undocumented option. Sigh...

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#12 lore raw
In reply to Eric Wong
Quoted 3 lines · Eric Wong

Huh? safe_qx should've croaked or died, causing git-svn to exit before it could do any damage (via git-reset or git-rebase). dcommit is not called inside any eval blocks, either...

*shrug* weird. Looking at the code, I don't see how I could have seen what I think I did. Reproducing the error in a sandbox doesn't show the git-reset behavior. So unless I can reproduce it, I must have done something else funny. Sorry for the noise.

Quoted 5 lines

Before, the 'remotes/git-svn..HEAD' argument meant absolutely nothing to dcommit (it silently ignored it). Nowadays, you only need 'HEAD~2', the 'remotes/git-svn..' is already implied.

git-svn dcommit HEAD~2

That's convenient in that it requires less typing. I will try to retrain my fingers. I'm in the habit of reviewing the commits not in svn with:

git log remotes/git-svn..HEAD

And then editing the command like to be 'svn dcommit' instead of log.

Cheers,

+ seth

#10 lore raw
In reply to Brian Gernhardt
Quoted 8 lines · Brian Gernhardt
Quoted 2 lines · Seth Falcon

git version 1.4.4.2.gee60-dirty
(the dirty is a hand edit to Makefile for prefix)

Just FYI: You can save Makefile variables in a "config.mak" file instead of having to dirty your working tree (and dealing with conflicts, etc). For example:

Hey, thanks, that's much nicer :-)

#9 lore raw
In reply to Brian Gernhardt
Quoted 5 lines · Brian Gernhardt

And is there an easier way to find these things than "git rev-list HEAD | git diff-tree -r -s --stdin -SCOLLISION | xargs git show"?  I cobbled that together from poking around inside gitk (which mostly works in OS X, but has some issues that make me prefer the command line).

git log -p -SCOLLISIONS ?

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#1 lore raw
In reply to Seth Falcon
Quoted 2 lines · Seth Falcon

git version 1.4.4.2.gee60-dirty
(the dirty is a hand edit to Makefile for prefix)

Just FYI: You can save Makefile variables in a "config.mak" file instead of having to dirty your working tree (and dealing with conflicts, etc). For example:

cat > config.mak <<EOF
prefix=/your/prefix/path/here/
EOF

Mine also has a few variables like "COLLISION_CHECK=paranoid" and my own prefix.

#2 lore raw

Hi,

Quoted 2 lines · Brian Gernhardt

Mine also has a few variables like "COLLISION_CHECK=paranoid" and my own prefix.

Just to wake sleeping tigers: have you done a "grep COLLISION_CHECK *" recently (where recently means any date after May 3rd, 2005)?

Ciao,
Dscho

#7 lore raw
In reply to Brian Gernhardt
Quoted 11 lines · Brian Gernhardt
Quoted 5 lines
Quoted 3 lines

The --full-diff option helps because it shows the diff for other files (that do not have different number of substring COLLISION in the pre and postimage) in the same commit as well.

Yet another undocumented option. Sigh...

I'd send in a patch to fix that (little gnome work is what I do in Wikipedia, and seems to be what I do here), but the option seems to be in setup_revision.c:setup_revisions, which is used in several places. Is there a central place to put that in the documentation? Should there be?

Please read the rest of the thread for some explanation from Junio on how this option works.

I think it makes sense to group the porcelain-ish options together for git-log/git-whatchanged (and potentially git-show). Really, they can take any of the diff-options or any of the rev-list options. The rev-list options are not currently grouped for inclusion in another man page. The diff options are available in diff-options.txt, but are not included by the log manpages. They probably should be.

#6 lore raw
In reply to Jakub Narebski
Quoted 7 lines · Jakub Narebski
Quoted 3 lines · Junio C Hamano

The --full-diff option helps because it shows the diff for other files (that do not have different number of substring COLLISION in the pre and postimage) in the same commit as well.

Yet another undocumented option. Sigh...

I'd send in a patch to fix that (little gnome work is what I do in Wikipedia, and seems to be what I do here), but the option seems to be in setup_revision.c:setup_revisions, which is used in several places. Is there a central place to put that in the documentation? Should there be?

#11 lore raw
In reply to Seth Falcon
Quoted 19 lines · Seth Falcon

Hi Eric,

I just updated to the latest git/git-svn (on branch 'master') and the workflow I've been using no longer seems to work:

   # review the commits I'm going to send to svn
   ziti:~/proj/bioc-2.0-git seth$ git log remotes/git-svn..HEAD
   # now send them
   ziti:~/proj/bioc-2.0-git seth$ git svn dcommit remotes/git-svn..HEAD

fatal: ambiguous argument
'refs/remotes/git-svn..remotes/git-svn..HEAD': unknown revision or
path not in the working tree. Use '--' to separate paths from
revisions 32768 at /Users/seth/scm/bin/git-svn line 2190
main::safe_qx('git-rev-list', '--no-merges', 'refs/remotes/git-svn..remotes/git-svn..HEAD') called at /Users/seth/scm/bin/git-svn line 610 main::dcommit('remotes/git-svn..HEAD') called at /Users/seth/scm/bin/git-svn line 197

Quoted 5 lines

At this point, my last commit seems to have been reset (although the changes are thankfully still in my working tree). If this happens to you, you can recover the last commit like:

git commit -a -v -c ORIG_HEAD

Huh? safe_qx should've croaked or died, causing git-svn to exit before it could do any damage (via git-reset or git-rebase). dcommit is not called inside any eval blocks, either...

Quoted 10 lines

And it seems that the new interface requires no extra args:

git svn dcommit

The new interface seems ok until things like

git svn dcommit remotes/git-svn..HEAD~2

are allowed (if ever). But it would be nice for the failure mode to not undo commits :-)

Before, the 'remotes/git-svn..HEAD' argument meant absolutely nothing to dcommit (it silently ignored it). Nowadays, you only need 'HEAD~2', the 'remotes/git-svn..' is already implied.

git-svn dcommit HEAD~2

Not specifying any argument implies that it is called with 'HEAD'

#3 lore raw
In reply to Johannes Schindelin
Quoted 5 lines · Johannes Schindelin
Quoted 2 lines

Mine also has a few variables like "COLLISION_CHECK=paranoid" and my own prefix.

Just to wake sleeping tigers: have you done a "grep COLLISION_CHECK *" recently (where recently means any date after May 3rd, 2005)?

Oh, well, that's cute. It's a configuration option that doesn't touch any code at all... Not that I really cared about the check, I just thought it was a nice paranoid thing to activate and I like a certain amount of paranoia in my SCMs. But maybe the description should be removed from the Makefile then? Or better yet, collision checking could be put back in?

And is there an easier way to find these things than "git rev-list HEAD | git diff-tree -r -s --stdin -SCOLLISION | xargs git show"? I cobbled that together from poking around inside gitk (which mostly works in OS X, but has some issues that make me prefer the command line).

#4 lore raw
Quoted 5 lines · Brian Gernhardt

And is there an easier way to find these things than "git rev-list HEAD | git diff-tree -r -s --stdin -SCOLLISION | xargs git show"? I cobbled that together from poking around inside gitk (which mostly works in OS X, but has some issues that make me prefer the command line).

I typically do:

	git log --full-diff -p -SCOLLISION

The --full-diff option helps because it shows the diff for other files (that do not have different number of substring COLLISION in the pre and postimage) in the same commit as well.

#0 lore raw

Hi Eric,

I just updated to the latest git/git-svn (on branch 'master') and the workflow I've been using no longer seems to work:

   # review the commits I'm going to send to svn
   ziti:~/proj/bioc-2.0-git seth$ git log remotes/git-svn..HEAD
   # now send them
   ziti:~/proj/bioc-2.0-git seth$ git svn dcommit remotes/git-svn..HEAD

fatal: ambiguous argument
'refs/remotes/git-svn..remotes/git-svn..HEAD': unknown revision or
path not in the working tree. Use '--' to separate paths from
revisions 32768 at /Users/seth/scm/bin/git-svn line 2190
main::safe_qx('git-rev-list', '--no-merges', 'refs/remotes/git-svn..remotes/git-svn..HEAD') called at /Users/seth/scm/bin/git-svn line 610 main::dcommit('remotes/git-svn..HEAD') called at /Users/seth/scm/bin/git-svn line 197

At this point, my last commit seems to have been reset (although the changes are thankfully still in my working tree). If this happens to you, you can recover the last commit like:

git commit -a -v -c ORIG_HEAD

And it seems that the new interface requires no extra args:

git svn dcommit

The new interface seems ok until things like

git svn dcommit remotes/git-svn..HEAD~2

are allowed (if ever). But it would be nice for the failure mode to not undo commits :-)

+ seth

git version 1.4.4.2.gee60-dirty