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

[PATCH 0/3] Show original filenames in merge tree

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 19, 2022, 06:57 UTC
Message-ID
<pull.1327.git.1660892256.gitgitgadget@gmail.com>

The git merge-tree command has not seen much of real-world usage (because it only recently learned to do something actually useful, and those changes have not been part of any official Git version yet), which means that we are prone to find corner-cases where we want to improve it in ways that we had not originally foreseen.

I had the chance to give it some real-world exposure and noticed the following concern: So far, git merge-tree shows munged file names in its output that would make sense if the corresponding files were written to disk (you cannot write a file and a directory of the same name, after all). But for an application or a web service relying on git merge-tree to operate in worktree-less mode, it makes much more sense to show the original file names because that's what the user needs to see.

So let's do that.
Note: The written-out tree object still uses the munged names, as do the
conflict messages. But the machine-parseable part now consistently uses the
original file names.

Also note: This patch series addresses a bug where the ls-files -u-formatted output would not reveal the correct file names in a rename/rename conflict.

This patch series is based on en/merge-tree.
Johannes Schindelin (3):
  merge-tree -z: always show the original file name first
  merge-tree: show the original file names in the conflict output
  t4301: add a test case involving a rename, type change & modification
 builtin/merge-tree.c             |  2 +-
 merge-ort.c                      | 16 +++++-----
 merge-ort.h                      |  1 +
 t/t4069-remerge-diff.sh          |  8 ++---
 t/t4301-merge-tree-write-tree.sh | 54 +++++++++++++++++++++++++-------
 5 files changed, 57 insertions(+), 24 deletions(-)
base-commit: 7260e87248e743b197d34c1caf3949ae4fa3bc12
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1327%2Fdscho%2Fshow-original-filenames-in-merge-tree-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1327/dscho/show-original-filenames-in-merge-tree-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1327
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 12 in “Show original filenames in merge tree”
  1. 0/3 Show original filenames in merge treeJohannes Schindelin via GitGitGadget, Aug 19, 2022
  2. 1/3 merge-tree -z: always show the original file name firstJohannes Schindelin via GitGitGadget, Aug 19, 2022
  3. Johannes SchindelinAug 19, 2022
  4. Elijah NewrenAug 20, 2022
  5. Elijah NewrenAug 20, 2022
  6. Elijah NewrenAug 21, 2022
  7. Johannes SchindelinAug 22, 2022
  8. Elijah NewrenAug 23, 2022
  9. Johannes SchindelinAug 26, 2022
  10. Elijah NewrenAug 30, 2022
  11. 2/3 merge-tree: show the original file names in the conflict outputJohannes Schindelin via GitGitGadget, Aug 19, 2022
  12. 3/3 t4301: add a test case involving a rename, type change & modificationJohannes Schindelin via GitGitGadget, Aug 19, 2022

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.