{"thread":{"id":"49078","subject":"[PATCH] git-update-index.txt: reword possibly confusing example","startedAt":"2018-08-08T20:28:12Z","lastAt":"2018-08-08T21:31:19Z","messageCount":2,"participants":["Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"354927","messageId":"20180808202807.15350-1-newren@gmail.com","threadId":"49078","inReplyTo":null,"subject":"[PATCH] git-update-index.txt: reword possibly confusing example","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-08-08T20:28:07Z","receivedAt":"2018-08-08T20:28:12Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"The following phrase could be interpreted multiple ways:\n  \"To pretend you have a file with mode and sha1 at path\"\n\nIn particular, I can think of two:\n  1. Pretend we have some new file, which happens to have a given mode\n     and sha1\n  2. Pretend one of the files we are already tracking has a different\n     mode and sha1 than what it really does\n\nI think people could easily assume either case while reading, but the\nexample command provided doesn't actually handle the first case, which\ncaused some minor frustration to at least one user.  Modify the example\ncommand so that it correctly handles both cases, and re-order the\nwording in a way that makes it more likely folks will assume the first\ninterpretation.  I believe the new example shouldn't pose any obstacles\nto those wanting the second interpretation (at worst, they pass an\nunnecessary extra flag).\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n Documentation/git-update-index.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 4e8e762e68..a9753e6557 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -245,10 +245,10 @@ USING --CACHEINFO OR --INFO-ONLY\n current working directory.  This is useful for minimum-checkout\n merging.\n \n-To pretend you have a file with mode and sha1 at path, say:\n+To pretend you have a file at path with mode and sha1, say:\n \n ----------------\n-$ git update-index --cacheinfo <mode>,<sha1>,<path>\n+$ git update-index --add --cacheinfo <mode>,<sha1>,<path>\n ----------------\n \n `--info-only` is used to register files without placing them in the object\n-- \n2.18.0.556.g1604670984\n\n"},{"id":"354929","messageId":"xmqqzhxweeam.fsf@gitster-ct.c.googlers.com","threadId":"49078","inReplyTo":"20180808202807.15350-1-newren@gmail.com","subject":"Re: [PATCH] git-update-index.txt: reword possibly confusing example","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-08T21:31:13Z","receivedAt":"2018-08-08T21:31:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> The following phrase could be interpreted multiple ways:\n>   \"To pretend you have a file with mode and sha1 at path\"\n>\n> In particular, I can think of two:\n>   1. Pretend we have some new file, which happens to have a given mode\n>      and sha1\n>   2. Pretend one of the files we are already tracking has a different\n>      mode and sha1 than what it really does\n>\n> I think people could easily assume either case while reading, but the\n> example command provided doesn't actually handle the first case, which\n> caused some minor frustration to at least one user.  Modify the example\n> command so that it correctly handles both cases, and re-order the\n> wording in a way that makes it more likely folks will assume the first\n> interpretation.\n\nI do not think the rephrasing loses those who want to update an\nexisting path, and is a good one.\n\n> -To pretend you have a file with mode and sha1 at path, say:\n> +To pretend you have a file at path with mode and sha1, say:\n>  \n>  ----------------\n> -$ git update-index --cacheinfo <mode>,<sha1>,<path>\n> +$ git update-index --add --cacheinfo <mode>,<sha1>,<path>\n>  ----------------\n"}]}