{"thread":{"id":"14541","subject":"[PATCH] refresh-index: fix bitmask assignment","startedAt":"2008-07-20T06:31:52Z","lastAt":"2008-07-21T18:17:22Z","messageCount":12,"participants":["Junio C Hamano","Petr Baudis","Johannes Schindelin","André Goddard Rosa","Jay Soffian"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83999","messageId":"7vtzelf4mf.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":null,"subject":"[PATCH] refresh-index: fix bitmask assignment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T06:31:52Z","receivedAt":"2008-07-20T06:31:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"5fdeacb (Teach update-index about --ignore-submodules, 2008-05-14) added a\nnew refresh option flag but did not assign a unique bit for it correctly,\nand broke \"update-index --ignore-missing\".\n\nThis should fix it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * The fact that it took this long for anybody to notice the breakage\n   probably means that the \"--ignore-missing\" option in particular but the\n   ability for plumbing to allow scripting in general is not utilized by\n   as many people as the design initially envisioned.\n\n cache.h |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex ca382d4..9735b66 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -396,7 +396,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);\n #define REFRESH_UNMERGED\t0x0002\t/* allow unmerged */\n #define REFRESH_QUIET\t\t0x0004\t/* be quiet about it */\n #define REFRESH_IGNORE_MISSING\t0x0008\t/* ignore non-existent */\n-#define REFRESH_IGNORE_SUBMODULES\t0x0008\t/* ignore submodules */\n+#define REFRESH_IGNORE_SUBMODULES\t0x0010\t/* ignore submodules */\n extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);\n \n struct lock_file {\n-- \n1.5.6.4.570.g052e6\n"},{"id":"84002","messageId":"7vk5fhf35p.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"7vtzelf4mf.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] refresh-index: fix bitmask assignment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T07:03:30Z","receivedAt":"2008-07-20T07:03:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This hopefully protects the previous fix (and other --refresh related\noptions) from future  breakages.\n\nI'll squash it in to the previous one.\n---\n t/t2103-update-index-ignore-missing.sh |   89 ++++++++++++++++++++++++++++++++\n 1 files changed, 89 insertions(+), 0 deletions(-)\n create mode 100755 t/t2103-update-index-ignore-missing.sh\n\ndiff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh\nnew file mode 100755\nindex 0000000..332694e\n--- /dev/null\n+++ b/t/t2103-update-index-ignore-missing.sh\n@@ -0,0 +1,89 @@\n+#!/bin/sh\n+\n+test_description='update-index with options'\n+\n+. ./test-lib.sh\n+\n+test_expect_success basics '\n+\t>one &&\n+\t>two &&\n+\t>three &&\n+\n+\t# need --add when adding\n+\ttest_must_fail git update-index one &&\n+\ttest -z \"$(git ls-files)\" &&\n+\tgit update-index --add one &&\n+\ttest zone = \"z$(git ls-files)\" &&\n+\n+\t# update-index is atomic\n+\techo 1 >one &&\n+\ttest_must_fail git update-index one two &&\n+\techo \"M\tone\" >expect &&\n+\tgit diff-files --name-status >actual &&\n+\ttest_cmp expect actual &&\n+\n+\tgit update-index --add one two three &&\n+\tfor i in one three two; do echo $i; done >expect &&\n+\tgit ls-files >actual &&\n+\ttest_cmp expect actual &&\n+\n+\ttest_tick &&\n+\t(\n+\t\ttest_create_repo xyzzy &&\n+\t\tcd xyzzy &&\n+\t\t>file &&\n+\t\tgit add file\n+\t\tgit commit -m \"sub initial\"\n+\t) &&\n+\tgit add xyzzy &&\n+\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tgit tag initial\n+'\n+\n+test_expect_success '--ignore-missing --refresh' '\n+\tgit reset --hard initial &&\n+\techo 2 >one &&\n+\ttest_must_fail git update-index --refresh &&\n+\techo 1 >one &&\n+\tgit update-index --refresh &&\n+\trm -f two &&\n+\ttest_must_fail git update-index --refresh &&\n+\tgit update-index --ignore-missing --refresh\n+\n+'\n+\n+test_expect_success '--unmerged --refresh' '\n+\tgit reset --hard initial &&\n+\tinfo=$(git ls-files -s one | sed -e \"s/ 0\t/ 1\t/\") &&\n+\tgit rm --cached one &&\n+\techo \"$info\" | git update-index --index-info &&\n+\ttest_must_fail git update-index --refresh &&\n+\tgit update-index --unmerged --refresh &&\n+\techo 2 >two &&\n+\ttest_must_fail git update-index --unmerged --refresh >actual &&\n+\tgrep two actual &&\n+\t! grep one actual &&\n+\t! grep three actual\n+'\n+\n+test_expect_success '--ignore-submodules --refresh (1)' '\n+\tgit reset --hard initial &&\n+\trm -f two &&\n+\ttest_must_fail git update-index --ignore-submodules --refresh\n+'\n+\n+test_expect_success '--ignore-submodules --refresh (2)' '\n+\tgit reset --hard initial &&\n+\ttest_tick &&\n+\t(\n+\t\tcd xyzzy &&\n+\t\tgit commit -m \"sub second\" --allow-empty\n+\t) &&\n+\ttest_must_fail git update-index --refresh &&\n+\ttest_must_fail git update-index --ignore-missing --refresh &&\n+\tgit update-index --ignore-submodules --refresh\n+'\n+\n+test_done\n"},{"id":"84004","messageId":"7v3am5f20f.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"7vk5fhf35p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] refresh-index: fix bitmask assignment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T07:28:16Z","receivedAt":"2008-07-20T07:28:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> This hopefully protects the previous fix (and other --refresh related\n> options) from future  breakages.\n>\n> I'll squash it in to the previous one.\n\nActually, I'll squash this further on top, for a reason that will become\nclear with the next series...\n\n---\n t/t2103-update-index-ignore-missing.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh\nindex 332694e..4fbf855 100755\n--- a/t/t2103-update-index-ignore-missing.sh\n+++ b/t/t2103-update-index-ignore-missing.sh\n@@ -62,10 +62,9 @@ test_expect_success '--unmerged --refresh' '\n \ttest_must_fail git update-index --refresh &&\n \tgit update-index --unmerged --refresh &&\n \techo 2 >two &&\n+\techo \"two: needs update\" >expect &&\n \ttest_must_fail git update-index --unmerged --refresh >actual &&\n-\tgrep two actual &&\n-\t! grep one actual &&\n-\t! grep three actual\n+\ttest_cmp expect actual\n '\n \n test_expect_success '--ignore-submodules --refresh (1)' '\n"},{"id":"84005","messageId":"7vd4l9dmiw.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"7vtzelf4mf.fsf@gitster.siamese.dyndns.org","subject":"[RFC variant 1 of 2] \"needs update\" considered harmful","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T07:48:07Z","receivedAt":"2008-07-20T07:48:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"git update-index --refresh\", \"git reset\" and \"git add --refresh\" have\nreported paths that have local modifications as \"needs update\" since the\nbeginning of git.\n\nAlthough this is logically correct in that you need to update the index at\nthat path before you can commit that change, it is now becoming more and\nmore clear, especially with the continuous push for user friendliness\nsince 1.5.0 series, that the message is suboptimal.  After all, the change\nmay be something the user might want to get rid of, and \"updating\" would\nbe absolutely a wrong thing to do if that is the case.\n\nI prepared two alternatives to solve this.  Both aim to reword the message\nto more neutral \"locally modified\".\n\nThis patch is a more intrusive variant that changes the message for only\nPorcelain commands (\"add\" and \"reset\") while keeping the plumbing\n\"update-index\" intact.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-add.c    |    3 ++-\n builtin-reset.c  |    2 +-\n cache.h          |    1 +\n read-cache.c     |    5 ++++-\n t/t7102-reset.sh |    2 +-\n 5 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-add.c b/builtin-add.c\nindex 9930cf5..5ffe4da 100644\n--- a/builtin-add.c\n+++ b/builtin-add.c\n@@ -142,7 +142,8 @@ static void refresh(int verbose, const char **pathspec)\n \tseen = xcalloc(specs, 1);\n \tif (read_cache() < 0)\n \t\tdie(\"index file corrupt\");\n-\trefresh_index(&the_index, verbose ? 0 : REFRESH_QUIET, pathspec, seen);\n+\trefresh_index(&the_index, verbose ? REFRESH_SAY_CHANGED : REFRESH_QUIET,\n+\t\t      pathspec, seen);\n \tfor (i = 0; i < specs; i++) {\n \t\tif (!seen[i])\n \t\t\tdie(\"pathspec '%s' did not match any files\", pathspec[i]);\ndiff --git a/builtin-reset.c b/builtin-reset.c\nindex a032169..98dbe1c 100644\n--- a/builtin-reset.c\n+++ b/builtin-reset.c\n@@ -96,7 +96,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock)\n \n \tif (read_cache() < 0)\n \t\treturn error(\"Could not read index\");\n-\tresult = refresh_cache(0) ? 1 : 0;\n+\tresult = refresh_cache(REFRESH_SAY_CHANGED) ? 1 : 0;\n \tif (write_cache(fd, active_cache, active_nr) ||\n \t\t\tcommit_locked_index(index_lock))\n \t\treturn error (\"Could not refresh index\");\ndiff --git a/cache.h b/cache.h\nindex 9735b66..da87c72 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -397,6 +397,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);\n #define REFRESH_QUIET\t\t0x0004\t/* be quiet about it */\n #define REFRESH_IGNORE_MISSING\t0x0008\t/* ignore non-existent */\n #define REFRESH_IGNORE_SUBMODULES\t0x0010\t/* ignore submodules */\n+#define REFRESH_SAY_CHANGED\t0x0020\t/* say \"changed\" not \"needs update\" */\n extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);\n \n struct lock_file {\ndiff --git a/read-cache.c b/read-cache.c\nindex f83de8c..9839362 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -980,7 +980,10 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \tint not_new = (flags & REFRESH_IGNORE_MISSING) != 0;\n \tint ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;\n \tunsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;\n+\tconst char *needs_update_message;\n \n+\tneeds_update_message = ((flags & REFRESH_SAY_CHANGED)\n+\t\t\t\t? \"locally modified\" : \"needs update\");\n \tfor (i = 0; i < istate->cache_nr; i++) {\n \t\tstruct cache_entry *ce, *new;\n \t\tint cache_errno = 0;\n@@ -1019,7 +1022,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \t\t\t}\n \t\t\tif (quiet)\n \t\t\t\tcontinue;\n-\t\t\tprintf(\"%s: needs update\\n\", ce->name);\n+\t\t\tprintf(\"%s: %s\\n\", ce->name, needs_update_message);\n \t\t\thas_errors = 1;\n \t\t\tcontinue;\n \t\t}\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 96d1508..da4b142 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -419,7 +419,7 @@ test_expect_success 'resetting an unmodified path is a no-op' '\n '\n \n cat > expect << EOF\n-file2: needs update\n+file2: locally modified\n EOF\n \n test_expect_success '--mixed refreshes the index' '\n"},{"id":"84007","messageId":"7v7ibhdmii.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"7vtzelf4mf.fsf@gitster.siamese.dyndns.org","subject":"[RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T07:48:21Z","receivedAt":"2008-07-20T07:48:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"git update-index --refresh\", \"git reset\" and \"git add --refresh\" have\nreported paths that have local modifications as \"needs update\" since the\nbeginning of git.\n\nAlthough this is logically correct in that you need to update the index at\nthat path before you can commit that change, it is now becoming more and\nmore clear, especially with the continuous push for user friendliness\nsince 1.5.0 series, that the message is suboptimal.  After all, the change\nmay be something the user might want to get rid of, and \"updating\" would\nbe absolutely a wrong thing to do if that is the case.\n\nI prepared two alternatives to solve this.  Both aim to reword the message\nto more neutral \"locally modified\".\n\nThis patch is a more straightforward variant that changes the message not\nonly for Porcelain commands (\"add\" and \"reset\") but also changes the\noutput from the plumbing command \"update-index\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n read-cache.c                           |    2 +-\n t/t2103-update-index-ignore-missing.sh |    2 +-\n t/t7102-reset.sh                       |    2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex f83de8c..d37aec0 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1019,7 +1019,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \t\t\t}\n \t\t\tif (quiet)\n \t\t\t\tcontinue;\n-\t\t\tprintf(\"%s: needs update\\n\", ce->name);\n+\t\t\tprintf(\"%s: locally modified\\n\", ce->name);\n \t\t\thas_errors = 1;\n \t\t\tcontinue;\n \t\t}\ndiff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh\nindex 4fbf855..f775acb 100755\n--- a/t/t2103-update-index-ignore-missing.sh\n+++ b/t/t2103-update-index-ignore-missing.sh\n@@ -62,7 +62,7 @@ test_expect_success '--unmerged --refresh' '\n \ttest_must_fail git update-index --refresh &&\n \tgit update-index --unmerged --refresh &&\n \techo 2 >two &&\n-\techo \"two: needs update\" >expect &&\n+\techo \"two: locally modified\" >expect &&\n \ttest_must_fail git update-index --unmerged --refresh >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t7102-reset.sh b/t/t7102-reset.sh\nindex 96d1508..da4b142 100755\n--- a/t/t7102-reset.sh\n+++ b/t/t7102-reset.sh\n@@ -419,7 +419,7 @@ test_expect_success 'resetting an unmodified path is a no-op' '\n '\n \n cat > expect << EOF\n-file2: needs update\n+file2: locally modified\n EOF\n \n test_expect_success '--mixed refreshes the index' '\n-- \n1.5.6.4.570.g052e6\n"},{"id":"84006","messageId":"7v1w1pdmi8.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"7v3am5f20f.fsf@gitster.siamese.dyndns.org","subject":"[RFC] \"needs update\" considered harmful","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T07:48:31Z","receivedAt":"2008-07-20T07:48:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The previous two variants both aim to reword the somewhat unpopular \"needs\nupdate\" message to easier \"locally modified\".\n\n\"Politically correct\" thing to do would be to keep the output from the\nupdate-index (plumbing) intact and update only output from \"reset\" and\n\"add --refresh -v\" which are Porcelain.  This has smaller chance of\nbreaking people's existing scripts, but some people may find the two\nmessages that say the same thing inconsistent.\n\nRewording to \"locally modified\" even at the plumbing level is a simpler\npatch, keeps the API to refresh_index() intact, and probably is a better\napproach in the longer term, especially if we can ignore people's existing\nscripts.\n"},{"id":"84021","messageId":"20080720112957.GE32184@machine.or.cz","threadId":"14541","inReplyTo":"7v7ibhdmii.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-20T11:29:57Z","receivedAt":"2008-07-20T11:29:57Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jul 20, 2008 at 12:48:21AM -0700, Junio C Hamano wrote:\n> \"git update-index --refresh\", \"git reset\" and \"git add --refresh\" have\n> reported paths that have local modifications as \"needs update\" since the\n> beginning of git.\n> \n> Although this is logically correct in that you need to update the index at\n> that path before you can commit that change, it is now becoming more and\n> more clear, especially with the continuous push for user friendliness\n> since 1.5.0 series, that the message is suboptimal.  After all, the change\n> may be something the user might want to get rid of, and \"updating\" would\n> be absolutely a wrong thing to do if that is the case.\n> \n> I prepared two alternatives to solve this.  Both aim to reword the message\n> to more neutral \"locally modified\".\n> \n> This patch is a more straightforward variant that changes the message not\n> only for Porcelain commands (\"add\" and \"reset\") but also changes the\n> output from the plumbing command \"update-index\".\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nI believe this is a good thing. Scripts need to be modified for the\nreorganization anyway, and I'm not sure if there are any actually\ndepening on this particular string. I think having inconsistent error\nmessaging is worse in long term.\n\nFWIW, looking at Cogito,\n\n\tcg-Xlib: git-update-index --refresh | sed 's/needs update$/locally modified/'\n\nis the only reference to this. ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nAs in certain cults it is possible to kill a process if you know\nits true name.  -- Ken Thompson and Dennis M. Ritchie\n"},{"id":"84030","messageId":"alpine.DEB.1.00.0807201435450.3305@eeepc-johanness","threadId":"14541","inReplyTo":"20080720112957.GE32184@machine.or.cz","subject":"Re: [RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-20T12:41:25Z","receivedAt":"2008-07-20T12:41:25Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 20 Jul 2008, Petr Baudis wrote:\n\n> Scripts need to be modified for the reorganization anyway,\n\nNo.  They do not, if the 1st variant is applied.\n\n> and I'm not sure if there are any actually depening on this particular \n> string.\n\nThat is the question, isn't it?  You would never know.  Many people, \nstrange as it sounds, do not write to this list when they encounter \nproblems with Git.  They vent on their blogs, not giving us a chance, and \nother people comment \"Me too\"s.\n\nOne of the most important features of Git used to be its scriptability, \nand I think that many hackers just love Git for it, even new hackers.\n\nSo it is probably not unheard of that someone wrote an update hook or a \ncronjob using the output of \"update-index --refresh\".\n\nBut those people are probably not on this list, or not following every \nthread, or they even forgot how/that they implemented such a hook/cronjob.\n\nErgo: we would not know if scripts break.  Until it is too late.\n\nCiao,\nDscho\n"},{"id":"84038","messageId":"b8bf37780807200703we8f8608yb009c1039b829b23@mail.gmail.com","threadId":"14541","inReplyTo":"20080720112957.GE32184@machine.or.cz","subject":"Re: [RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"André Goddard Rosa","fromEmail":"andre.goddard@gmail.com","sentAt":"2008-07-20T14:03:04Z","receivedAt":"2008-07-20T14:03:04Z","isPatch":false,"sender":{"key":"andre.goddard@gmail.com","avatar":null},"body":"On Sun, Jul 20, 2008 at 8:29 AM, Petr Baudis <pasky@suse.cz> wrote:\n> On Sun, Jul 20, 2008 at 12:48:21AM -0700, Junio C Hamano wrote:\n>> \"git update-index --refresh\", \"git reset\" and \"git add --refresh\" have\n>> reported paths that have local modifications as \"needs update\" since the\n>> beginning of git.\n>>\n>> Although this is logically correct in that you need to update the index at\n>> that path before you can commit that change, it is now becoming more and\n>> more clear, especially with the continuous push for user friendliness\n>> since 1.5.0 series, that the message is suboptimal.  After all, the change\n>> may be something the user might want to get rid of, and \"updating\" would\n>> be absolutely a wrong thing to do if that is the case.\n>>\n>> I prepared two alternatives to solve this.  Both aim to reword the message\n>> to more neutral \"locally modified\".\n>>\n>> This patch is a more straightforward variant that changes the message not\n>> only for Porcelain commands (\"add\" and \"reset\") but also changes the\n>> output from the plumbing command \"update-index\".\n>>\n>> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>\n> I believe this is a good thing. Scripts need to be modified for the\n\nThanks for doing that. I hope this goes mainline soon.\n\n-- \n[]s,\nAndré Goddard\n"},{"id":"84055","messageId":"7v4p6k73s2.fsf@gitster.siamese.dyndns.org","threadId":"14541","inReplyTo":"alpine.DEB.1.00.0807201435450.3305@eeepc-johanness","subject":"Re: [RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T19:29:33Z","receivedAt":"2008-07-20T19:29:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sun, 20 Jul 2008, Petr Baudis wrote:\n>\n>> Scripts need to be modified for the reorganization anyway,\n>\n> No.  They do not, if the 1st variant is applied.\n\nI think Pasky's point is that people who did not bother updating their\nscripts with PATH=$(git --exec-path):$PATH as described in the deprecation\nnotice when we went 1.5.4 now have to do so.\n\nBut if they did, they have to update again.  The more elaborate variant\navoids that, at the expense of different wordings between Porcelain and\nplumbing.\n\nI personally think there is nothing wrong if Porcelain and plumbing use\ndifferent languages, by the way.  It seems that the general concensus will\nbe to split the Porcelain and the plumbing manuals into separate volumes\ntargetted for different audiences, and it is more important to keep the\nplumbing output stable as part of an established API than making the same\nthing called using the same wording in different languages.\n"},{"id":"84205","messageId":"76718490807211027t45082c7fs3509c4b9abb571d8@mail.gmail.com","threadId":"14541","inReplyTo":"7v4p6k73s2.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC variant 2 of 2] \"needs update\" considered harmful","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-07-21T17:27:21Z","receivedAt":"2008-07-21T17:27:21Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Jul 20, 2008 at 3:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> I personally think there is nothing wrong if Porcelain and plumbing use\n> different languages, by the way.\n\nDo you expect such a clean separation? That a given command is either\nplumbing or porcelain but never both? If not, then a command might\nwant to emit different output depending upon context. Perhaps an\nenvironment variable, along the lines of how one sets locale on Unix,\ncould indicate to a git command whether it running as plumbing or not.\n\nJust a thought.\n\nj.\n"},{"id":"84212","messageId":"76718490807211117t3c1d1194tee1c5dca686df8be@mail.gmail.com","threadId":"14541","inReplyTo":"7v1w1pdmi8.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC] \"needs update\" considered harmful","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-07-21T18:17:22Z","receivedAt":"2008-07-21T18:17:22Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Jul 20, 2008 at 3:48 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> The previous two variants both aim to reword the somewhat unpopular \"needs\n> update\" message to easier \"locally modified\".\n\nAs a git beginner I would still be a confused. I think git beginners\nneed to understand three concepts very early:\n\n- committed changes\n- staged changes\n- unstaged changes\n\nI think saying \"unstaged changes\" instead of \"locally modified\" would\nbe consistent with the git add and rm man pages and less confusing.\n\nOn a related note, I don't understand the need for two different messages here:\n\n$ echo stuff >> foo\n$ git co master\nerror: You have local changes to 'foo'; cannot switch branches.\n$ git add foo\n$ git co master\nerror: Entry 'foo' would be overwritten by merge. Cannot merge.\n\nA single message \"You have uncommitted changes to 'foo'; cannot switch\nbranches.\" would suffice, no?\n\n$0.02.\n\nj.\n"}]}