From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 0/3] i-t-a entries in git-status, and git-commit
Date: Wed, 28 Sep 2016 18:43:45 +0700 [thread overview]
Message-ID: <20160928114348.1470-1-pclouds@gmail.com> (raw)
Let's see if I can get the first commit graduated before it turns two
years old. Six months to go! This series is about some oddities of
intent-to-add entries (aka "git add -N"):
1) An ita entry in git-status shows that it's added in the index
(compared to worktree) as a file change, not new file addition. And
it shows the entry added to HEAD as an empty version. This is due
to an implementation detail that i-t-a entries are registered in
the index as empty blobs with a special flag.
2) When you do a "git commit" with no changes whatsoever, but you
happen to have some ita entries registered, git-commit does not
recognize the resulting commit would be empty and should be caught,
unless --allow-empty is given. This has been reported several times.
3) Same symptom as 2) but with initial commit (diff code is not used
for detecting empty commits this time). If you only have ita
entries in the index by the time you make an initial commit, you'll
create an empty commit even if --allow-empty is not specified.
1) and 2) are fixed by changing the position of ita entries in diff
code. ita entries should be seen as a new file when compared between
worktree and HEAD, and no change when compared between index and HEAD.
Some previous commit made this move globally and was reverted because
it could have dangerous unseen side effects, especially in merge code.
Now we are moving slowly towards that (first patch), this time we try
to handle case by case (e.g. index_differs_from in the second patch).
3) could be handled pretty easily once you know the problem. This is
the third patch.
Nguyễn Thái Ngọc Duy (3):
Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"
diff-lib.c: enable --shift-ita in index_differs_from()
commit: don't be fooled by ita entries when creating initial commit
Documentation/diff-options.txt | 7 +++++++
builtin/commit.c | 11 ++++++++---
cache.h | 1 +
diff-lib.c | 13 +++++++++++++
diff.c | 2 ++
diff.h | 1 +
read-cache.c | 10 ++++++++++
sequencer.c | 5 +++--
t/t2203-add-intent.sh | 41 +++++++++++++++++++++++++++++++++++++++--
t/t7064-wtstatus-pv2.sh | 4 ++--
wt-status.c | 7 ++++++-
11 files changed, 92 insertions(+), 10 deletions(-)
--
2.8.2.524.g6ff3d78
next reply other threads:[~2016-09-28 11:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 11:43 Nguyễn Thái Ngọc Duy [this message]
2016-09-28 11:43 ` [PATCH 1/3] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff" Nguyễn Thái Ngọc Duy
2016-09-28 19:28 ` Junio C Hamano
2016-09-28 20:33 ` Junio C Hamano
2016-10-03 10:36 ` Duy Nguyen
2016-10-04 16:15 ` Junio C Hamano
2016-10-05 9:43 ` Duy Nguyen
2016-10-06 19:15 ` Junio C Hamano
2016-10-07 12:56 ` Duy Nguyen
2016-10-10 23:08 ` Junio C Hamano
2016-09-28 11:43 ` [PATCH 2/3] diff-lib.c: enable --shift-ita in index_differs_from() Nguyễn Thái Ngọc Duy
2016-09-28 18:49 ` Junio C Hamano
2016-09-28 11:43 ` [PATCH 3/3] commit: don't be fooled by ita entries when creating initial commit Nguyễn Thái Ngọc Duy
2016-09-28 11:51 ` [PATCH 0/3] i-t-a entries in git-status, and git-commit Duy Nguyen
2016-10-24 10:42 ` [PATCH 0/4] nd/ita-empty-commit update Nguyễn Thái Ngọc Duy
2016-10-24 10:42 ` [PATCH 1/4] diff-lib: allow ita entries treated as "not yet exist in index" Nguyễn Thái Ngọc Duy
2016-10-24 10:42 ` [PATCH 2/4] diff: add --ita-[in]visible-in-index Nguyễn Thái Ngọc Duy
2016-10-24 10:42 ` [PATCH 3/4] commit: fix empty commit creation when there's no changes but ita entries Nguyễn Thái Ngọc Duy
2016-10-24 10:42 ` [PATCH 4/4] commit: don't be fooled by ita entries when creating initial commit Nguyễn Thái Ngọc Duy
2016-10-24 17:58 ` [PATCH 0/4] nd/ita-empty-commit update Junio C Hamano
2016-10-25 9:34 ` Duy Nguyen
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=20160928114348.1470-1-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.