Skip to content

merge-recursive: Avoid diagnostic on empty work tree

Brad King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3t3030-merge-recursive: Test known breakage with empty work treet/t3030-merge-recursive.sh+47 -02 replies
2/3read-cache.c: Thread lstat error through make_cache_entry signaturebuiltin/apply.c builtin/checkout.c builtin/reset.c +4 more+14 -110 replies
3/3merge-recursive: Tolerate missing file when HEAD is up to datemerge-recursive.c t/t3030-merge-recursive.sh+14 -94 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH/RFC 0/3] merge-recursive: Avoid diagnostic on empty work tree
Quoted 5 lines · Elijah Newren

Two options are just doing a stat to determine whether the file is present (which means we'll be stat'ing the file multiple times in these cases, which feels wasteful), or perhaps writing a modified make_cache_entry() with the behavior we want (seems like ugly code duplication). Suggestions?

Perhaps we can thread enough information through the make_cache_entry signature to allow the caller to know when lstat reported ENOENT. Here is a series that takes such an approach.

* Patch 1 is the original test case from $gmane/240853.

* Patch 2 extends the make_cache_entry signature to return lstat errno.

* Patch 3 uses this information to silence the add_cacheinfo diagnostic

-Brad

Brad King (3):
t3030-merge-recursive: Test known breakage with empty work tree read-cache.c: Thread lstat error through make_cache_entry signature
merge-recursive: Tolerate missing file when HEAD is up to date

 builtin/apply.c            |  2 +-
 builtin/checkout.c         |  2 +-
 builtin/reset.c            |  2 +-
 cache.h                    |  2 +-
 merge-recursive.c          | 22 ++++++++++++++--------
 read-cache.c               | 12 +++++++-----
 resolve-undo.c             |  2 +-
 t/t3030-merge-recursive.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 73 insertions(+), 18 deletions(-)
Signature · 1 line
1.8.5.2