threads / discuss / 6081

Re: Change in git-svn dcommit semantics?

Subject: Re: Change in git-svn dcommit semantics?

## tl;dr

13 messages between Dec 19, 2006 and Dec 22, 2006.

replies: 12people: 7as markdown or json

Seth Falcon· Dec 19, 2006, 21:12 UTC · lore

Change in git-svn dcommit semantics?

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
Eric Wong· Dec 19, 2006, 22:09 UTC · re: Seth Falcon · lore
Seth Falcon <sethfalcon@gmail.com> wrote:
Show 24 quoted lines
> 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

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

Show 10 quoted 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'
Seth Falcon· Dec 20, 2006, 03:05 UTC · re: Eric Wong · lore
Eric Wong <normalperson@yhbt.net> writes:
> 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.

Show 5 quoted 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
Brian Gernhardt· Dec 19, 2006, 23:02 UTC · re: Seth Falcon · lore
On Dec 19, 2006, at 4:12 PM, Seth Falcon wrote:
> 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.

Johannes Schindelin· Dec 19, 2006, 23:57 UTC · re: Brian Gernhardt · lore
Hi,
On Tue, 19 Dec 2006, Brian Gernhardt wrote:
> 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

Brian Gernhardt· Dec 20, 2006, 00:38 UTC · re: Johannes Schindelin · lore
On Dec 19, 2006, at 6:57 PM, Johannes Schindelin wrote:
Show 6 quoted 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).

Jakub Narebski· Dec 20, 2006, 00:52 UTC · re: Brian Gernhardt · lore
Brian Gernhardt wrote:
Show 5 quoted lines
> 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 ? 
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Junio C Hamano· Dec 20, 2006, 01:17 UTC · re: Brian Gernhardt · lore
Brian Gernhardt <benji@silverinsanity.com> writes:
Show 5 quoted lines
> 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.

Jakub Narebski· Dec 20, 2006, 11:38 UTC · re: Junio C Hamano · lore
Junio C Hamano wrote:
Show 15 quoted lines
> Brian Gernhardt <benji@silverinsanity.com> writes:
> 
>> 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.
Yet another undocumented option. Sigh...
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Brian Gernhardt· Dec 20, 2006, 11:47 UTC · re: Jakub Narebski · lore
On Dec 20, 2006, at 6:38 AM, Jakub Narebski wrote:
Show 7 quoted lines
> Junio C Hamano wrote:
>
>> 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?

Jeff King· Dec 20, 2006, 11:57 UTC · re: Brian Gernhardt · lore
On Wed, Dec 20, 2006 at 06:47:45AM -0500, Brian Gernhardt wrote:
Show 11 quoted 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.

Brian Gernhardt· Dec 22, 2006, 14:09 UTC · re: Jeff King · lore
On Dec 20, 2006, at 6:57 AM, Jeff King wrote:
Show 16 quoted lines
> On Wed, Dec 20, 2006 at 06:47:45AM -0500, Brian Gernhardt wrote:
>
>>>> 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 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
Seth Falcon· Dec 20, 2006, 03:07 UTC · re: Brian Gernhardt · lore
Brian Gernhardt <benji@silverinsanity.com> writes:
Show 8 quoted lines
> On Dec 19, 2006, at 4:12 PM, Seth Falcon wrote:
>
>> 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 :-)

← back to recent threads