Skip to content

prevent 'checkout -m' from losing staged changes

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4unpack-trees: keep gently check inside add_rejected_pathunpack-trees.c+9 -120 replies
2/4unpack-trees: rename "gently" flag to "quiet"builtin/checkout.c unpack-trees.c unpack-trees.h+5 -50 replies
3/4read-tree: add --quietDocumentation/git-read-tree.txt builtin/read-tree.c t/t7201-co.sh+8 -01 reply
4/4checkout: prevent losing staged changes with --mergebuiltin/checkout.c t/t7201-co.sh+11 -101 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] prevent 'checkout -m' from losing staged changes

During the 'git switch' discusion, Phillip found out that staged changes could be silently lost when doing 'git checkout -m'. The first attempt
[2] tries to fix it by warning and moving on, because t7201.10 would fail if we simply die() when there are staged changes.

This round, I update read-tree to be used in that test instead of 'checkout -m'. Then we are able to die().

I start a new thread to keep spam level down for other people, and to break free from 'git switch' thread because it's unrelated now.

Jonathan is included, just in case he still remembers something from 6a143aa2b2 (checkout -m: attempt merge when deletion of path was staged, 2014-08-12)

[1] https://public-inbox.org/git/[email protected]/
[2] https://public-inbox.org/git/[email protected]/

Nguyễn Thái Ngọc Duy (4):
unpack-trees: keep gently check inside add_rejected_path
unpack-trees: rename "gently" flag to "quiet"
read-tree: add --quiet
checkout: prevent losing staged changes with --merge

 Documentation/git-read-tree.txt |  4 ++++
 builtin/checkout.c              | 13 +++++++++++--
 builtin/read-tree.c             |  1 +
 t/t7201-co.sh                   |  9 ++-------
 unpack-trees.c                  | 25 +++++++++++--------------
 unpack-trees.h                  |  2 +-
 6 files changed, 30 insertions(+), 24 deletions(-)
Signature · 1 line
2.21.0.548.gd3c7d92dc2