git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn

From
EWEric Wong <normalperson@yhbt.net>
Date
Nov 9, 2006, 20:47 UTC
Message-ID
<20061109204759.GA8560@localdomain>
In-Reply-To
<455381C7.8080207@midwinter.com>
Steven Grimm <koreth@midwinter.com> wrote:
Show 20 quoted lines
> Junio C Hamano wrote:
> >Steven, I do not interact with real svn repository myself so I
> >can only judge from the test in this patch and Steven's test
> >case, so it would be more assuring for me if you can confirm it
> >fixes the issue for you.
> >  
> 
> It seems to; I can't make the problem happen any more. I am slightly 
> concerned -- but I don't know libsvn well enough to say for sure -- that 
> this doesn't actually *eliminate* the problem, but rather tightens the 
> window of opportunity down to some very small amount of time. Which is 
> certainly an improvement, of course!
> 
> Maybe only Eric can answer this, but from a cursory inspection, it 
> doesn't look like it actually locks the modified files before generating 
> the patch to apply. Is there still a possibility of losing a change that 
> hits the svn repository in the middle of git-svn dcommit running? Or 
> does locking happen implicitly somewhere I'm not seeing? (Again, I 
> haven't combed the code deeply, so it's entirely possible I've missed 
> something.)

The commit runs as a transaction on the server-side, where all the real locking occurs. SVN supports user-side locking (svn lock), but it is only advisory and can be taken/unlocked by other users (svn lock/unlock --force).

When SVN::Git::Editor is instantiated in commit_diff() (line 853), the 'r' parameter passed to it is the revision we'll generate our diffs against. Before, we were generating diffs against the latest revision.

We generate diffs against 'r' in SVN::Git::Editor::M() (line 3339) and SVN::Git::Editor::chg_file (line 3383) passing the $fbat baton object (which represents the file at revision 'r') around.

Previous: Steven GrimmNext: Steven Grimm
Message 8 of 9 in “git-svn can lose changes silently”
  1. Steven GrimmNov 9, 2006
  2. Seth FalconNov 9, 2006
  3. git-svn: fix dcommit losing changes when out-of-date from svnEric Wong, Nov 9, 2006
  4. Junio C HamanoNov 9, 2006
  5. Seth FalconNov 9, 2006
  6. Eric WongNov 9, 2006
  7. Steven GrimmNov 9, 2006
  8. Eric WongNov 9, 2006
  9. Steven GrimmNov 9, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.