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

Re: [PATCH] New files in git weren't being downloaded during CVS update

From
APAndy Parkins <andyparkins@gmail.com>
Date
Jan 22, 2007, 10:44 UTC
Message-ID
<200701221044.49467.andyparkins@gmail.com>
In-Reply-To
<200701211425.12971.andyparkins@gmail.com>
On Sunday 2007 January 21 14:25, Andy Parkins wrote:
> This is in response to Simon Schubert's suggestion that T_ADDED is an
> inappropriate category for a remotely added file.  Instead this treats
> remotely added files the same as remotely changed files.

I'm still concerned that this fix is not right. Having thought more about it, I suspect that this breaks the other "added-file" case, where the file is added locally but not remotely.

There are three key cases:
 1. File present locally and remotely.  Modified remotely.  Response "U"
 2. File present locally only.  Response should be "A"
 3. File present remotely only.  Response should be "U"

I think the real problem is that both 2 and 3 are being handled in the same place. Hence, my patch, which has fixed case 3; will have broken case 2.

I need a bit of confirmation from Martin; but I suspect that the correct fix is something like this:

    elsif ( (!defined($wrev) || $wrev == 0) && !defined($meta->{revision})
    {
        $log->info("Tell the client the file will be added");

If I'm correct, this would only run the added section when there is no matching revision in the repository - this would be case 2. Then case 3 would be handled as the else to this if, which handles every other case.

My testing of this works, but I'd like confirmation that I'm right in this thinking? Patch to follow...

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Previous: Junio C HamanoNext: Andy Parkins
Message 5 of 8 in “New files in git weren't being downloaded during CVS update”
  1. New files in git weren't being downloaded during CVS updateAndy Parkins, Jan 21, 2007
  2. Junio C HamanoJan 22, 2007
  3. Martin LanghoffJan 22, 2007
  4. Junio C HamanoJan 22, 2007
  5. Andy ParkinsJan 22, 2007
  6. New files in git weren't being downloaded during CVS updateAndy Parkins, Jan 22, 2007
  7. New files in git weren't being downloaded during CVS updateAndy Parkins, Jan 22, 2007
  8. Simon 'corecode' SchubertJan 22, 2007

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.