{"thread":{"id":"41079","subject":"[PATCH 0/6] nd/ita-cleanup updates","startedAt":"2015-12-27T01:51:26Z","lastAt":"2015-12-29T17:40:53Z","messageCount":15,"participants":["Nguyễn Thái Ngọc Duy","Junio C Hamano","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"275008","messageId":"1451181092-26054-1-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":null,"subject":"[PATCH 0/6] nd/ita-cleanup updates","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:26Z","receivedAt":"2015-12-27T01:51:26Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Most of the updates are in commit message (see the old thread [1]). I\ngive up on adding new tests for git-apply, finally admitting I don't\nknow that command that well. Code change from 'pu' version is entirely\nin 5/6:\n\ndiff --git a/builtin/checkout-index.c b/builtin/checkout-index.c\nindex 687c82e..d9fe8f4 100644\n--- a/builtin/checkout-index.c\n+++ b/builtin/checkout-index.c\n@@ -48,6 +48,7 @@ static int checkout_file(const char *name, const char *prefix)\n \tint pos = cache_name_pos(name, namelen);\n \tint has_same_name = 0;\n \tint did_checkout = 0;\n+\tint has_intent_to_add = 0;\n \tint errs = 0;\n \n \tif (pos < 0)\n@@ -56,9 +57,11 @@ static int checkout_file(const char *name, const char *prefix)\n \twhile (pos < active_nr) {\n \t\tstruct cache_entry *ce = active_cache[pos];\n \t\tif (ce_namelen(ce) != namelen ||\n-\t\t    memcmp(ce->name, name, namelen) ||\n-\t\t    ce_intent_to_add(ce))\n+\t\t    memcmp(ce->name, name, namelen)) {\n+\t\t\tif (ce_intent_to_add(ce))\n+\t\t\t\thas_intent_to_add = 1;\n \t\t\tbreak;\n+\t\t}\n \t\thas_same_name = 1;\n \t\tpos++;\n \t\tif (ce_stage(ce) != checkout_stage\n@@ -78,7 +81,9 @@ static int checkout_file(const char *name, const char *prefix)\n \n \tif (!state.quiet) {\n \t\tfprintf(stderr, \"git checkout-index: %s \", name);\n-\t\tif (!has_same_name)\n+\t\tif (has_intent_to_add)\n+\t\t\tfprintf(stderr, \"is not yet in the cache\");\n+\t\telse if (!has_same_name)\n \t\t\tfprintf(stderr, \"is not in the cache\");\n \t\telse if (checkout_stage)\n \t\t\tfprintf(stderr, \"does not exist at stage %d\",\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 6d198b3..ac37d92 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -300,8 +300,6 @@ static int checkout_paths(const struct checkout_opts *opts,\n \t\t\t * anything to this entry at all.\n \t\t\t */\n \t\t\tcontinue;\n-\t\tif (ce_intent_to_add(ce))\n-\t\t\tcontinue;\n \t\t/*\n \t\t * Either this entry came from the tree-ish we are\n \t\t * checking the paths out of, or we are checking out\n@@ -330,12 +328,15 @@ static int checkout_paths(const struct checkout_opts *opts,\n \tif (opts->merge)\n \t\tunmerge_marked_index(&the_index);\n \n-\t/* Any unmerged paths? */\n \tfor (pos = 0; pos < active_nr; pos++) {\n-\t\tconst struct cache_entry *ce = active_cache[pos];\n+\t\tstruct cache_entry *ce = active_cache[pos];\n \t\tif (ce->ce_flags & CE_MATCHED) {\n-\t\t\tif (!ce_stage(ce))\n+\t\t\tif (!ce_stage(ce)) {\n+\t\t\t\tif (ce_intent_to_add(ce))\n+\t\t\t\t\tce->ce_flags &= ~CE_MATCHED;\n \t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t/* Unmerged paths */\n \t\t\tif (opts->force) {\n \t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t} else if (opts->writeout_stage) {\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex d0f36a4..52e9f7f 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -117,7 +117,7 @@ test_expect_success 'checkout ignores i-t-a' '\n \t\tcd checkout &&\n \t\techo data >file &&\n \t\tgit add -N file &&\n-\t\ttest_must_fail git checkout -- file &&\n+\t\tgit checkout -- file &&\n \t\techo data >expected &&\n \t\ttest_cmp expected file\n \t)\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/272363/focus=276352\n\nNguyễn Thái Ngọc Duy (6):\n  blame: remove obsolete comment\n  Add and use convenient macro ce_intent_to_add()\n  apply: fix adding new files on i-t-a entries\n  apply: make sure check_preimage() does not leave empty file on error\n  checkout(-index): do not checkout i-t-a entries\n  grep: make it clear i-t-a entries are ignored\n\n builtin/apply.c          | 13 +++++-----\n builtin/blame.c          |  5 ----\n builtin/checkout-index.c | 12 +++++++--\n builtin/checkout.c       |  9 ++++---\n builtin/grep.c           |  2 +-\n builtin/rm.c             |  2 +-\n cache-tree.c             |  2 +-\n cache.h                  |  1 +\n read-cache.c             |  4 +--\n t/t2203-add-intent.sh    | 63 ++++++++++++++++++++++++++++++++++++++++++++++++\n 10 files changed, 92 insertions(+), 21 deletions(-)\n\n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275012","messageId":"1451181092-26054-2-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 1/6] blame: remove obsolete comment","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:27Z","receivedAt":"2015-12-27T01:51:27Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"That \"someday\" in the comment happened two years later in\nb65982b (Optimize \"diff-index --cached\" using cache-tree - 2009-05-20)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/blame.c | 5 -----\n 1 file changed, 5 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 06484c2..9a0df92 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -2379,11 +2379,6 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,\n \tce->ce_mode = create_ce_mode(mode);\n \tadd_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);\n \n-\t/*\n-\t * We are not going to write this out, so this does not matter\n-\t * right now, but someday we might optimize diff-index --cached\n-\t * with cache-tree information.\n-\t */\n \tcache_tree_invalidate_path(&the_index, path);\n \n \treturn commit;\n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275014","messageId":"1451181092-26054-3-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 2/6] Add and use convenient macro ce_intent_to_add()","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:28Z","receivedAt":"2015-12-27T01:51:28Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/rm.c | 2 +-\n cache-tree.c | 2 +-\n cache.h      | 1 +\n read-cache.c | 4 ++--\n 4 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 3304bff..74a7a43 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -212,7 +212,7 @@ static int check_local_mod(unsigned char *head, int index_only)\n \t\t * \"intent to add\" entry.\n \t\t */\n \t\tif (local_changes && staged_changes) {\n-\t\t\tif (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))\n+\t\t\tif (!index_only || !ce_intent_to_add(ce))\n \t\t\t\tstring_list_append(&files_staged, name);\n \t\t}\n \t\telse if (!index_only) {\ndiff --git a/cache-tree.c b/cache-tree.c\nindex 32772b9..e590346 100644\n--- a/cache-tree.c\n+++ b/cache-tree.c\n@@ -377,7 +377,7 @@ static int update_one(struct cache_tree *it,\n \t\t * they are not part of generated trees. Invalidate up\n \t\t * to root to force cache-tree users to read elsewhere.\n \t\t */\n-\t\tif (ce->ce_flags & CE_INTENT_TO_ADD) {\n+\t\tif (ce_intent_to_add(ce)) {\n \t\t\tto_invalidate = 1;\n \t\t\tcontinue;\n \t\t}\ndiff --git a/cache.h b/cache.h\nindex 3d3244b..b1f0531 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -233,6 +233,7 @@ static inline unsigned create_ce_flags(unsigned stage)\n #define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE)\n #define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE)\n #define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)\n+#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)\n \n #define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)\n static inline unsigned int create_ce_mode(unsigned int mode)\ndiff --git a/read-cache.c b/read-cache.c\nindex 36ff89f..fb80c47 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -311,7 +311,7 @@ int ie_match_stat(const struct index_state *istate,\n \t * by definition never matches what is in the work tree until it\n \t * actually gets added.\n \t */\n-\tif (ce->ce_flags & CE_INTENT_TO_ADD)\n+\tif (ce_intent_to_add(ce))\n \t\treturn DATA_CHANGED | TYPE_CHANGED | MODE_CHANGED;\n \n \tchanged = ce_match_stat_basic(ce, st);\n@@ -1231,7 +1231,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,\n \n \t\t\tif (cache_errno == ENOENT)\n \t\t\t\tfmt = deleted_fmt;\n-\t\t\telse if (ce->ce_flags & CE_INTENT_TO_ADD)\n+\t\t\telse if (ce_intent_to_add(ce))\n \t\t\t\tfmt = added_fmt; /* must be before other checks */\n \t\t\telse if (changed & TYPE_CHANGED)\n \t\t\t\tfmt = typechange_fmt;\n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275013","messageId":"1451181092-26054-4-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 3/6] apply: fix adding new files on i-t-a entries","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:29Z","receivedAt":"2015-12-27T01:51:29Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Suppose that you came up with some contents to register at path F in\nyour working tree, told Git about your intention with \"add -N F\", and\nthen tried to apply a patch that wants to _create_ F:\n\nWithout this patch, we would say \"F already exists so a patch to\ncreate is incompatible with our current state\".\n\nWith this patch, i-t-a entries are ignored and we do not say that, but\ninstead we'll hopefully trigger \"does it exist in the working tree\"\ncheck, unless you are running under \"--cached\".\n\nWhich means that this change will not lead to data loss in the\n\"untracked\" file F in the working tree that was merely added to the\nindex with i-t-a bit.\n\n(commit message mostly from Junio)\n\nReported-by: Patrick Higgins <phiggins@google.com>\nReported-by: Bjørnar Snoksrud <snoksrud@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/apply.c       |  9 +++++----\n t/t2203-add-intent.sh | 13 +++++++++++++\n 2 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex 0769b09..315fce8 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3550,10 +3550,11 @@ static int check_to_create(const char *new_name, int ok_if_exists)\n {\n \tstruct stat nst;\n \n-\tif (check_index &&\n-\t    cache_name_pos(new_name, strlen(new_name)) >= 0 &&\n-\t    !ok_if_exists)\n-\t\treturn EXISTS_IN_INDEX;\n+\tif (check_index && !ok_if_exists) {\n+\t\tint pos = cache_name_pos(new_name, strlen(new_name));\n+\t\tif (pos >= 0 && !ce_intent_to_add(active_cache[pos]))\n+\t\t\treturn EXISTS_IN_INDEX;\n+\t}\n \tif (cached)\n \t\treturn 0;\n \ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex 2a4a749..bb5ef2b 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -82,5 +82,18 @@ test_expect_success 'cache-tree invalidates i-t-a paths' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'apply adds new file on i-t-a entry' '\n+\tgit init apply &&\n+\t(\n+\t\tcd apply &&\n+\t\techo newcontent >newfile &&\n+\t\tgit add newfile &&\n+\t\tgit diff --cached >patch &&\n+\t\trm .git/index &&\n+\t\tgit add -N newfile &&\n+\t\tgit apply --cached patch\n+\t)\n+'\n+\n test_done\n \n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275011","messageId":"1451181092-26054-5-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 4/6] apply: make sure check_preimage() does not leave empty file on error","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:30Z","receivedAt":"2015-12-27T01:51:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The test case probably describes the test scenario the best. We have a\npatch to modify some file but the base file is gone. Because\ncheck_preimage() finds an index entry with the same old_name, it tries\nto restore the on-disk base file with cached content with\ncheckout_target() and move on.\n\nIf this old_name is i-t-a, before this patch \"apply -3\" will call\ncheckout_target() which will write an empty file (i-t-a entries always\nhave \"empty blob\" SHA-1), then it'll fail at verify_index_match()\n(i-t-a entries are always \"modified\") and the operation is aborted.\n\nThis empty file should not be created. Compare to the case where\nold_name does not exist in index, \"apply -3\" fails with a different\nerror message \"...: does not exist\" but it does not touch\nworktree. This patch makes sure the same happens to i-t-a entries.\n\nload_current() shares the same code pattern (look up an index entry,\nif on-disk version is not found, restore using the cached\nversion). Fix it too (even though it's not exercised in any test case)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/apply.c       |  4 ++--\n t/t2203-add-intent.sh | 16 ++++++++++++++++\n 2 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex 315fce8..11f04fd 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3345,7 +3345,7 @@ static int load_current(struct image *image, struct patch *patch)\n \t\tdie(\"BUG: patch to %s is not a creation\", patch->old_name);\n \n \tpos = cache_name_pos(name, strlen(name));\n-\tif (pos < 0)\n+\tif (pos < 0 || ce_intent_to_add(active_cache[pos]))\n \t\treturn error(_(\"%s: does not exist in index\"), name);\n \tce = active_cache[pos];\n \tif (lstat(name, &st)) {\n@@ -3498,7 +3498,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s\n \n \tif (check_index && !previous) {\n \t\tint pos = cache_name_pos(old_name, strlen(old_name));\n-\t\tif (pos < 0) {\n+\t\tif (pos < 0 || ce_intent_to_add(active_cache[pos])) {\n \t\t\tif (patch->is_new < 0)\n \t\t\t\tgoto is_new;\n \t\t\treturn error(_(\"%s: does not exist in index\"), old_name);\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex bb5ef2b..96c8755 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -95,5 +95,21 @@ test_expect_success 'apply adds new file on i-t-a entry' '\n \t)\n '\n \n+test_expect_success 'apply:check_preimage() not creating empty file' '\n+\tgit init check-preimage &&\n+\t(\n+\t\tcd check-preimage &&\n+\t\techo oldcontent >newfile &&\n+\t\tgit add newfile &&\n+\t\techo newcontent >newfile &&\n+\t\tgit diff >patch &&\n+\t\trm .git/index &&\n+\t\tgit add -N newfile &&\n+\t\trm newfile &&\n+\t\ttest_must_fail git apply -3 patch &&\n+\t\t! test -f newfile\n+\t)\n+'\n+\n test_done\n \n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275010","messageId":"1451181092-26054-6-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 5/6] checkout(-index): do not checkout i-t-a entries","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:31Z","receivedAt":"2015-12-27T01:51:31Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The cached blob of i-t-a entries are empty blob. By checkout, we delete\nthe content we have. Don't do it.\n\nThis is done higher up instead of inside checkout_entry() because we\nwould have limited options in there: silently ignore, loudly ignore,\ndie. At higher level we can do better reporting. For example, \"git\ncheckout -- foo\" will complain that \"foo\" does not match pathspec, just\nlike when \"foo\" is not registered with \"git add -N\"\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/checkout-index.c | 12 ++++++++++--\n builtin/checkout.c       |  9 ++++++---\n t/t2203-add-intent.sh    | 34 ++++++++++++++++++++++++++++++++++\n 3 files changed, 50 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/checkout-index.c b/builtin/checkout-index.c\nindex 9ca2da1..d9fe8f4 100644\n--- a/builtin/checkout-index.c\n+++ b/builtin/checkout-index.c\n@@ -48,6 +48,7 @@ static int checkout_file(const char *name, const char *prefix)\n \tint pos = cache_name_pos(name, namelen);\n \tint has_same_name = 0;\n \tint did_checkout = 0;\n+\tint has_intent_to_add = 0;\n \tint errs = 0;\n \n \tif (pos < 0)\n@@ -56,8 +57,11 @@ static int checkout_file(const char *name, const char *prefix)\n \twhile (pos < active_nr) {\n \t\tstruct cache_entry *ce = active_cache[pos];\n \t\tif (ce_namelen(ce) != namelen ||\n-\t\t    memcmp(ce->name, name, namelen))\n+\t\t    memcmp(ce->name, name, namelen)) {\n+\t\t\tif (ce_intent_to_add(ce))\n+\t\t\t\thas_intent_to_add = 1;\n \t\t\tbreak;\n+\t\t}\n \t\thas_same_name = 1;\n \t\tpos++;\n \t\tif (ce_stage(ce) != checkout_stage\n@@ -77,7 +81,9 @@ static int checkout_file(const char *name, const char *prefix)\n \n \tif (!state.quiet) {\n \t\tfprintf(stderr, \"git checkout-index: %s \", name);\n-\t\tif (!has_same_name)\n+\t\tif (has_intent_to_add)\n+\t\t\tfprintf(stderr, \"is not yet in the cache\");\n+\t\telse if (!has_same_name)\n \t\t\tfprintf(stderr, \"is not in the cache\");\n \t\telse if (checkout_stage)\n \t\t\tfprintf(stderr, \"does not exist at stage %d\",\n@@ -99,6 +105,8 @@ static void checkout_all(const char *prefix, int prefix_length)\n \t\tif (ce_stage(ce) != checkout_stage\n \t\t    && (CHECKOUT_ALL != checkout_stage || !ce_stage(ce)))\n \t\t\tcontinue;\n+\t\tif (ce_intent_to_add(ce))\n+\t\t\tcontinue;\n \t\tif (prefix && *prefix &&\n \t\t    (ce_namelen(ce) <= prefix_length ||\n \t\t     memcmp(prefix, ce->name, prefix_length)))\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3e141fc..ac37d92 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -328,12 +328,15 @@ static int checkout_paths(const struct checkout_opts *opts,\n \tif (opts->merge)\n \t\tunmerge_marked_index(&the_index);\n \n-\t/* Any unmerged paths? */\n \tfor (pos = 0; pos < active_nr; pos++) {\n-\t\tconst struct cache_entry *ce = active_cache[pos];\n+\t\tstruct cache_entry *ce = active_cache[pos];\n \t\tif (ce->ce_flags & CE_MATCHED) {\n-\t\t\tif (!ce_stage(ce))\n+\t\t\tif (!ce_stage(ce)) {\n+\t\t\t\tif (ce_intent_to_add(ce))\n+\t\t\t\t\tce->ce_flags &= ~CE_MATCHED;\n \t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t/* Unmerged paths */\n \t\t\tif (opts->force) {\n \t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n \t\t\t} else if (opts->writeout_stage) {\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex 96c8755..52e9f7f 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -111,5 +111,39 @@ test_expect_success 'apply:check_preimage() not creating empty file' '\n \t)\n '\n \n+test_expect_success 'checkout ignores i-t-a' '\n+\tgit init checkout &&\n+\t(\n+\t\tcd checkout &&\n+\t\techo data >file &&\n+\t\tgit add -N file &&\n+\t\tgit checkout -- file &&\n+\t\techo data >expected &&\n+\t\ttest_cmp expected file\n+\t)\n+'\n+\n+test_expect_success 'checkout-index ignores i-t-a' '\n+\t(\n+\t\tcd checkout &&\n+\t\tgit checkout-index file &&\n+\t\techo data >expected &&\n+\t\ttest_cmp expected file\n+\t)\n+'\n+\n+test_expect_success 'checkout-index --all ignores i-t-a' '\n+\t(\n+\t\tcd checkout &&\n+\t\techo data >anotherfile &&\n+\t\tgit add anotherfile &&\n+\t\trm anotherfile &&\n+\t\tgit checkout-index --all &&\n+\t\techo data >expected &&\n+\t\ttest_cmp expected file &&\n+\t\ttest_cmp expected anotherfile\n+\t)\n+'\n+\n test_done\n \n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275009","messageId":"1451181092-26054-7-git-send-email-pclouds@gmail.com","threadId":"41079","inReplyTo":"1451181092-26054-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 6/6] grep: make it clear i-t-a entries are ignored","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-27T01:51:32Z","receivedAt":"2015-12-27T01:51:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The expression \"!S_ISREG(ce)\" covers i-t-a entries as well because\nce->ce_mode would be zero then. I could make a comment saying that, but\nit's probably better just to comment with code, in case i-t-a entry\ncontent changes in future.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/grep.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex d04f440..f508179 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -375,7 +375,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int\n \n \tfor (nr = 0; nr < active_nr; nr++) {\n \t\tconst struct cache_entry *ce = active_cache[nr];\n-\t\tif (!S_ISREG(ce->ce_mode))\n+\t\tif (!S_ISREG(ce->ce_mode) || ce_intent_to_add(ce))\n \t\t\tcontinue;\n \t\tif (!ce_path_match(ce, pathspec, NULL))\n \t\t\tcontinue;\n-- \n2.3.0.rc1.137.g477eb31\n"},{"id":"275034","messageId":"xmqqpoxr9szy.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-4-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 3/6] apply: fix adding new files on i-t-a entries","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T03:01:05Z","receivedAt":"2015-12-28T03:01:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> Suppose that you came up with some contents to register at path F in\n> your working tree, told Git about your intention with \"add -N F\", and\n> then tried to apply a patch that wants to _create_ F:\n>\n> Without this patch, we would say \"F already exists so a patch to\n> create is incompatible with our current state\".\n>\n> With this patch, i-t-a entries are ignored and we do not say that, but\n> instead we'll hopefully trigger \"does it exist in the working tree\"\n> check, unless you are running under \"--cached\".\n>\n> Which means that this change will not lead to data loss in the\n> \"untracked\" file F in the working tree that was merely added to the\n> index with i-t-a bit.\n>\n> (commit message mostly from Junio)\n\nHmm, I do not quite recall.  The above looks under-explained anyway;\nwe should stress the fact that it is a designed behaviour of this\nchange to allow only \"apply --cached\" and continue rejecting other\nforms of \"apply\", but the above makes it sound like it is merely a\ncoincidence.\n\nIt might make sense, from purely mechanistic point of view, to allow\n\"git apply --cached\" to create in the above scenario, but it does\nnot make any sense to allow \"git apply\" or \"git apply --index\", both\nof which modifies the working tree (and I do not think the patch\nallows the former; I think the latter would fail correctly, but it\nmay leave the index in a weird state--I didn't check).\n\n\"git add -N F\" is like saying \"I am telling you that F _exists_; I\nam just not telling you what its exact contents are yet\".  It's like\nreserving a table in a restaurant.  The diner might not have arrived\nyet, but that does not mean you can give the table to somebody else.\n\nYou need to wait for the reservation to be canceled (which you would\ndo by \"git rm --cached F\") before you give the table to somebody\nelse (i.e. creation by the patch).\n\nSo from that point of view, I am not convinced \"git apply --cached\"\nshould be allowed in such a case, though.\n\n\"I thought I told you to that I'll add to this path, but you chose\nnot to notice that the patch I tried to apply would create the path\nwith totally different contents and now I am getting from 'git diff'\nnonsensical comparison\" would be a plausible complaint if we took\nthis patch.  What is the practical benefit of automatically and\nsilently canceling the reservation made by an earlier \"add -N\"?\nWhat workflow benefits from this change, and is this the best\nsolution to help that workflow?\n\n\n> Reported-by: Patrick Higgins <phiggins@google.com>\n> Reported-by: Bjørnar Snoksrud <snoksrud@gmail.com>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  builtin/apply.c       |  9 +++++----\n>  t/t2203-add-intent.sh | 13 +++++++++++++\n>  2 files changed, 18 insertions(+), 4 deletions(-)\n>\n> diff --git a/builtin/apply.c b/builtin/apply.c\n> index 0769b09..315fce8 100644\n> --- a/builtin/apply.c\n> +++ b/builtin/apply.c\n> @@ -3550,10 +3550,11 @@ static int check_to_create(const char *new_name, int ok_if_exists)\n>  {\n>  \tstruct stat nst;\n>  \n> -\tif (check_index &&\n> -\t    cache_name_pos(new_name, strlen(new_name)) >= 0 &&\n> -\t    !ok_if_exists)\n> -\t\treturn EXISTS_IN_INDEX;\n> +\tif (check_index && !ok_if_exists) {\n> +\t\tint pos = cache_name_pos(new_name, strlen(new_name));\n> +\t\tif (pos >= 0 && !ce_intent_to_add(active_cache[pos]))\n> +\t\t\treturn EXISTS_IN_INDEX;\n> +\t}\n>  \tif (cached)\n>  \t\treturn 0;\n>  \n> diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\n> index 2a4a749..bb5ef2b 100755\n> --- a/t/t2203-add-intent.sh\n> +++ b/t/t2203-add-intent.sh\n> @@ -82,5 +82,18 @@ test_expect_success 'cache-tree invalidates i-t-a paths' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> +test_expect_success 'apply adds new file on i-t-a entry' '\n> +\tgit init apply &&\n> +\t(\n> +\t\tcd apply &&\n> +\t\techo newcontent >newfile &&\n> +\t\tgit add newfile &&\n> +\t\tgit diff --cached >patch &&\n> +\t\trm .git/index &&\n> +\t\tgit add -N newfile &&\n> +\t\tgit apply --cached patch\n> +\t)\n> +'\n> +\n>  test_done\n"},{"id":"275046","messageId":"xmqqmvsulbly.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-2-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 1/6] blame: remove obsolete comment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T17:35:53Z","receivedAt":"2015-12-28T17:35:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> That \"someday\" in the comment happened two years later in\n> b65982b (Optimize \"diff-index --cached\" using cache-tree - 2009-05-20)\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n\nThanks.\n\n>  builtin/blame.c | 5 -----\n>  1 file changed, 5 deletions(-)\n>\n> diff --git a/builtin/blame.c b/builtin/blame.c\n> index 06484c2..9a0df92 100644\n> --- a/builtin/blame.c\n> +++ b/builtin/blame.c\n> @@ -2379,11 +2379,6 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,\n>  \tce->ce_mode = create_ce_mode(mode);\n>  \tadd_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);\n>  \n> -\t/*\n> -\t * We are not going to write this out, so this does not matter\n> -\t * right now, but someday we might optimize diff-index --cached\n> -\t * with cache-tree information.\n> -\t */\n>  \tcache_tree_invalidate_path(&the_index, path);\n>  \n>  \treturn commit;\n"},{"id":"275047","messageId":"xmqqio3ilatf.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-3-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 2/6] Add and use convenient macro ce_intent_to_add()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T17:53:00Z","receivedAt":"2015-12-28T17:53:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looks good; thanks.\n"},{"id":"275049","messageId":"xmqqbn9al8v9.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-5-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 4/6] apply: make sure check_preimage() does not leave empty file on error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T18:35:06Z","receivedAt":"2015-12-28T18:35:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\n> index bb5ef2b..96c8755 100755\n> --- a/t/t2203-add-intent.sh\n> +++ b/t/t2203-add-intent.sh\n> @@ -95,5 +95,21 @@ test_expect_success 'apply adds new file on i-t-a entry' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'apply:check_preimage() not creating empty file' '\n> +\tgit init check-preimage &&\n> +\t(\n> +\t\tcd check-preimage &&\n> +\t\techo oldcontent >newfile &&\n> +\t\tgit add newfile &&\n> +\t\techo newcontent >newfile &&\n> +\t\tgit diff >patch &&\n> +\t\trm .git/index &&\n> +\t\tgit add -N newfile &&\n> +\t\trm newfile &&\n> +\t\ttest_must_fail git apply -3 patch &&\n> +\t\t! test -f newfile\n> +\t)\n> +'\n\nUnlike \"apply --index\" (and \"apply\" without any option to work on\nworking tree), \"apply -3\" is allowed to write to the working tree\neven when it fails, if the failure comes from a merge conflict and\nthat is by design.  In this case, the patch expects that there is an\nexisting file with 'oldcontent' so it should try to do a three-way\nmerge to go from an 'unspecified' content (i.e. the current state in\nthe index) in a way similar to going from 'oldcontent' to\n'newcontent', and because we _have_ to make sure that the path that\nholds the 'unspecified' content is clean between the index and the\nworking tree--but an earlier \"add -N\" said that \"the index knows\nabout the path, I am not telling what its contents are yet\", by\ndefinition the index and the working tree cannot match so the\napplication _must_ fail, before even attempting to do a three-way\nmerge, hence it should not touch the working tree.\n\nSo expecting a failure from \"apply -3\" sounds like the right thing\nto do, and obviously it should not leave any \"newfile\".  The test\nalso must check that the index has not been modified since the last\n\"git add -N\" (most notably, we want to see 'newfile' still has the\nI-T-A bit on).\n\nMore interesting cases to test would be:\n\n - Instead of \"rm newfile\", have \">newfile\" to empty the contents\n   before applying the patch with \"apply -3\".  We should expect the\n   same \"apply -3 fails\", but we should see an empty 'newfile' in\n   the working tree.  The index must be the same as the last \"git\n   add -N\".\n\n - Instead of \"rm newfile\", have \"echo oldcontent >newfile\".  What\n   should \"apply -3\" do?  The patch would be applicable with \"apply\"\n   without any argument (hence without involving the index), but\n   \"-3\" requires 'check_index', and again any entry with I-T-A bit\n   on by definition does not match between the index and the working\n   tree, so the application must fail, I think.\n"},{"id":"275052","messageId":"xmqq7fjyl536.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-6-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 5/6] checkout(-index): do not checkout i-t-a entries","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T19:56:45Z","receivedAt":"2015-12-28T19:56:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c\n> index 9ca2da1..d9fe8f4 100644\n> --- a/builtin/checkout-index.c\n> +++ b/builtin/checkout-index.c\n> @@ -48,6 +48,7 @@ static int checkout_file(const char *name, const char *prefix)\n>  \tint pos = cache_name_pos(name, namelen);\n>  \tint has_same_name = 0;\n>  \tint did_checkout = 0;\n> +\tint has_intent_to_add = 0;\n>  \tint errs = 0;\n>  \n>  \tif (pos < 0)\n> @@ -56,8 +57,11 @@ static int checkout_file(const char *name, const char *prefix)\n>  \twhile (pos < active_nr) {\n>  \t\tstruct cache_entry *ce = active_cache[pos];\n>  \t\tif (ce_namelen(ce) != namelen ||\n> -\t\t    memcmp(ce->name, name, namelen))\n> +\t\t    memcmp(ce->name, name, namelen)) {\n> +\t\t\tif (ce_intent_to_add(ce))\n> +\t\t\t\thas_intent_to_add = 1;\n>  \t\t\tbreak;\n> +\t\t}\n>  \t\thas_same_name = 1;\n>  \t\tpos++;\n>  \t\tif (ce_stage(ce) != checkout_stage\n\nSorry, but I cannot see what this hunk is trying to do.\n\nEarlier, 'pos' is set to where the 'name' would be inserted (or\nwould replace, if there is an existing entry with the same name).\nWe iterate over the index starting from that 'pos' until we see a\ndifferent name (i.e. the length is different, or the name does not\nmatch) and then break out, because that entry is not something we\nwant to muck with, because the entry here you are checking with\nce_intent_to_add() is an entry that is entirely unrelated to the\npath you are checking out.\n\nSo you do not check it out, just as before, which is correct, but\nthen this 'has_intent_to_add' flag is used to say something\nnonsensical below ...\n\n> @@ -77,7 +81,9 @@ static int checkout_file(const char *name, const char *prefix)\n>  \n>  \tif (!state.quiet) {\n>  \t\tfprintf(stderr, \"git checkout-index: %s \", name);\n> -\t\tif (!has_same_name)\n> +\t\tif (has_intent_to_add)\n> +\t\t\tfprintf(stderr, \"is not yet in the cache\");\n\n... the reason why you are here does not have anything to do with the\nentry that happened to come after the path you wanted to check out\nwas marked with the I-T-A bit.  The reason why you are here is\nbecause 'did_checkout' was unset, which in turn was because there\nwasn't a path that match 'name' you are checking out in the index,\nwith or without the I-T-A bit.\n\n    $ rm .git/index\n    $ >file\n    $ git add -N file\n    $ git checkout-index fild\n\nwould hit this codepath, I think, and the code would give a message\nthat says \"fild is not yet in the cache\", which may be technically\ncorrect but it is the same as !has_same_name's \"fild is not in the\ncache\".\n\nProbably the I-T-A check must go after the code decides that 'ce' is\nan entry for the 'name' the caller asked us to check out (and of\ncourse we shouldn't check it out in that case).\n\n> @@ -99,6 +105,8 @@ static void checkout_all(const char *prefix, int prefix_length)\n>  \t\tif (ce_stage(ce) != checkout_stage\n>  \t\t    && (CHECKOUT_ALL != checkout_stage || !ce_stage(ce)))\n>  \t\t\tcontinue;\n> +\t\tif (ce_intent_to_add(ce))\n> +\t\t\tcontinue;\n\nThis one is probably correct, I didn't check the context to fully\nsee if it is valid, though.\n\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index 3e141fc..ac37d92 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -328,12 +328,15 @@ static int checkout_paths(const struct checkout_opts *opts,\n>  \tif (opts->merge)\n>  \t\tunmerge_marked_index(&the_index);\n>  \n> -\t/* Any unmerged paths? */\n>  \tfor (pos = 0; pos < active_nr; pos++) {\n> -\t\tconst struct cache_entry *ce = active_cache[pos];\n> +\t\tstruct cache_entry *ce = active_cache[pos];\n>  \t\tif (ce->ce_flags & CE_MATCHED) {\n> -\t\t\tif (!ce_stage(ce))\n> +\t\t\tif (!ce_stage(ce)) {\n> +\t\t\t\tif (ce_intent_to_add(ce))\n> +\t\t\t\t\tce->ce_flags &= ~CE_MATCHED;\n>  \t\t\t\tcontinue;\n> +\t\t\t}\n> +\t\t\t/* Unmerged paths */\n>  \t\t\tif (opts->force) {\n>  \t\t\t\twarning(_(\"path '%s' is unmerged\"), ce->name);\n>  \t\t\t} else if (opts->writeout_stage) {\n\nThis loop has become dual-purpose; it is drops CE_MATCHED bit from\ncache entries with the I-T-A bit, and it continues to handle errors\nfor an attempt to checkout unmerged paths.\n\n    $ rm .git/index\n    $ >file\n    $ git add -N file\n    $ git checkout file\n\nwould hit this codepath, and it will force-skip \"file\".\n\nThere is a small source of confusion for new people here, though.\n\n    $ git checkout filo\n\nwould complain that there is no 'filo'.  But\n\n    $ git checkout file\n\nwould silently turn itself into a no-op.  Don't we want to at least\ngive some indication that we are not checking out \"file\" because its\ncontents do not yet exist in the index, or something?\n\n> diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\n> index 96c8755..52e9f7f 100755\n> --- a/t/t2203-add-intent.sh\n> +++ b/t/t2203-add-intent.sh\n> @@ -111,5 +111,39 @@ test_expect_success 'apply:check_preimage() not creating empty file' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'checkout ignores i-t-a' '\n> +\tgit init checkout &&\n> +\t(\n> +\t\tcd checkout &&\n> +\t\techo data >file &&\n> +\t\tgit add -N file &&\n> +\t\tgit checkout -- file &&\n> +\t\techo data >expected &&\n> +\t\ttest_cmp expected file\n> +\t)\n> +'\n> +\n> +test_expect_success 'checkout-index ignores i-t-a' '\n> +\t(\n> +\t\tcd checkout &&\n> +\t\tgit checkout-index file &&\n> +\t\techo data >expected &&\n> +\t\ttest_cmp expected file\n> +\t)\n> +'\n> +\n> +test_expect_success 'checkout-index --all ignores i-t-a' '\n> +\t(\n> +\t\tcd checkout &&\n> +\t\techo data >anotherfile &&\n> +\t\tgit add anotherfile &&\n> +\t\trm anotherfile &&\n> +\t\tgit checkout-index --all &&\n> +\t\techo data >expected &&\n> +\t\ttest_cmp expected file &&\n> +\t\ttest_cmp expected anotherfile\n> +\t)\n> +'\n> +\n>  test_done\n"},{"id":"275053","messageId":"xmqq37uml4z3.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"1451181092-26054-7-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 6/6] grep: make it clear i-t-a entries are ignored","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-28T19:59:12Z","receivedAt":"2015-12-28T19:59:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This one looks correct.\n\nI'll pick the obviously correct pieces (1, 2, and 6) from this\nseries, as they are pretty-much independent, and discard the rest\nfor now.\n\nThanks.\n"},{"id":"275134","messageId":"CACsJy8Ad5uihFqVBR4rLA4at_fBDx-yRx1VP1d-uR+4Uug6M9g@mail.gmail.com","threadId":"41079","inReplyTo":"xmqqpoxr9szy.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 3/6] apply: fix adding new files on i-t-a entries","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-29T14:02:54Z","receivedAt":"2015-12-29T14:02:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Dec 28, 2015 at 10:01 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>\n>> Suppose that you came up with some contents to register at path F in\n>> your working tree, told Git about your intention with \"add -N F\", and\n>> then tried to apply a patch that wants to _create_ F:\n>>\n>> Without this patch, we would say \"F already exists so a patch to\n>> create is incompatible with our current state\".\n>>\n>> With this patch, i-t-a entries are ignored and we do not say that, but\n>> instead we'll hopefully trigger \"does it exist in the working tree\"\n>> check, unless you are running under \"--cached\".\n>>\n>> Which means that this change will not lead to data loss in the\n>> \"untracked\" file F in the working tree that was merely added to the\n>> index with i-t-a bit.\n>>\n>> (commit message mostly from Junio)\n>\n> Hmm, I do not quite recall.\n\nFor reference ;)\n\nhttps://www.mail-archive.com/git@vger.kernel.org/msg76461.html\n\n> The above looks under-explained anyway;\n> ...\n\nNot enough energy to go through this. Will do later and post new\nproposed commit message.\n-- \nDuy\n"},{"id":"275137","messageId":"xmqqoad9i256.fsf@gitster.mtv.corp.google.com","threadId":"41079","inReplyTo":"CACsJy8Ad5uihFqVBR4rLA4at_fBDx-yRx1VP1d-uR+4Uug6M9g@mail.gmail.com","subject":"Re: [PATCH 3/6] apply: fix adding new files on i-t-a entries","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-29T17:40:53Z","receivedAt":"2015-12-29T17:40:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> Not enough energy to go through this. Will do later and post new\n> proposed commit message.\n\nI do not have as much issue with the log message as what the patch\ndoes, actually; this change does not look like a good one, which is\na more serious problem.\n"}]}