cherry-pick: add `--empty` for more robust redundant commit handling
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest7 patches 3 repliesIn review
- v47 patches 7 repliesSuperseded
- v37 patches 12 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 8 patches | 25 replies | Superseded |
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | docs: address inaccurate `--empty` default with `--exec`Documentation/ t/ | +43 | 0 replies | |
| 2/7 | docs: clean up `--empty` formatting in git-rebase(1) and git-am(1)Documentation/ Documentation/ | +29 | 0 replies | |
| 3/7 | rebase: update `--empty=ask` to `--empty=stop`Documentation/ builtin/ t/ | +34 | 0 replies | |
| 4/7 | sequencer: handle unborn branch with `--allow-empty`sequencer.c t/ | +39 | 0 replies | |
| 5/7 | sequencer: do not require `allow_empty` for redundant commit optionssequencer.c | +7 | 0 replies | |
| 6/7 | cherry-pick: enforce `--keep-redundant-commits` incompatibilitybuiltin/ t/ | +15 | 0 replies | |
| 7/7 | cherry-pick: add `--empty` for more robust redundant commit handlingDocumentation/ builtin/ sequencer.c +2 more | +133 | 0 replies |
Reviews trailers per patch
None of the 7 patches has a Reviewed-by or Acked-by.
| Patch | Phillip Wood | Junio C Hamano |
|---|---|---|
| 1/7 | ||
| 2/7 | ||
| 3/7 | ||
| 4/7 | Helped-by | Helped-by |
| 5/7 | ||
| 6/7 | ||
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/7] cherry-pick: add `--empty` for more robust redundant commit handling
The ultimate goal of this series is to allow git-cherry-pick(1) to automatically drop redundant commits. The mechanism chosen is an --empty option that provides the same flexibility as the --empty options for git-rebase(1) and git-am(1).
Some secondary goals are to improve the consistency in the values and documentation for this option across the three commands.
See "Does extending --empty to git-cherry-pick make sense?" [1] for some context for why this option is desired in git-cherry-pick(1).
[1]: https://lore.kernel.org/git/CAHPHrSevBdQF0BisR8VK=jM=wj1dTUYEVrv31gLerAzL9=Cd8Q@mail.gmail.com
Along the way, I (with some help from Elijah and Phillip) found a few other things in the docs and related sequencer code to clean up.
This is the final planned re-roll of this series, addressing two minor style concerns with commit 4/7 as noted in this [2] thread. All other commits are left unchanged.
[2]: https://lore.kernel.org/git/[email protected]
Range-diff from v4:
1: f6b8a655cd = 1: f6b8a655cd docs: address inaccurate `--empty` default with `--exec`
2: 401de76c0b = 2: 401de76c0b docs: clean up `--empty` formatting in git-rebase(1) and git-am(1)
3: 031b3bb7bb = 3: 031b3bb7bb rebase: update `--empty=ask` to `--empty=stop`
4: fd53c39482 ! 4: d3bfe41819 sequencer: handle unborn branch with `--allow-empty`
@@ sequencer.c: static struct object_id *get_cache_tree_oid(struct index_state *ist
struct commit *head_commit;
struct index_state *istate = r->index;
+ const char *head_name;
-
-- if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL))
-- return error(_("could not resolve HEAD commit"));
++
+ if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL)) {
-+ /*
-+ * Check to see if this is an unborn branch
-+ */
-+ head_name = resolve_ref_unsafe("HEAD", RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE, &head_oid, NULL);
-+ if (!head_name || !starts_with(head_name, "refs/heads/") || !is_null_oid(&head_oid))
++ /* Check to see if this is an unborn branch */
++ head_name = resolve_ref_unsafe("HEAD",
++ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
++ &head_oid, NULL);
++ if (!head_name ||
++ !starts_with(head_name, "refs/heads/") ||
++ !is_null_oid(&head_oid))
+ return error(_("could not resolve HEAD commit"));
+ head_tree_oid = the_hash_algo->empty_tree;
+ } else {
+ head_commit = lookup_commit(r, &head_oid);
+- if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, &head_oid, NULL))
+- return error(_("could not resolve HEAD commit"));
+-
- head_commit = lookup_commit(r, &head_oid);
+ /*
+ * If head_commit is NULL, check_commit, called from
5: 90dca45c12 = 5: 5e690bca6e sequencer: do not require `allow_empty` for redundant commit options
6: ab3b6afc97 = 6: ed03908e9e cherry-pick: enforce `--keep-redundant-commits` incompatibility
7: 0e2577ea56 = 7: d3cf068c45 cherry-pick: add `--empty` for more robust redundant commit handlingBrian Lyles (7):
docs: address inaccurate --empty default with --exec
docs: clean up --empty formatting in git-rebase(1) and git-am(1)
rebase: update --empty=ask to --empty=stop
sequencer: handle unborn branch with --allow-empty
sequencer: do not require allow_empty for redundant commit options
cherry-pick: enforce --keep-redundant-commits incompatibility
cherry-pick: add --empty for more robust redundant commit handling
Documentation/git-am.txt | 20 ++++++--- Documentation/git-cherry-pick.txt | 30 ++++++++++--- Documentation/git-rebase.txt | 26 +++++++---- builtin/rebase.c | 16 ++++--- builtin/revert.c | 38 +++++++++++++++- sequencer.c | 72 ++++++++++++++++++------------- t/t3424-rebase-empty.sh | 55 +++++++++++++++++++++-- t/t3501-revert-cherry-pick.sh | 14 ++++-- t/t3505-cherry-pick-empty.sh | 51 +++++++++++++++++++++- t/t3510-cherry-pick-sequence.sh | 32 ++++++++++++++ 10 files changed, 286 insertions(+), 68 deletions(-)
Signature · 1 line
2.43.2