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

Re: [PATCH/WIP] Repair DF conflicts during fetch.

From
TMThomas Miller <jackerran@gmail.com>
Date
Dec 1, 2013, 15:03 UTC
Message-ID
<CAECD2aGaL84n01-0fuNfyy-mx8NPKz2Vbhy3LpTgdOxgWayERw@mail.gmail.com>
In-Reply-To
<871u1zf2nd.fsf@thomasrast.ch>
On Fri, Nov 29, 2013 at 1:07 PM, Thomas Rast <tr@thomasrast.ch> wrote:
Show 47 quoted lines
> Tom Miller <jackerran@gmail.com> writes:
>
>> When a DF conflict occurs during a fetch, --prune should be able to fix
>> it. When fetching with --prune, the fetching process happens before
>> pruning causing the DF conflict to persist and report an error. This
>> patch prunes before fetching, thus correcting DF conflicts during a
>> fetch.
>>
>> Signed-off-by: Tom Miller <jackerran@gmail.com>
>> ---
>>  builtin/fetch.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> Good catch.
>
> I can't comment on the correctness of the patch right now, but here's a
> test you could steal.  It just reproduces what you describe, and I did
> verify that it confirms the fix ;-)
>
> diff --git i/t/t5510-fetch.sh w/t/t5510-fetch.sh
> index 5d4581d..a981125 100755
> --- i/t/t5510-fetch.sh
> +++ w/t/t5510-fetch.sh
> @@ -614,4 +614,18 @@ test_expect_success 'all boundary commits are excluded' '
>         test_bundle_object_count .git/objects/pack/pack-${pack##pack    }.pack 3
>  '
>
> +test_expect_success 'branchname D/F conflict resolved by --prune' '
> +       git branch dir/file &&
> +       git clone . prune-df-conflict &&
> +       git branch -D dir/file &&
> +       git branch dir &&
> +       (
> +               cd prune-df-conflict &&
> +               git fetch --prune &&
> +               git rev-parse origin/dir >../actual
> +       ) &&
> +       git rev-parse dir >expect &&
> +       test_cmp expect actual
> +'
> +
>  test_done
>
>
> --
> Thomas Rast
> tr@thomasrast.ch

Thanks, I appreciate the test. I have added it and gave credit via a "Tested-by" section. I have been looking into adding a pruning header to "fix" the output, but that is just the first solution I've been able to come up with. I believe before I have an elegant solution I'll have to read the code more carefully and brush up on my C.

Thanks, Tom Miller

PS. I apologize for the duplicate message the mailing list rejected my first for not being plaintext only.

Previous: Thomas Rast
Message 4 of 4 in “Repair DF conflicts during fetch.”
  1. Repair DF conflicts during fetch.Tom Miller, Nov 29, 2013
  2. Repair DF conflicts during fetch.Tom Miller, Nov 29, 2013
  3. Thomas RastNov 29, 2013
  4. Thomas MillerDec 1, 2013

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.