Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "Tao Klerks via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Tao Klerks <tao@klerks.biz>, Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Tao Klerks <tao@klerks.biz>
Subject: [PATCH v3 0/3] apply: support case-only renames in case-insensitive filesystems
Date: Sun, 28 May 2023 09:59:56 +0000	[thread overview]
Message-ID: <pull.1257.v3.git.1685267999.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1257.v2.git.1655655027.gitgitgadget@gmail.com>

As suggested almost a year ago in thread
CAPMMpojwV+f=z9sgc_GaUOTFBCUVdbrGW8WjatWWmC3WTcsoXw@mail.gmail.com,
proposing a fix to git-apply for case-only renames on case-insensitive
filesystems.

Changes in V3:

 * Rebased onto recent main
 * Renumbered now-duplicate-number test t4141 to t4142
 * Removed "RFC" prefix to officially submit; I don't see a better
   direction, and haven't received any corresponding feedback

As mentioned in V2, I'm not super-happy with the duplication of filename
tracking tables, but I do think this bug needs to be fixed, and I don't see
any other way to do so. The fundamental rule this change implements is that
filesystem filename duplication checks should respect the core.ignorecase
option, but index filename duplication checks should not.

Junio C Hamano (1):
  t4142: test "git apply" with core.ignorecase

Tao Klerks (2):
  reset: new failing test for reset of case-insensitive duplicate in
    index
  apply: support case-only renames in case-insensitive filesystems

 apply.c                |  81 +++++++++----
 apply.h                |   5 +-
 t/t4142-apply-icase.sh | 258 +++++++++++++++++++++++++++++++++++++++++
 t/t7104-reset-hard.sh  |  11 ++
 4 files changed, 334 insertions(+), 21 deletions(-)
 create mode 100755 t/t4142-apply-icase.sh


base-commit: 4a714b37029a4b63dbd22f7d7ed81f7a0d693680
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1257%2FTaoK%2Ftao-apply-case-insensitive-renames-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1257/TaoK/tao-apply-case-insensitive-renames-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/1257

Range-diff vs v2:

 1:  efd3bd4cdda ! 1:  8ad60943c66 t4141: test "git apply" with core.ignorecase
     @@ Metadata
      Author: Junio C Hamano <gitster@pobox.com>
      
       ## Commit message ##
     -    t4141: test "git apply" with core.ignorecase
     +    t4142: test "git apply" with core.ignorecase
      
          Signed-off-by: Junio C Hamano <gitster@pobox.com>
      
     - ## t/t4141-apply-icase.sh (new) ##
     + ## t/t4142-apply-icase.sh (new) ##
      @@
      +#!/bin/sh
      +
 2:  1226fbd3caf = 2:  ab1cdd95e03 reset: new failing test for reset of case-insensitive duplicate in index
 3:  04d83283716 ! 3:  52359738532 apply: support case-only renames in case-insensitive filesystems
     @@ Commit message
          account for case-insensitive filesystems yet.
      
          Because the index is inherently case-sensitive even on a
     -    case-insensitive filesystem, we actually need this mechanism to be
     +    case-insensitive filesystem, we actually need this mechanism to
          handle both requirements, lest we fail to account for conflicting
          files only in the index.
      
     @@ apply.c: void clear_apply_state(struct apply_state *state)
      +	 */
       }
       
     - static void mute_routine(const char *msg, va_list params)
     + static void mute_routine(const char *msg UNUSED, va_list params UNUSED)
      @@ apply.c: static int read_file_or_gitlink(const struct cache_entry *ce, struct strbuf *buf
       	return read_blob_object(buf, &ce->oid, ce->ce_mode);
       }
     @@ apply.h: struct apply_state {
       	/*
       	 * This is to save reporting routines before using
      
     - ## t/t4141-apply-icase.sh ##
     -@@ t/t4141-apply-icase.sh: test_expect_success setup '
     + ## t/t4142-apply-icase.sh ##
     +@@ t/t4142-apply-icase.sh: test_expect_success setup '
              git diff HEAD HEAD^ -- file1 >deletion-patch &&
              git diff --cached HEAD -- file1 file2 >rename-file1-to-file2-patch &&
              git diff --cached HEAD -- file1 File1 >rename-file1-to-File1-patch &&
     @@ t/t4141-apply-icase.sh: test_expect_success setup '
       '
       
       # Basic creation, deletion, modification and renaming.
     -@@ t/t4141-apply-icase.sh: test_expect_success 'creation and deletion' '
     +@@ t/t4142-apply-icase.sh: test_expect_success 'creation and deletion' '
              test_must_fail git rev-parse --verify :file1
       '
       
     @@ t/t4141-apply-icase.sh: test_expect_success 'creation and deletion' '
              # start at "initial" with file0 only
              git reset --hard initial &&
       
     -@@ t/t4141-apply-icase.sh: test_expect_success 'modificaiton' '
     +@@ t/t4142-apply-icase.sh: test_expect_success 'modificaiton' '
              test_cmp_rev :file0 "$file0blob"
       '
       
     @@ t/t4141-apply-icase.sh: test_expect_success 'modificaiton' '
              # start from file0 and file1
              git reset --hard current &&
       
     -@@ t/t4141-apply-icase.sh: test_expect_success 'rename file1 to file2' '
     +@@ t/t4142-apply-icase.sh: test_expect_success 'rename file1 to file2' '
              test_cmp_rev :file1 "$file1blob"
       '
       
     @@ t/t4141-apply-icase.sh: test_expect_success 'rename file1 to file2' '
              # start from file0 and file1
              git reset --hard current &&
       
     -@@ t/t4141-apply-icase.sh: test_expect_success 'rename file1 to file2' '
     +@@ t/t4142-apply-icase.sh: test_expect_success 'rename file1 to file2' '
              test_cmp_rev :file1 "$file1blob"
       '
       

-- 
gitgitgadget

  parent reply	other threads:[~2023-05-28 10:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 17:03 [PATCH] apply: support case-only renames in case-insensitive filesystems Tao Klerks via GitGitGadget
2022-06-11 19:17 ` Junio C Hamano
2022-06-12 23:35   ` Junio C Hamano
2022-06-14  6:22     ` Tao Klerks
2022-06-15 11:24       ` Tao Klerks
2022-06-14  5:13   ` Tao Klerks
2022-06-18  0:45     ` Junio C Hamano
2022-06-18 15:34       ` Tao Klerks
2022-06-12 23:30 ` Junio C Hamano
2022-06-13 18:12   ` Junio C Hamano
2022-06-14  6:26     ` Tao Klerks
2022-06-14  6:16   ` Tao Klerks
2022-06-19 16:10 ` [PATCH v2 0/3] RFC: " Tao Klerks via GitGitGadget
2022-06-19 16:10   ` [PATCH v2 1/3] t4141: test "git apply" with core.ignorecase Junio C Hamano via GitGitGadget
2022-06-19 16:10   ` [PATCH v2 2/3] reset: new failing test for reset of case-insensitive duplicate in index Tao Klerks via GitGitGadget
2022-06-19 16:10   ` [PATCH v2 3/3] apply: support case-only renames in case-insensitive filesystems Tao Klerks via GitGitGadget
2022-10-10  4:09   ` [PATCH v2 0/3] RFC: " Tao Klerks
2023-05-28  9:59   ` Tao Klerks via GitGitGadget [this message]
2023-05-28  9:59     ` [PATCH v3 1/3] t4142: test "git apply" with core.ignorecase Junio C Hamano via GitGitGadget
2023-05-28  9:59     ` [PATCH v3 2/3] reset: new failing test for reset of case-insensitive duplicate in index Tao Klerks via GitGitGadget
2023-05-28  9:59     ` [PATCH v3 3/3] apply: support case-only renames in case-insensitive filesystems Tao Klerks via GitGitGadget

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=pull.1257.v3.git.1685267999.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=tao@klerks.biz \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).