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

Re: [PATCH v2 6/7] wt-status.c: handle worktree renames

From
IDIgor Djordjevic <igor.d.djordjevic@gmail.com>
Date
Dec 28, 2017, 00:50 UTC
Message-ID
<fb29d5bf-daae-fa8b-b787-e536cd5f98c8@gmail.com>
In-Reply-To
<CACsJy8Dn_XKA8=iLRZpj2EKYOSZqHT0jw9o_HzPH_vncGGeCCQ@mail.gmail.com>
On 27/12/2017 02:06, Duy Nguyen wrote:
Show 9 quoted lines
> 
> >   ... <path><sep><origPath>
> >
> >   <path>     The pathname. In a renamed/copied entry, this
> >              is the path in the index and in the working tree.
> 
> Gaah.. as you may see in the other mail when I quoted this
> (incorrectly). I must have modified this file at some point and
> thought it was true (my version did not have "and in the worktree").

Ah, this explains a lot... :) I got really confused with your v2, it felt as the series took a strange turn, and in a kind of a subtle way :P

> The "and" is still problematic if you take this very seriously
> (because in this case index name and worktree name are different) but
> I think it's ok to ignore that "and" and switch it to "or".

Yes, I agree, and the change does feel like a good thing. But, I also now hope this doesn`t break any expectations, because... (read below)

Show 7 quoted lines
> >   <origPath> The pathname in the commit at HEAD. This is only
> >              present in a renamed/copied entry, and tells
> >              where the renamed/copied contents came from.
> >
> > If I`m reading this correctly, it should be vice-versa - value from
> > HEAD, being "original-file", should come last, where value from
> > working tree ("new-file") should be first.

... it totally slipped me that documentation is/was pretty strict about <origPath> being HEAD path (exclusively), where I was still expecting it to show renamed working tree "from" value as <origPath> in case of working tree (double) rename, too - where that exact (already renamed in index) path wasn`t to be found inside HEAD at all, so the working tree rename couldn`t really be shown as "source" and "target" rename pair, strictly following the "porcelain v2" specification... :/

I see now that your initial reply[1] was talking about this, but I didn`t focus on it much as you replied to it yourself shortly afterwards, and later v2 of the series came up.

Might be this is where you changed your offline documentation version, too, as that is what the sample patch was about :)

> Yeah I think the "where the renamed/copied contents came from" clears
> up my confusion in this format. Back to v1 it is!

I see you addressed this by loosening the restriction here a bit, too, making <origPath> be "pathname in the commit at HEAD _or in the index_", in your "[PATCH v3 6/6] wt-status.c: handle worktree renames"[2].

I repeat that this looks like the correct approach, making fully described working tree rename detection possible in porcelain in the first place, but also aligning output of "status" --porcelain variants with its default (--long) form.

Hopefully, on top of everything positive, it also doesn`t break anything (too much?)... :P Latest revision should now provide all the necessary ingredients to resolve what happened, for the (small?) price of tweaking previous expectations a bit.

Regards, Buga

[1] https://public-inbox.org/git/CACsJy8A=jZ9LAuM50GVjNT5gtdiYYMyMuPBSrJFO4LmKVQsETQ@mail.gmail.com/T/#mf2f5ae672ec6f4e1abecbd5fe65283e9d8fbed57 [2] https://public-inbox.org/git/20171227101839.26427-7-pclouds@gmail.com/T/#u

Previous: Duy NguyenNext: Igor Djordjevic
Message 22 of 37 in “[BUG] File move with `add -N` shows as rename to same name”
  1. Alex VandiverDec 23, 2017
  2. Duy NguyenDec 25, 2017
  3. status: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 25, 2017
  4. Igor DjordjevicDec 25, 2017
  5. Igor DjordjevicDec 25, 2017
  6. Igor DjordjevicDec 25, 2017
  7. Duy NguyenDec 26, 2017
  8. Duy NguyenDec 26, 2017
  9. Junio C HamanoDec 27, 2017
  10. Junio C HamanoDec 27, 2017
  11. Jeff HostetlerJan 2, 2018
  12. Duy NguyenJan 10, 2018
  13. 0/7 Renames in git-status "changed not staged" sectionNguyễn Thái Ngọc Duy, Dec 26, 2017
  14. 1/7 t2203: test status output with porcelain v2 formatNguyễn Thái Ngọc Duy, Dec 26, 2017
  15. 2/7 Use DIFF_DETECT_RENAME for detect_rename assignmentsNguyễn Thái Ngọc Duy, Dec 26, 2017
  16. 3/7 wt-status.c: coding style fixNguyễn Thái Ngọc Duy, Dec 26, 2017
  17. 4/7 wt-status.c: rename wt_status_change_data::scoreNguyễn Thái Ngọc Duy, Dec 26, 2017
  18. 5/7 wt-status.c: catch unhandled diff status codesNguyễn Thái Ngọc Duy, Dec 26, 2017
  19. 6/7 wt-status.c: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 26, 2017
  20. Igor DjordjevicDec 26, 2017
  21. Duy NguyenDec 27, 2017
  22. Igor DjordjevicDec 28, 2017
  23. Igor DjordjevicDec 28, 2017
  24. 7/7 wt-status.c: avoid double renames in short/porcelain formatNguyễn Thái Ngọc Duy, Dec 26, 2017
  25. Igor DjordjevicDec 26, 2017
  26. Duy NguyenDec 27, 2017
  27. Igor DjordjevicDec 27, 2017
  28. 0/6 Renames in git-status "changed not staged" sectionNguyễn Thái Ngọc Duy, Dec 27, 2017
  29. 1/6 t2203: test status output with porcelain v2 formatNguyễn Thái Ngọc Duy, Dec 27, 2017
  30. 2/6 Use DIFF_DETECT_RENAME for detect_rename assignmentsNguyễn Thái Ngọc Duy, Dec 27, 2017
  31. 3/6 wt-status.c: coding style fixNguyễn Thái Ngọc Duy, Dec 27, 2017
  32. 4/6 wt-status.c: catch unhandled diff status codesNguyễn Thái Ngọc Duy, Dec 27, 2017
  33. 5/6 wt-status.c: rename rename-related fields in wt_status_change_dataNguyễn Thái Ngọc Duy, Dec 27, 2017
  34. 6/6 wt-status.c: handle worktree renamesNguyễn Thái Ngọc Duy, Dec 27, 2017
  35. Igor DjordjevicDec 28, 2017
  36. Jeff HostetlerJan 2, 2018
  37. Torsten BögershausenDec 26, 2017

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.