git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision
@ 2011-11-03 15:12 Reuben Thomas
  2011-11-03 15:56 ` Frans Klaver
  2011-11-03 16:28 ` Thomas Rast
  0 siblings, 2 replies; 3+ messages in thread
From: Reuben Thomas @ 2011-11-03 15:12 UTC (permalink / raw)
  To: git

If I run

git svn dcommit COMMIT

with COMMIT being an unambiguous, but partial revision string, it
behaves like git svn dcommit, i.e. commits everything. (If I remember
to copy and paste the whole nine yards of the revision string, it
works as expected, i.e. commits just that revision.)

I'd expect it to work like other git commands, and understand partial
revision strings, or at least bail out saying it was an invalid
revision.

-- 
http://rrt.sc3d.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision
  2011-11-03 15:12 git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision Reuben Thomas
@ 2011-11-03 15:56 ` Frans Klaver
  2011-11-03 16:28 ` Thomas Rast
  1 sibling, 0 replies; 3+ messages in thread
From: Frans Klaver @ 2011-11-03 15:56 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: git

Hi,

On Thu, Nov 3, 2011 at 4:12 PM, Reuben Thomas <rrt@sc3d.org> wrote:
> If I run
>
> git svn dcommit COMMIT
>
> with COMMIT being an unambiguous, but partial revision string, it
> behaves like git svn dcommit, i.e. commits everything. (If I remember
> to copy and paste the whole nine yards of the revision string, it
> works as expected, i.e. commits just that revision.)
>
> I'd expect it to work like other git commands, and understand partial
> revision strings, or at least bail out saying it was an invalid
> revision.


Sounds like git-svn skips the rev-parse, or doesn't verify. Which
version of git is this?

Workaround would probably be something like

dcommit.sh:
#!/bin/sh
COMMIT=$1
THINGY=$(git rev-parse --verify $COMMIT) || exit $?
git svn dcommit THINGY

$ dcommit.sh COMMIT


Meh. Better fix git-svn.

Cheers,
Frans

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision
  2011-11-03 15:12 git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision Reuben Thomas
  2011-11-03 15:56 ` Frans Klaver
@ 2011-11-03 16:28 ` Thomas Rast
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Rast @ 2011-11-03 16:28 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: git

Reuben Thomas wrote:
> If I run
> 
> git svn dcommit COMMIT
> 
> with COMMIT being an unambiguous, but partial revision string, it
> behaves like git svn dcommit, i.e. commits everything.

In what git version?  How do I reproduce?  I just ran a simple test
and can't:

  svnadmin create svnrepo
  svn co file://$(pwd)/svnrepo svnwt
  cd svnwt
  echo a > a
  svn add a
  svn ci -m'do a'
  cd ..
  git svn clone file://$(pwd)/svnrepo gitwt
  cd gitwt
  echo b > a
  git add a
  git commit -mb
  echo c>a
  git add a
  git commit -mc
  git log --oneline
  git svn dcommit 1b4c4e1

where 1b4c4e1 was the abbreviated hash of the parent commit (i.e., the
commit 'b').  As expected, it commits everything *up to* 1b4c4e1 from
a detached HEAD, not affecting the current branch.

Note that this is different from what you describe:

> (If I remember to copy and paste the whole nine yards of the
> revision string, it works as expected, i.e. commits just that
> revision.)

It was never designed to commit "just that revision".

By "it" I mean 5eec27e (git-svn: let 'dcommit $rev' work on $rev
instead of HEAD, 2009-05-29), which changed it to the current
semantics and went into 1.6.4.  Before that, 'git svn dcommit <foo>'
did something weird and you should avoid giving it arguments.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-03 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 15:12 git svn dcommit COMMIT silently checks in everything if COMMIT is not a complete revision Reuben Thomas
2011-11-03 15:56 ` Frans Klaver
2011-11-03 16:28 ` Thomas Rast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).