Fix --recurse-submodules for submodule worktree changes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 1 replyIn review
- v30 of 5 patches 2 repliesSuperseded
- v2 posting 2/25 patches 2 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 posting 1/2 | 4 patches | 2 replies | Superseded | |
| v1 | 5 patches | 10 replies | Superseded |
Changes in v4 from the cover letter
* dropped the patch "t/helper/test-lazy-name-hash: fix compilation" (that snuck into v3 by accident, it is already present at remotes/origin/jh/memihash-opt, but I am carrying it locally in most branches currently.)
* Junio pointed out the micro-optimisation below, both in terms of readability as well as performance
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | t/lib-submodule-update.sh: clarify testt/ | +2 | 0 replies | |
| 2/4 | t/lib-submodule-update.sh: Fix test ignoring ignored files in submodulest/ | +1 | 0 replies | |
| 3/4 | unpack-trees: oneway_merge to update submodulesunpack-trees.c | +3 | 0 replies | |
| 4/4 | submodule: submodule_move_head omits old argument in forced casesubmodule.c t/ | +17 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCHv4 0/4] Fix --recurse-submodules for submodule worktree changes
v4:
* dropped the patch "t/helper/test-lazy-name-hash: fix compilation" (that snuck into v3 by accident, it is already present at remotes/origin/jh/memihash-opt, but I am carrying it locally in most branches currently.)
* Junio pointed out the micro-optimisation below, both in terms of readability as well as performance
unpack-trees.c +2 -2
@@ -2139,8 +2139,8 @@ int oneway_merge(const struct cache_entry * const *src, ie_match_stat(o->src_index, old, &st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE)) update |=CE_UPDATE ; } -if (S_ISGITLINK (old->ce_mode) &&should_update_submodules () && - o->update && !verify_uptodate (old, o)) +if (o->update &&S_ISGITLINK (old->ce_mode) && +should_update_submodules () && !verify_uptodate (old, o)) update |=CE_UPDATE ;add_entry (o, old, update,0 );return 0 ;
v3:
Thanks Junio for review of this series!
The only change in this version of the series is
unpack-trees.c +1 -1
@@ -2140,7 +2140,7 @@ int oneway_merge(const struct cache_entry * const *src, update |=CE_UPDATE ; }if (S_ISGITLINK (old->ce_mode) &&should_update_submodules () && - !verify_uptodate (old, o)) + o->update && !verify_uptodate (old, o)) update |=CE_UPDATE ;add_entry (o, old, update,0 );
v2:
I dropped the patch to same() as I realized we only need to fix the oneway_merge function, the others (two, three way merge) are fine as they have the checks already in place.
The test added in the last patch got slightly larger as now we also test for newly staged files to be blown away in the submodule.
v1:
The fix is in the last patch, the first patches are just massaging the code base to make the fix easy.
The second patch fixes a bug in the test, which was ineffective at testing. The third patch shows the problem this series addresses,
the fourth patch is a little refactoring, which I want to keep separate as I would expect it to be a performance regression[1].
The first patch is unrelated, but improves the readability of submodule test cases, which we'd want to improve further.
Thanks,
Stefan
Stefan Beller (4):
t/lib-submodule-update.sh: clarify test t/lib-submodule-update.sh: Fix test ignoring ignored files in
submodules
unpack-trees: oneway_merge to update submodules
submodule: submodule_move_head omits old argument in forced case
submodule.c | 4 +++- t/lib-submodule-update.sh | 19 +++++++++++++++++-- unpack-trees.c | 3 +++ 3 files changed, 23 insertions(+), 3 deletions(-)
Signature · 1 line
2.16.0.rc0.223.g4a4ac83678-goog