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

Re: [PATCH] cvsimport - streamline temp index file creation and avoid creating empty tmpfiles

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Jun 24, 2006, 10:08 UTC
Message-ID
<46a038f90606240308g8ec9ceelb18ea505a8708b91@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.63.0606241145280.29667@wbgn013.biozentrum.uni-wuerzburg.de>
On 6/24/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Thank you. This fixes the error.
Your welcome!
Show 9 quoted lines
> HOWEVER, it does not fix the main problem: when I try to git-cvsimport,
> there is no index for that branch yet, since I used to git-cvsimport with
> the old cvsimport.
>
> Now, when cvsimport sees there is no index, it evidently assumes that the
> current state is an empty tree, which is *not* true.
>
> The effect is: the first commit removes all files from the tree which were
> not touched by the cvs commit. Bad.

I don't quite understand. No it shouldn't be the case -- it should create the index using git-read-tree based on the tip of the branch. Right after the call to tmpnam() the code looks like

 $index{$branch} = tmpnam();
 $ENV{GIT_INDEX_FILE} = $index{$branch};
 system("git-read-tree", $branch);
 die "read-tree failed: $?\n" if $?;
Show 6 quoted lines
> > This usage of tempfiles is open to a race condition
>
> I would not care too strongly about that. Eventually, I really would like
> this file to reside in $GIT_DIR, not /tmp, but whatever. That is not my
> biggest concern right now. That I cannot update since June 18th, however,
> is.
It's worrying me too. Running some tests now...
martin
Previous: Johannes Schindelin
Message 9 of 9 in “CVS import broken?”
  1. Johannes SchindelinJun 23, 2006
  2. cvsimport - streamline temp index file creation and avoid creating empty tmpfilesMartin Langhoff, Jun 24, 2006
  3. Junio C HamanoJun 24, 2006
  4. Johannes SchindelinJun 24, 2006
  5. Junio C HamanoJun 24, 2006
  6. Martin LanghoffJun 24, 2006
  7. Junio C HamanoJun 24, 2006
  8. Johannes SchindelinJun 24, 2006
  9. Martin LanghoffJun 24, 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.