From: "Philip Oakley" <philipoakley@iee.org>
To: "Sérgio Basto" <sergio@serjux.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: <git@vger.kernel.org>, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] commit: ignore assume-unchanged files in "commmit <file>" mode
Date: Thu, 11 Dec 2014 23:23:33 -0000 [thread overview]
Message-ID: <35EB570A2A994662AA2E89910ECE9668@PhilipOakley> (raw)
In-Reply-To: 1418093090.19104.1.camel@segulix
From: "Sérgio Basto" <sergio@serjux.com> Sent: Tuesday, December 09,
2014 2:44 AM
> On Sex, 2014-12-05 at 17:56 +0700, Nguyễn Thái Ngọc Duy wrote:
>> In the same spirit of 7fce6e3 (commit: correctly respect
>> skip-worktree
>> bit - 2009-12-14), if a file is marked unchanged, skip it.
>>
>> Noticed-by: Sérgio Basto <sergio@serjux.com>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>> builtin/commit.c | 2 +-
>> t/t2106-update-index-assume-unchanged.sh | 10 ++++++++++
>> 2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/builtin/commit.c b/builtin/commit.c
>> index e108c53..ee3de12 100644
>> --- a/builtin/commit.c
>> +++ b/builtin/commit.c
>> @@ -252,7 +252,7 @@ static int list_paths(struct string_list *list,
>> const char *with_tree,
>> if (!ce_path_match(ce, pattern, m))
>> continue;
>> item = string_list_insert(list, ce->name);
>> - if (ce_skip_worktree(ce))
>> + if (ce->ce_flags & (CE_VALID | CE_SKIP_WORKTREE))
>> item->util = item; /* better a valid pointer than a fake one */
>> }
>>
>> diff --git a/t/t2106-update-index-assume-unchanged.sh
>> b/t/t2106-update-index-assume-unchanged.sh
>> index 99d858c..dc332f5 100755
>> --- a/t/t2106-update-index-assume-unchanged.sh
>> +++ b/t/t2106-update-index-assume-unchanged.sh
>> @@ -21,4 +21,14 @@ test_expect_success 'do not switch branches with
>> dirty file' \
>> git update-index --assume-unchanged file &&
>> test_must_fail git checkout master'
>>
>> +test_expect_success 'commit <paths> ignore assume-unchanged files' '
>> + : >anotherfile &&
>> + git add anotherfile &&
>> + echo dirty >anotherfile &&
>> + git commit -m one -- file anotherfile &&
>> + git diff --name-only HEAD^ HEAD >actual &&
>> + echo anotherfile >expected &&
>> + test_cmp expected actual
>> +'
>> +
>> test_done
>
>
> works great many thanks,
>
Junio: Given that this patch avoids the user surprise that the `commit
.` and `commit -a` produced unexpectedly different effects, should it
also be included in the --assume unchanged patches? Or is the test
inappropriate?
I'm guessing that there will still be other potential 'gotcha' code
paths that would still produce surprise though.
Philip
prev parent reply other threads:[~2014-12-11 23:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 22:42 GIT: ignoring changes in tracked files and bug report Sérgio Basto
2014-12-05 6:12 ` bug report on update-index --assume-unchanged Sérgio Basto
2014-12-05 6:55 ` Johannes Sixt
2014-12-05 10:52 ` Duy Nguyen
2014-12-05 16:57 ` Sérgio Basto
2014-12-05 18:30 ` Junio C Hamano
2014-12-05 20:48 ` Philip Oakley
2014-12-05 21:05 ` Junio C Hamano
2014-12-05 21:55 ` Philip Oakley
2014-12-05 22:18 ` Andreas Schwab
2014-12-06 0:45 ` Sérgio Basto
2014-12-06 13:28 ` Philip Oakley
2014-12-05 21:19 ` Junio C Hamano
2014-12-05 21:39 ` Sérgio Basto
2014-12-05 21:52 ` Junio C Hamano
2014-12-05 18:33 ` Junio C Hamano
2014-12-05 10:56 ` [PATCH] commit: ignore assume-unchanged files in "commmit <file>" mode Nguyễn Thái Ngọc Duy
2014-12-09 2:44 ` Sérgio Basto
2014-12-11 23:23 ` Philip Oakley [this message]
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=35EB570A2A994662AA2E89910ECE9668@PhilipOakley \
--to=philipoakley@iee.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=sergio@serjux.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