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

Re: git-svn: File was not found in commit

From
Morgan Christiansson <git@mog.se>
Date
Jan 12, 2009, 00:04 UTC
Message-ID
<496A890C.8080208@mog.se>
In-Reply-To
<20090111215526.GA15533@atjola.homenet>
Björn Steinbrink wrote:
Show 24 quoted lines
> On 2009.01.09 18:19:01 +0100, Morgan Christiansson wrote:
>   
>> ------------------------------------------------------------------------
>> r10577 | morgan | 2008-11-28 18:31:00 +0000 (Fri, 28 Nov 2008) | 3 lines
>> Changed paths:
>>   A /branches/rails/rails/vendor/plugins/acts_as_xapian/.git/FETCH_HEAD
>>   M /branches/rails/rails/vendor/plugins/acts_as_xapian/.git/config
>>   M /branches/rails/rails/vendor/plugins/acts_as_xapian/.git/index
>>   M /branches/rails/rails/vendor/plugins/acts_as_xapian/.git/logs/HEAD
>>   M /branches/rails/rails/vendor/plugins/acts_as_xapian/.git/logs/refs/heads/master 
>> # -- THIS FILE --
>>     
> Unless I totally misread that line, SVN reports that the file was
> _modified_, not added. For the file to be modified, it seems reasonable
> to expect that it existed in the previous commit.
>
> Is there anything "special" about how that file came into existence in
> that branch? Without further knowledge, that looks like a svn bug, but
> hey, it's svn, it might do funny stuff on purpose ;-)
>
> Maybe you could provide a small test case/repo?
>
> Björn
>   
Something odd happened when "git svn fetch" was adding r10559 to git:
        A       rails/vendor/plugins/acts_as_xapian/README.txt
        A       rails/vendor/plugins/acts_as_xapian/.cvsignore
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/refs/heads/master
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/refs/remotes/origin/HEAD
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/refs/remotes/origin/master
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/HEAD
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/description
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/update
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/post-receive
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/post-update
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/pre-rebase
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/hooks/prepare-commit-msg
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/applypatch-msg
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/pre-applypatch
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/post-commit
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/commit-msg
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/hooks/pre-commit
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/logs/refs/heads/master
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/logs/refs/remotes/origin/HEAD
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/logs/refs/remotes/origin/master
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/logs/HEAD
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/config
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/index
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/objects/pack/pack-570449ffe8ce399eca81f286cf942e51ace03448.pack
Ignoring path 
rails/vendor/plugins/acts_as_xapian/.git/objects/pack/pack-570449ffe8ce399eca81f286cf942e51ace03448.idx
Ignoring path rails/vendor/plugins/acts_as_xapian/.git/info/exclude
W: +empty_dir: 
branches/rails/rails/vendor/plugins/acts_as_xapian/.git/branches
W: +empty_dir: 
branches/rails/rails/vendor/plugins/acts_as_xapian/.git/objects/info
W: +empty_dir: 
branches/rails/rails/vendor/plugins/acts_as_xapian/.git/refs/tags
r10559 = 4f33ee36a5d933a62081a76c7788fb46a9e6f0e8 (rails)

The "Ignoring path" message appears to be coming from git which is refusing to commit the .git directory. Which leads to git-svn being unaware of the files being ignored and giving an error when it can't find them.

#The following commands will create a repository that has this problem: cd ~ rm -rf gittest* svnadmin create gittest-repo svn co file:///$HOME/gittest-repo gittest-checkout cd gittest-checkout mkdir -p .git touch .git/file svn add .git svn commit -m "Create .git/file" echo 1 > .git/file svn commit -m "Modify .git/file"

# The following will try to import the repository, which fails. cd ~ mkdir gittest cd gittest git svn init file:///$HOME/gittest-repo git svn fetch

# Output:
$ git svn fetch
    A    .git/file
Ignoring path .git/file
r1 = ccc56451d54315bd253b65c514351e996fbe880e (git-svn)
.git/file was not found in commit 
ccc56451d54315bd253b65c514351e996fbe880e (r1)

# Cleanup rm -rf gittest gittest-repo gittest-checkout

I'm personally fine with these files being ignored by git, but git-svn needs to be aware that they are not added to the repository.

Previous: Björn SteinbrinkNext: Eric Wong
Message 4 of 8 in “git-svn: File was not found in commit”
  1. Morgan ChristianssonJan 9, 2009
  2. Morgan ChristianssonJan 11, 2009
  3. Björn SteinbrinkJan 11, 2009
  4. Morgan ChristianssonJan 12, 2009
  5. Eric WongJan 12, 2009
  6. Eric WongJan 12, 2009
  7. Morgan ChristianssonJan 12, 2009
  8. Eric WongJan 19, 2009

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.