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

Re: rev-list with multiple commits sharing same patch-id

From
Arnaud Morin <arnaud.morin@gmail.com>
Date
Jan 11, 2021, 18:25 UTC
Message-ID
<20210111182501.GB32482@sync>
In-Reply-To
<CAP8UFD3qt4xr4S1BgjPU-vm4qsb=+1JWc=LR_p1CUzTKaAcAoA@mail.gmail.com>
Hi,
Thanks for the link to the test file.

I patched the test file to add this new case (where the same patch-id is duplicated in the tree). This patch can be find in [1] I had to patch two existing tests to make them work again. I also added a new test with this new test-case (two identical patch-id in the same tree.) Note that I still have one test (outside my new one) which is failing:

not ok 10 - name-rev --exclude excludes matched patterns
I dont know why yet.

Moreover, I am willing to help fixing the code. I have the feeling that a patch needs to be done in revision.c, maybe in static void cherry_pick_list?

If you have any clue to help me?
Thanks.
[1] https://github.com/arnaudmorin/git/pull/1
-- 
Arnaud Morin

On 11.01.21 - 10:54, Christian Couder wrote:
> Hi,
> 
> On Sat, Jan 9, 2021 at 5:29 PM Arnaud Morin <arnaud.morin@gmail.com> wrote:
> 
> > I am struggling with a rev-list command, hope someone can give me a
> > clue on what is going on.
> 
> [...]
> 
> > However, when using git rev-list to perform a symmetric difference, git
> > is giving me a commit ID:
> > $ git rev-list --left-right --cherry-pick B...master
> > >dbf86d8aafc897a25a3093139b4237a62395041e
> 
> It looks like a bug. You might want to check the following test file
> and let us know if a similar case is tested in it, or not:
> 
> t6007-rev-list-cherry-pick-file.sh
> 
> If not, it might be a good idea to add one using 'test_expect_failure'
> instead of 'test_expect_success' to document the failure.
> 
> Thanks,
> Christian.
> 
> 
> > Note that this commit is not empty
> > $ git show dbf86d8aafc897a25a3093139b4237a62395041e --stat
> > commit dbf86d8aafc897a25a3093139b4237a62395041e (origin/master, master)
> > Author: Arnaud Morin <hidden@mail>
> > Date:   Sat Jan 9 10:30:10 2021 +0100
> >
> >     remove line2 and add line4 (bis)
> >
> >  a | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >
> >
> > So, from git rev-list perspective, there is a diff.
> >
> > After digging a little bit, the thing is that this commit is having the
> > following patch-id:
> > $ git show dbf86d8aafc897a25a3093139b4237a62395041e | git patch-id
> > 20f4ace68e80a751b07d78a27c94e83d6c5314bc dbf86d8aafc897a25a3093139b4237a62395041e
> >
> > Which is also already existing in an other commit:
> > $ for c in $(git rev-list HEAD) ; do git show $c |git patch-id |grep 20f4ace68e80a751b07d78a27c94e83d6c5314bc; done
> > 20f4ace68e80a751b07d78a27c94e83d6c5314bc dbf86d8aafc897a25a3093139b4237a62395041e
> > 20f4ace68e80a751b07d78a27c94e83d6c5314bc 8969d3fa9159730fd3b23199873bfb26e3d20027
> >
> > So, is it normal that rev-list is not able to figure out that a commit
> > is existing in both branch when 2 commits share the same patch-id?
> >
> > Is there any way to prevent rev-list from showing this commit?
> >
> > Thanks for your help.
> >
> >
> > PS. I have uploaded my test repo here:
> > https://gitlab.com/arnaudmorin/git-rev-list
> >
> >
> > --
> > Arnaud Morin
> >
Previous: Christian CouderNext: Jeff King
Message 4 of 15 in “rev-list with multiple commits sharing same patch-id”
  1. Arnaud MorinJan 9, 2021
  2. Arnaud MorinJan 11, 2021
  3. Christian CouderJan 11, 2021
  4. Arnaud MorinJan 11, 2021
  5. Jeff KingJan 12, 2021
  6. Jeff KingJan 12, 2021
  7. Arnaud MorinJan 12, 2021
  8. patch-ids: handle duplicate hashmap entriesJeff King, Jan 12, 2021
  9. Arnaud MorinJan 12, 2021
  10. Junio C HamanoJan 12, 2021
  11. Arnaud MorinJan 13, 2021
  12. Jeff KingJan 13, 2021
  13. Junio C HamanoJan 13, 2021
  14. Jeff KingJan 13, 2021
  15. Junio C HamanoJan 13, 2021

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.