git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, sunshine@sunshineco.com,
	Elijah Newren <newren@gmail.com>
Subject: [PATCH v2 0/2] Address recovery failures with directory/file conflicts
Date: Fri, 13 Jul 2018 09:33:29 -0700	[thread overview]
Message-ID: <20180713163331.22446-1-newren@gmail.com> (raw)
In-Reply-To: <20180711051834.28181-1-newren@gmail.com>

This patch series fixes several "recovery" commands that outright fail
or do not fully recover when directory-file conflicts are present.
This includes:
   * git read-tree --reset HEAD
   * git am --skip
   * git am --abort
   * git merge --abort (or git reset --merge)
   * git reset --hard

Changes since v1 (full range-diff below):
  - Make use of test_write_lines, as suggested by Eric.
  - Provide a little more explanation in one of the commit messages, as
    suggested by Junio.

Elijah Newren (2):
  t1015: demonstrate directory/file conflict recovery failures
  read-cache: fix directory/file conflict handling in
    read_index_unmerged()

 read-cache.c                         |  13 +--
 t/t1015-read-index-unmerged.sh       | 123 +++++++++++++++++++++++++++
 t/t6020-merge-df.sh                  |   3 -
 t/t6042-merge-rename-corner-cases.sh |   1 -
 4 files changed, 131 insertions(+), 9 deletions(-)
 create mode 100755 t/t1015-read-index-unmerged.sh

1:  a85e462914 ! 1:  8f53327a8d t1015: demonstrate directory/file conflict recovery failures
    @@ -29,7 +29,7 @@
     +	(
     +		cd df_plus_modify_delete &&
     +
    -+		printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters &&
    ++		test_write_lines a b c d e f g h >letters &&
     +		git add letters &&
     +		git commit -m initial &&
     +
2:  43d5b0a5ae ! 2:  990a469d44 read-cache: fix directory/file conflict handling in read_index_unmerged()
    @@ -53,7 +53,9 @@
         we can just skip the DFCHECK and allow both the file and directory to
         appear in the index.  The temporary simultaneous appearance of the
         directory and file entries in the index will be removed by the callers
    -    before they attempt to write the index anywhere.
    +    by calling unpack_trees(), which excludes these unmerged entries marked
    +    with CE_CONFLICTED flag from the resulting index, before they attempt to
    +    write the index anywhere.
     
         Signed-off-by: Elijah Newren <newren@gmail.com>
     
-- 
2.18.0.645.g72fe132ec2

  parent reply	other threads:[~2018-07-13 16:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11  5:18 [PATCH 0/2] Address recovery failures with directory/file conflicts Elijah Newren
2018-07-11  5:18 ` [PATCH 1/2] t1015: demonstrate directory/file conflict recovery failures Elijah Newren
2018-07-11  9:21   ` Eric Sunshine
2018-07-11 18:23     ` Elijah Newren
2018-07-11  5:18 ` [PATCH 2/2] read-cache: fix directory/file conflict handling in read_index_unmerged() Elijah Newren
2018-07-11 17:03   ` Junio C Hamano
2018-07-11 18:24     ` Elijah Newren
2018-07-13 16:33 ` Elijah Newren [this message]
2018-07-13 16:33   ` [PATCH v2 1/2] t1015: demonstrate directory/file conflict recovery failures Elijah Newren
2018-07-13 16:33   ` [PATCH v2 2/2] read-cache: fix directory/file conflict handling in read_index_unmerged() Elijah Newren
2018-07-13 16:45   ` [PATCH v2 0/2] Address recovery failures with directory/file conflicts Elijah Newren
2018-07-31 17:12   ` [PATCH v3 " Elijah Newren
2018-07-31 17:12     ` [PATCH v3 1/2] t1015: demonstrate directory/file conflict recovery failures Elijah Newren
2018-07-31 17:12     ` [PATCH v3 2/2] read-cache: fix directory/file conflict handling in read_index_unmerged() 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20180713163331.22446-1-newren@gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).