git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Phillip Wood" <phillip.wood123@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Elijah Newren" <newren@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 0/4] prevent 'checkout -m' from losing staged changes
Date: Fri, 22 Mar 2019 16:31:34 +0700	[thread overview]
Message-ID: <20190322093138.13765-1-pclouds@gmail.com> (raw)

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/7d3742d6-73e4-2750-6ecb-9edf761d96dd@gmail.com/
[2] https://public-inbox.org/git/20190319093910.20229-1-pclouds@gmail.com/

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(-)

-- 
2.21.0.548.gd3c7d92dc2


             reply	other threads:[~2019-03-22  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22  9:31 Nguyễn Thái Ngọc Duy [this message]
2019-03-22  9:31 ` [PATCH 1/4] unpack-trees: keep gently check inside add_rejected_path Nguyễn Thái Ngọc Duy
2019-03-22  9:31 ` [PATCH 2/4] unpack-trees: rename "gently" flag to "quiet" Nguyễn Thái Ngọc Duy
2019-03-22  9:31 ` [PATCH 3/4] read-tree: add --quiet Nguyễn Thái Ngọc Duy
2019-03-22 17:18   ` Philip Oakley
2019-03-22  9:31 ` [PATCH 4/4] checkout: prevent losing staged changes with --merge Nguyễn Thái Ngọc Duy
2019-03-25 16:07   ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190322093138.13765-1-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).