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

[PATCH 0/9] subtree: fix split and merge after annotated tag was squash-merged

From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 21, 2022, 15:13 UTC
Message-ID
<pull.1390.git.1666365219.gitgitgadget@gmail.com>

This series fixes a limitation of 'git subtree merge' and 'git subtree split' that would fail when the previous squash-merge merged an annotated tag of the subtree repository that is missing locally.

The 5 first commits are small improvements for coherency with the rest of the code base, robustness, user experience and maintanability.

Commits 6-7 are small refactors that prepare for the fix in the next commits. Commits 8-9 fix the behaviour for merge and split, respectively.

I'm CC-ing people that worked on 'git subtree' recently.
Cheers!
Philippe Blain (9):
  test-lib-functions: mark 'test_commit' variables as 'local'
  subtree: use 'git rev-parse --verify [--quiet]' for better error
    messages
  subtree: add 'die_incompatible_opt' function to reduce duplication
  subtree: prefix die messages with 'fatal'
  subtree: define a variable before its first use in
    'find_latest_squash'
  subtree: use named variables instead of "$@" in cmd_pull
  subtree: process 'git-subtree-split' trailer in separate function
  subtree: fix squash merging after annotated tag was squashed merged
  subtree: fix split after annotated tag was squashed merged
 contrib/subtree/git-subtree.sh     | 177 +++++++++++++++++++----------
 contrib/subtree/git-subtree.txt    |  16 ++-
 contrib/subtree/t/t7900-subtree.sh |  60 +++++++++-
 t/test-lib-functions.sh            |  16 +--
 4 files changed, 192 insertions(+), 77 deletions(-)
base-commit: 45c9f05c44b1cb6bd2d6cb95a22cf5e3d21d5b63
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1390%2Fphil-blain%2Fsubtree-pull-tag-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1390/phil-blain/subtree-pull-tag-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1390
-- 
gitgitgadget
Next: Philippe Blain via GitGitGadget
Message 1 of 20 in “subtree: fix split and merge after annotated tag was squash-merged”
  1. 0/9 subtree: fix split and merge after annotated tag was squash-mergedPhilippe Blain via GitGitGadget, Oct 21, 2022
  2. 3/9 subtree: add 'die_incompatible_opt' function to reduce duplicationPhilippe Blain via GitGitGadget, Oct 21, 2022
  3. Ævar Arnfjörð BjarmasonOct 21, 2022
  4. Philippe BlainOct 26, 2022
  5. 1/9 test-lib-functions: mark 'test_commit' variables as 'local'Philippe Blain via GitGitGadget, Oct 21, 2022
  6. Junio C HamanoOct 21, 2022
  7. Philippe BlainOct 26, 2022
  8. Junio C HamanoOct 26, 2022
  9. 5/9 subtree: define a variable before its first use in 'find_latest_squash'Philippe Blain via GitGitGadget, Oct 21, 2022
  10. 2/9 subtree: use 'git rev-parse --verify [--quiet]' for better error messagesPhilippe Blain via GitGitGadget, Oct 21, 2022
  11. 4/9 subtree: prefix die messages with 'fatal'Philippe Blain via GitGitGadget, Oct 21, 2022
  12. Ævar Arnfjörð BjarmasonOct 21, 2022
  13. Philippe BlainOct 26, 2022
  14. 7/9 subtree: process 'git-subtree-split' trailer in separate functionPhilippe Blain via GitGitGadget, Oct 21, 2022
  15. 9/9 subtree: fix split after annotated tag was squashed mergedPhilippe Blain via GitGitGadget, Oct 21, 2022
  16. Ævar Arnfjörð BjarmasonOct 21, 2022
  17. Eric SunshineOct 21, 2022
  18. Philippe BlainOct 26, 2022
  19. 8/9 subtree: fix squash merging after annotated tag was squashed mergedPhilippe Blain via GitGitGadget, Oct 21, 2022
  20. 6/9 subtree: use named variables instead of "$@" in cmd_pullPhilippe Blain via GitGitGadget, Oct 21, 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.