{"thread":{"id":"47122","subject":"[PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","startedAt":"2017-11-05T16:28:47Z","lastAt":"2017-12-06T22:03:43Z","messageCount":58,"participants":["Ann T Ropea","Junio C Hamano","Philip Oakley","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"331869","messageId":"20171105162730.31405-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":null,"subject":"[PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-05T16:27:28Z","receivedAt":"2017-11-05T16:28:47Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"When a committish, C, is immediately followed by 3dots (...) which are,\nin turn, not followed by another committish, we are usually asking for\nthe revision range C...HEAD, which is known as the symmetric difference\nof C and HEAD.\n\nWhen describe_detached_head is invoked, it prints the committish\nfollowed by 3dots as elaborated above when it indicates the current and\nprevious HEAD positions.  For example:\n\n   # Randomly check out one of the first seven git.git commits\n   # (Starting with a detached HEAD already)\n   $ git checkout $(git rev-list master | tail -7 | shuf | head -1)\n   Previous HEAD position was bfcf2d7874f7... checkout: describe_detached_head: remove 3dots after committish\n   HEAD is now at 19b2860cba57... Use \"-Wall -O2\" for the compiler to get more warnings.\n\n\"Evaluating\" this displayed pseudo-range for the current HEAD indication\nresolves to the empty range (C...HEAD, where C equals HEAD).\n\nFor the previous HEAD indication, the results of the \"evaluation\" are\nsomewhat more difficult to predict: previous here refers to what the\nreflog dictates (this is not necessarily the topological ancestor in the\nDAG, i.e., HEAD^).  In the example above, the \"range\" resolves to almost\nall commits in the author's clone of git.git.  Running the command again\ncauses the then previous to current HEAD position \"range\" to be a lot\nsmaller.\n\nThis could be confusing not only for novices; in either case, no range\nshould be insinuated by describe_detached_head.\n\nGranted, this \"evaluation\" is at the moment, if at all, only performed\nin the mind of the observer.  And, to be sure, the 3dots *are* intended\nas a continuation indication for the abbreviated SHA-1 value.\nNevertheless, we should get rid of them, for the following reasons:\n\n   * they would still be displayed if someone had their core.abbrev\n     config value set to the max\n\n   * when the built-in version of checkout was introduced by commit\n\n        782c2d65c240 (\"Build in checkout\", 2008-02-07)\n\n     no 3dots were present in the legacy git-checkout.sh (see\n     contrib/examples/git-checkout.sh)\n\n   * when git-reset causes a new HEAD line to be printed (during a hard\n     reset), neither builtin/reset.c nor contrib/examples/git-reset.sh\n     mention 3dots\n\nLest we confuse the meticulous observer, we ought to retire the 3dots in\nthe circumstances described above.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\n builtin/checkout.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex fc4f8fd2ea29..59cc52e55855 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -404,7 +404,7 @@ static void describe_detached_head(const char *msg, struct commit *commit)\n \tstruct strbuf sb = STRBUF_INIT;\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\tfprintf(stderr, \"%s %s %s\\n\", msg,\n \t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n \tstrbuf_release(&sb);\n }\n-- \n2.13.6\n\n"},{"id":"331870","messageId":"20171105162730.31405-2-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171105162730.31405-1-bedhanger@gmx.de","subject":"[PATCH 2/3] Documentation: user-manual: limit potentially confusing usage of 3dots (and 2dots)","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-05T16:27:29Z","receivedAt":"2017-11-05T16:29:02Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Using them as continuation indications for abbreviated SHA-1 values\nbears the risk that they are mistaken for the dotted range operators.\n\nCommands which expect a single commit will fail when given a range of\ncommits.\n\nAlso, add a note that sometimes, 3dots are just continuation\nindications.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\n Documentation/user-manual.txt | 20 +++++++++++---------\n 1 file changed, 11 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex b4d88af133e8..bdb44b067399 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\n@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this\n \n If you run `git branch` at this point, you'll see that Git has\n temporarily moved you in \"(no branch)\". HEAD is now detached from any\n-branch and points directly to a commit (with commit id 65934...) that\n+branch and points directly to a commit (with commit id 65934) that\n is reachable from \"master\" but not from v2.6.18. Compile and test it,\n and see whether it crashes. Assume it does crash. Then:\n \n@@ -549,14 +549,14 @@ says \"bisect\".  Choose a safe-looking commit nearby, note its commit\n id, and check it out with:\n \n -------------------------------------------------\n-$ git reset --hard fb47ddb2db...\n+$ git reset --hard fb47ddb2db\n -------------------------------------------------\n \n then test, run `bisect good` or `bisect bad` as appropriate, and\n continue.\n \n Instead of `git bisect visualize` and then `git reset --hard\n-fb47ddb2db...`, you might just want to tell Git that you want to skip\n+fb47ddb2db`, you might just want to tell Git that you want to skip\n the current commit:\n \n -------------------------------------------------\n@@ -3426,6 +3426,8 @@ Date:\n ...\n :100644 100644 oldsha... 4b9458b... M somedirectory/myfile\n ------------------------------------------------\n+(Note that in the above, the \"...\" are used as continuation\n+indications, not as symmetric difference operators!)\n \n This tells you that the immediately following version of the file was\n \"newsha\", and that the immediately preceding version was \"oldsha\".\n@@ -3449,7 +3451,7 @@ and your repository is good again!\n $ git log --raw --all\n ------------------------------------------------\n \n-and just looked for the sha of the missing object (4b9458b..) in that\n+and just looked for the sha of the missing object (4b9458b) in that\n whole thing. It's up to you--Git does *have* a lot of information, it is\n just missing one particular blob version.\n \n@@ -4114,9 +4116,9 @@ program, e.g.  `diff3`, `merge`, or Git's own merge-file, on\n the blob objects from these three stages yourself, like this:\n \n ------------------------------------------------\n-$ git cat-file blob 263414f... >hello.c~1\n-$ git cat-file blob 06fa6a2... >hello.c~2\n-$ git cat-file blob cc44c73... >hello.c~3\n+$ git cat-file blob 263414f >hello.c~1\n+$ git cat-file blob 06fa6a2 >hello.c~2\n+$ git cat-file blob cc44c73 >hello.c~3\n $ git merge-file hello.c~2 hello.c~1 hello.c~3\n ------------------------------------------------\n \n@@ -4374,7 +4376,7 @@ $ git log --no-merges t/\n ------------------------\n \n In the pager (`less`), just search for \"bundle\", go a few lines back,\n-and see that it is in commit 18449ab0...  Now just copy this object name,\n+and see that it is in commit 18449ab0.  Now just copy this object name,\n and paste it into the command line\n \n -------------------\n-- \n2.13.6\n\n"},{"id":"331871","messageId":"20171105162730.31405-3-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171105162730.31405-1-bedhanger@gmx.de","subject":"[PATCH 3/3] Documentation: revisions: add note about 3dots usages as continuation indications","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-05T16:27:30Z","receivedAt":"2017-11-05T16:29:06Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Also, fix typo: \"three dot\" ---> \"three-dot\" (align with \"two-dot\").\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\n Documentation/revisions.txt | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 61277469c874..d1b126427177 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n  for commits that are reachable from r2 excluding those that are reachable\n  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n \n-The '...' (three dot) Symmetric Difference Notation::\n+The '...' (three-dot) Symmetric Difference Notation::\n  A similar notation 'r1\\...r2' is called symmetric difference\n  of 'r1' and 'r2' and is defined as\n  'r1 r2 --not $(git merge-base --all r1 r2)'.\n@@ -285,6 +285,15 @@ is a shorthand for 'HEAD..origin' and asks \"What did the origin do since\n I forked from them?\"  Note that '..' would mean 'HEAD..HEAD' which is an\n empty range that is both reachable and unreachable from HEAD.\n \n+However, there are instances where '<sha1>...' is *not*\n+equivalent to '<sha1>...HEAD'.  See the \"RAW OUTPUT FORMAT\"\n+section of linkgit:git-diff[1]: the three-dot notations used\n+there are simply continuation indications for the abbreviated\n+SHA-1 values.  The ones encountered there are usually\n+associated with file/index/tree contents rather than with commit\n+objects, and the range operators described above are only\n+applicable to commit objects (i.e., 'r1' and 'r2').\n+\n Other <rev>{caret} Parent Shorthand Notations\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n Three other shorthands exist, particularly useful for merge commits,\n-- \n2.13.6\n\n"},{"id":"331903","messageId":"xmqqtvy8i0pw.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171105162730.31405-1-bedhanger@gmx.de","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-06T02:45:47Z","receivedAt":"2017-11-06T02:45:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> This could be confusing not only for novices; in either case, no range\n> should be insinuated by describe_detached_head.\n\nWe actually do not insinuate any range in these output.  These dots\ndenote \"truncated at the end, instead of giving full length.\"\n\nAnother place these \"many dots\" appear is \"git diff --raw\", for\nexample.\n\n"},{"id":"331906","messageId":"xmqqk1z4hvo0.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171105162730.31405-3-bedhanger@gmx.de","subject":"Re: [PATCH 3/3] Documentation: revisions: add note about 3dots usages as continuation indications","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-06T04:34:55Z","receivedAt":"2017-11-06T04:35:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> Also, fix typo: \"three dot\" ---> \"three-dot\" (align with \"two-dot\").\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n>  Documentation/revisions.txt | 11 ++++++++++-\n>  1 file changed, 10 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\n> index 61277469c874..d1b126427177 100644\n> --- a/Documentation/revisions.txt\n> +++ b/Documentation/revisions.txt\n> @@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n>   for commits that are reachable from r2 excluding those that are reachable\n>   from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n>  \n> -The '...' (three dot) Symmetric Difference Notation::\n> +The '...' (three-dot) Symmetric Difference Notation::\n>   A similar notation 'r1\\...r2' is called symmetric difference\n>   of 'r1' and 'r2' and is defined as\n>   'r1 r2 --not $(git merge-base --all r1 r2)'.\n> @@ -285,6 +285,15 @@ is a shorthand for 'HEAD..origin' and asks \"What did the origin do since\n>  I forked from them?\"  Note that '..' would mean 'HEAD..HEAD' which is an\n>  empty range that is both reachable and unreachable from HEAD.\n>  \n> +However, there are instances where '<sha1>...' is *not*\n> +equivalent to '<sha1>...HEAD'.  See the \"RAW OUTPUT FORMAT\"\n> +section of linkgit:git-diff[1]: the three-dot notations used\n> +there are simply continuation indications for the abbreviated\n> +SHA-1 values.  The ones encountered there are usually\n> +associated with file/index/tree contents rather than with commit\n> +objects, and the range operators described above are only\n> +applicable to commit objects (i.e., 'r1' and 'r2').\n> +\n>  Other <rev>{caret} Parent Shorthand Notations\n>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>  Three other shorthands exist, particularly useful for merge commits,\n\nI actually have a mild suspicion that this is going in a wrong\ndirection.  In very early days of Git, we wanted to make sure that\npeople can tell if a long hex string is a truncated object name or a\nfull one (mostly because some lower-level commands insisted to be\nfed only full object name).\n\nThese days, everybody knows when they see 79ec0be62a that it is\n*not* a full object name and will no longer be confused unlike early\ndays and there is no strong reason to waste six output columns of\n\"git diff --raw\" output by using these three dots.  \n\nI wonder if we can come up with a solution in line with the patch\n1/3 in this series, which got rid of the \"...\" that indicated that\nthe hexstring was not a full object name.\n\n\n"},{"id":"331953","messageId":"F055F8BD064E4C268C3CC477C09ABD02@PhilipOakley","threadId":"47122","inReplyTo":"xmqqtvy8i0pw.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-07T00:31:28Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\n> Ann T Ropea <bedhanger@gmx.de> writes:\n>\n>> This could be confusing not only for novices; in either case, no range\n>> should be insinuated by describe_detached_head.\n>\n> We actually do not insinuate any range in these output.  These dots\n> denote \"truncated at the end, instead of giving full length.\"\n>\n> Another place these \"many dots\" appear is \"git diff --raw\", for\n> example.\n>\n\n<bikeshed> The fancy word for the three dots is an `ellipsis`\n- the omission from speech or writing of a word or words that are \nsuperfluous or able to be understood from contextual clues.\n- from the Ancient Greek: ἔλλειψις, élleipsis, \"omission\" or \"falling \nshort\".\n\nThe user/reader confusion may still be there though.\n</bikeshed> \n\n"},{"id":"331957","messageId":"xmqq375qj4fe.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171105162730.31405-1-bedhanger@gmx.de","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-07T00:52:37Z","receivedAt":"2017-11-07T00:55:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> Lest we confuse the meticulous observer, we ought to retire the 3dots in\n> the circumstances described above.\n\nYes, as I said in my response to 3/3, I think it is a good goal to\navoid n-dots used as a \"here we truncated something longer\" sign,\nwhich was a very old convention that was invented without knowing\nthat we'd later come up with a syntax that would conflict with it.\n\nFor this particular output, I wonder if it is even better to follow\nour own advice, though.  Documentation/SubmittingPatches says:\n\n    If you want to reference a previous commit in the history of a stable\n    branch, use the format \"abbreviated sha1 (subject, date)\",\n    with the subject enclosed in a pair of double-quotes, like this:\n\n        Commit f86a374 (\"pack-bitmap.c: fix a memleak\", 2015-03-30)\n        noticed that ...\n\nI dunno.\n\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n>  builtin/checkout.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index fc4f8fd2ea29..59cc52e55855 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -404,7 +404,7 @@ static void describe_detached_head(const char *msg, struct commit *commit)\n>  \tstruct strbuf sb = STRBUF_INIT;\n>  \tif (!parse_commit(commit))\n>  \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n> -\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n> +\tfprintf(stderr, \"%s %s %s\\n\", msg,\n>  \t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n>  \tstrbuf_release(&sb);\n>  }\n"},{"id":"331967","messageId":"20171107025321.31028-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171105162730.31405-1-bedhanger@gmx.de","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-07T02:53:21Z","receivedAt":"2017-11-07T02:54:17Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Thanks for all the feedback provided!\n\nI'd like to summarise what consensus we have reached so far and\nthen propose a way forward:\n\n   * we'll use the term \"ellipsis (pl. ellipses)\" for what's\n     been referred to as \"3dots\", \"n-dots\", \"many dots\" and so\n     forth\n\n   * we would like to use ellipses when attached to SHA-1\n     values only for the purpose of specifying a symmetric\n     difference (as per gitrevisions(7))\n\n   * the usage of ellipses as a \"here we truncated something\n     longer\" is a relic which should be phased out\n\nTo get there, preventing describe_detached_head from appending\nan ellipsis to the SHA-1 values it prints is one important step.\n\nThis change does not cause any test to fall over.\n\nThe other important step is dealing with the \"git diff --raw\"\noutput which features ellipses in the relic-fashion no longer\ndesired.\n\nIt would appear that simplifying diff.c's diff_aligned_abbrev\nroutine to something like:\n\n\t/* Do we want all 40 hex characters?\n\t */\n\tif (len == GIT_SHA1_HEXSZ)\n\t\treturn oid_to_hex(oid);\n\n\t/* An abbreviated value is fine.\n\t */\n\treturn diff_abbrev_oid(oid, len);\n\ndoes do the trick.\n\nThis change causes quite a few tests to fall over; however, they\nall have truncated-something-longer-ellipses in their\nraw-diff-output expected sections, and removing the ellipses\nfrom there makes the tests pass again, :-)\n\nIf we can agree that this is a way forward, i'll create & send\nv2 of the patch series to the mailing list (it'll include the\nfixed tests) and we'll see where we go from there.\n"},{"id":"332040","messageId":"83D263E58ABD46188756D41FE311E469@PhilipOakley","threadId":"47122","inReplyTo":"20171107025321.31028-1-bedhanger@gmx.de","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-07T23:25:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Ann T Ropea\" <bedhanger@gmx.de>\n> Thanks for all the feedback provided!\n>\n> I'd like to summarise what consensus we have reached so far and\n> then propose a way forward:\n>\n>   * we'll use the term \"ellipsis (pl. ellipses)\" for what's\n>     been referred to as \"3dots\", \"n-dots\", \"many dots\" and so\n>     forth\n\nUsing a consistent  term for the *display* of shortened oid's is good.\n\n>\n>   * we would like to use ellipses when attached to SHA-1\n>     values only for the purpose of specifying a symmetric\n>     difference (as per gitrevisions(7))\n\nThe symetric difference (three-dots) is a specific Git *cli* notation that \nis distinct from the use of ellipsis for displaying oid's\n\n>\n>   * the usage of ellipses as a \"here we truncated something\n>     longer\" is a relic which should be phased out.\n\nI think that is true.\n\n>\n> To get there, preventing describe_detached_head from appending\n> an ellipsis to the SHA-1 values it prints is one important step.\n>\n> This change does not cause any test to fall over.\n\nBut...\n>\n> The other important step is dealing with the \"git diff --raw\"\n> output which features ellipses in the relic-fashion no longer\n> desired.\n>\n> It would appear that simplifying diff.c's diff_aligned_abbrev\n> routine to something like:\n>\n> /* Do we want all 40 hex characters?\n> */\n> if (len == GIT_SHA1_HEXSZ)\n> return oid_to_hex(oid);\n>\n> /* An abbreviated value is fine.\n> */\n> return diff_abbrev_oid(oid, len);\n>\n> does do the trick.\n>\n> This change causes quite a few tests to fall over; however, they\n> all have truncated-something-longer-ellipses in their\n> raw-diff-output expected sections, and removing the ellipses\n> from there makes the tests pass again, :-)\n\nThe number of failures you report in the test suit suggests that someone \nsomewhere will be expecting that notation, and that we may need a \ndeprecation period, perhaps with an 'ellipsis' config variable whose default \nvalue can later be flipped, though that leaves a config value needing \nsupport forever!\n\nJunio should be able to better advise on his preferred approach.\n\n>\n> If we can agree that this is a way forward, i'll create & send\n> v2 of the patch series to the mailing list (it'll include the\n> fixed tests) and we'll see where we go from there.\n\n--\nPhilip \n\n"},{"id":"332058","messageId":"xmqqfu9pmsx3.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"83D263E58ABD46188756D41FE311E469@PhilipOakley","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-08T01:59:52Z","receivedAt":"2017-11-08T01:59:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n> But...\n>> ...\n>> This change causes quite a few tests to fall over; however, they\n>> all have truncated-something-longer-ellipses in their\n>> raw-diff-output expected sections, and removing the ellipses\n>> from there makes the tests pass again, :-)\n>\n> The number of failures you report in the test suit suggests that\n> someone somewhere will be expecting that notation, and that we may\n> need a deprecation period, perhaps with an 'ellipsis' config variable\n> whose default value can later be flipped, though that leaves a config\n> value needing support forever!\n\nHmmm, never thought about that. \n\nI have been assuming that tools reading \"--raw\" output that is\nabbreviated would be crazy, because they have to strip the dots and\nthe number of dots may not always be three [*1*].\n\nBut you are right.  It would be very unlikely that there is no such\ncrazy tools, so it deserves consideration if we would be breaking\nsuch tools.\n\nOn the other hand, if such a crazy tool was still written correctly\n(it is debatable what the definition of \"correct\" is, though), it\nwould be stripping any number dots at the end, not just insisting on\nseeing exactly three dots, and splitting these fields at SP.\nOtherwise they would already be broken as they cannot handle\noccasional object names that have less than three dots because they\nhappen to be longer than the more common abbreviation length used by\nother objects.  So in practice it might not be _too_ bad.\n\n\n[Footnote]\n\n*1* When we ask for --abbrev=7, we allocate 10 places and fill the\nrest with necessary number of dots after the result of\nfind_unique_abbrev(), so if an object name turns out to require 8\nhexdigits to make it unique, we'll append only two dots to it to\nmake it 10 so that it aligns nicely with others) and they would\nalways be reading the full, non abbreviated output.  The story does\nnot change that much when we do not explicitly ask for a specific\nabbreviation length in that we add variable number of dots for\naligning in that case, too.\n\n\n\n"},{"id":"332135","messageId":"EA775C6AB4684B7A86A88C733C132827@PhilipOakley","threadId":"47122","inReplyTo":"xmqqfu9pmsx3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/3] checkout: describe_detached_head: remove 3dots after committish","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-09T23:15:16Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\nSent: Wednesday, November 08, 2017 1:59 AM\n\n\n> \"Philip Oakley\" <philipoakley@iee.org> writes:\n>\n>> But...\n>>> ...\n>>> This change causes quite a few tests to fall over; however, they\n>>> all have truncated-something-longer-ellipses in their\n>>> raw-diff-output expected sections, and removing the ellipses\n>>> from there makes the tests pass again, :-)\n>>\n>> The number of failures you report in the test suit suggests that\n>> someone somewhere will be expecting that notation, and that we may\n>> need a deprecation period, perhaps with an 'ellipsis' config variable\n>> whose default value can later be flipped, though that leaves a config\n>> value needing support forever!\n>\n> Hmmm, never thought about that.\n>\n> I have been assuming that tools reading \"--raw\" output that is\n> abbreviated would be crazy, because they have to strip the dots and\n> the number of dots may not always be three [*1*].\n>\n> But you are right.  It would be very unlikely that there is no such\n> crazy tools, so it deserves consideration if we would be breaking\n> such tools.\n>\n> On the other hand, if such a crazy tool was still written correctly\n> (it is debatable what the definition of \"correct\" is, though), it\n> would be stripping any number dots at the end, not just insisting on\n> seeing exactly three dots, and splitting these fields at SP.\n> Otherwise they would already be broken as they cannot handle\n> occasional object names that have less than three dots because they\n> happen to be longer than the more common abbreviation length used by\n> other objects.  So in practice it might not be _too_ bad.\n>\nThinking on this, I'd suggest that the patch series does remove the ellipsis \ndots immediately, but retains a config option that can be set to get back \nthe old 'dots' display for those who have badly written scripts that maybe \nhaven't failed yet. i.e. no deprecation period, just a fall back option; and \nif nobody shouts then remove the config option after a respectable period.\n\nIt would also mean the existing tests can be re-used...\n\n>\n> [Footnote]\n>\n> *1* When we ask for --abbrev=7, we allocate 10 places and fill the\n> rest with necessary number of dots after the result of\n> find_unique_abbrev(), so if an object name turns out to require 8\n> hexdigits to make it unique, we'll append only two dots to it to\n> make it 10 so that it aligns nicely with others) and they would\n> always be reading the full, non abbreviated output.  The story does\n> not change that much when we do not explicitly ask for a specific\n> abbreviation length in that we add variable number of dots for\n> aligning in that case, too.\n\nThe --abbrev=7 does cater for many smaller repo's, so there is a possiblity \nthat the bad script issue hasn't been hit yet by those repos.\n--\n\nPhilip \n\n"},{"id":"332461","messageId":"20171113223654.27732-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"EA775C6AB4684B7A86A88C733C132827@PhilipOakley","subject":"Re: [PATCH v2 1/6] config: introduce core.printsha1ellipsis","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:49Z","receivedAt":"2017-11-13T22:38:43Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We use it to ascertain whether or not the user wants an ellipsis\nprinted after an abbreviated SHA-1 value.\n\nBy de-asserting it in the default, we encourage not printing the\nellipsis in such circumstances.\n\nNot adding a corresponding cli option is intentional; and we would like\nto remove the config option *and* the ellipses after abbreviated SHA-1\nvalues after a respectable period.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n Documentation/config.txt | 10 ++++++++++\n cache.h                  |  1 +\n config.c                 |  9 +++++++++\n environment.c            |  1 +\n 4 files changed, 21 insertions(+)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 671fcbaa0fd1..93887820ff89 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -898,6 +898,16 @@ core.abbrev::\n \tabbreviated object names to stay unique for some time.\n \tThe minimum length is 4.\n \n+core.printsha1ellipsis (deprecated)::\n+\tA Boolean controlling whether an ellipsis should be\n+\tprinted following an (abbreviated) SHA-1 value.  This\n+\taffects indications of detached HEADs or the raw diff\n+\toutput.  Printing an ellipsis in the cases mentioned is no\n+\tlonger considered adequate and support for it will be\n+\tremoved in the foreseeable future (along with the\n+\toption).\n+\tTherefore, the default is false.\n+\n add.ignoreErrors::\n add.ignore-errors (deprecated)::\n \tTells 'git add' to continue adding files when some files cannot be\ndiff --git a/cache.h b/cache.h\nindex cb7fb7c004be..5cbc50a0c1ab 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -753,6 +753,7 @@ extern int check_stat;\n extern int quote_path_fully;\n extern int has_symlinks;\n extern int minimum_abbrev, default_abbrev;\n+extern int print_sha1_ellipsis;\n extern int ignore_case;\n extern int assume_unchanged;\n extern int prefer_symlink_refs;\ndiff --git a/config.c b/config.c\nindex 903abf9533b1..f560aea5e98b 100644\n--- a/config.c\n+++ b/config.c\n@@ -1073,6 +1073,15 @@ static int git_default_core_config(const char *var, const char *value)\n \t\treturn 0;\n \t}\n \n+\t/* Printing an ellipsis after an abbreviated SHA-1 value\n+\t * is no longer desired but must be selectable for some\n+\t * time to come.\n+\t */\n+\tif (!strcmp(var, \"core.printsha1ellipsis\")) {\n+\t\tprint_sha1_ellipsis = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\n \tif (!strcmp(var, \"core.disambiguate\"))\n \t\treturn set_disambiguate_hint_config(var, value);\n \ndiff --git a/environment.c b/environment.c\nindex 8289c25b44d7..5ceb92f921c6 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -19,6 +19,7 @@ int trust_ctime = 1;\n int check_stat = 1;\n int has_symlinks = 1;\n int minimum_abbrev = 4, default_abbrev = -1;\n+int print_sha1_ellipsis = 0; /* Only if the user requests it. */\n int ignore_case;\n int assume_unchanged;\n int prefer_symlink_refs;\n-- \n2.13.6\n\n"},{"id":"332462","messageId":"20171113223654.27732-2-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171113223654.27732-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 2/6] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:50Z","receivedAt":"2017-11-13T22:38:50Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user (actively!) sets the config option core.printsha1ellipsis to\ntrue.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n builtin/checkout.c | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 6c2b4cd419a4..101a16a14a76 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -402,8 +402,13 @@ static void describe_detached_head(const char *msg, struct commit *commit)\n \tstruct strbuf sb = STRBUF_INIT;\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (print_sha1_ellipsis) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \n-- \n2.13.6\n\n"},{"id":"332463","messageId":"20171113223654.27732-3-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171113223654.27732-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 3/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:51Z","receivedAt":"2017-11-13T22:38:51Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Neither Git nor the user are in need of this (visual) aid anymore, but\nwe must offer a transition period.\n\nAlso, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n diff.c | 69 +++++++++++++++++++++++++++++++++++++-----------------------------\n 1 file changed, 39 insertions(+), 30 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 0763e89263ef..9709dc37c6d7 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4902,41 +4902,50 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n \tint abblen;\n \tconst char *abbrev;\n \n+\t/* Do we want all 40 hex characters?\n+\t */\n \tif (len == GIT_SHA1_HEXSZ)\n \t\treturn oid_to_hex(oid);\n \n-\tabbrev = diff_abbrev_oid(oid, len);\n-\tabblen = strlen(abbrev);\n-\n-\t/*\n-\t * In well-behaved cases, where the abbbreviated result is the\n-\t * same as the requested length, append three dots after the\n-\t * abbreviation (hence the whole logic is limited to the case\n-\t * where abblen < 37); when the actual abbreviated result is a\n-\t * bit longer than the requested length, we reduce the number\n-\t * of dots so that they match the well-behaved ones.  However,\n-\t * if the actual abbreviation is longer than the requested\n-\t * length by more than three, we give up on aligning, and add\n-\t * three dots anyway, to indicate that the output is not the\n-\t * full object name.  Yes, this may be suboptimal, but this\n-\t * appears only in \"diff --raw --abbrev\" output and it is not\n-\t * worth the effort to change it now.  Note that this would\n-\t * likely to work fine when the automatic sizing of default\n-\t * abbreviation length is used--we would be fed -1 in \"len\" in\n-\t * that case, and will end up always appending three-dots, but\n-\t * the automatic sizing is supposed to give abblen that ensures\n-\t * uniqueness across all objects (statistically speaking).\n+\t/* An abbreviated value is fine, possibly followed by an\n+\t * ellipsis.\n \t */\n-\tif (abblen < GIT_SHA1_HEXSZ - 3) {\n-\t\tstatic char hex[GIT_MAX_HEXSZ + 1];\n-\t\tif (len < abblen && abblen <= len + 2)\n-\t\t\txsnprintf(hex, sizeof(hex), \"%s%.*s\", abbrev, len+3-abblen, \"..\");\n-\t\telse\n-\t\t\txsnprintf(hex, sizeof(hex), \"%s...\", abbrev);\n-\t\treturn hex;\n-\t}\n+\tif (print_sha1_ellipsis) {\n+\t\tabbrev = diff_abbrev_oid(oid, len);\n+\t\tabblen = strlen(abbrev);\n+\n+\t\t/*\n+\t\t * In well-behaved cases, where the abbreviated result is the\n+\t\t * same as the requested length, append three dots after the\n+\t\t * abbreviation (hence the whole logic is limited to the case\n+\t\t * where abblen < 37); when the actual abbreviated result is a\n+\t\t * bit longer than the requested length, we reduce the number\n+\t\t * of dots so that they match the well-behaved ones.  However,\n+\t\t * if the actual abbreviation is longer than the requested\n+\t\t * length by more than three, we give up on aligning, and add\n+\t\t * three dots anyway, to indicate that the output is not the\n+\t\t * full object name.  Yes, this may be suboptimal, but this\n+\t\t * appears only in \"diff --raw --abbrev\" output and it is not\n+\t\t * worth the effort to change it now.  Note that this would\n+\t\t * likely to work fine when the automatic sizing of default\n+\t\t * abbreviation length is used--we would be fed -1 in \"len\" in\n+\t\t * that case, and will end up always appending three-dots, but\n+\t\t * the automatic sizing is supposed to give abblen that ensures\n+\t\t * uniqueness across all objects (statistically speaking).\n+\t\t */\n+\t\tif (abblen < GIT_SHA1_HEXSZ - 3) {\n+\t\t\tstatic char hex[GIT_MAX_HEXSZ + 1];\n+\t\t\tif (len < abblen && abblen <= len + 2)\n+\t\t\t\txsnprintf(hex, sizeof(hex), \"%s%.*s\", abbrev, len+3-abblen, \"..\");\n+\t\t\telse\n+\t\t\t\txsnprintf(hex, sizeof(hex), \"%s...\", abbrev);\n+\t\t\treturn hex;\n+\t\t}\n \n-\treturn oid_to_hex(oid);\n+\t\treturn oid_to_hex(oid);\n+\t} else {\n+\t\treturn diff_abbrev_oid(oid, len);\n+\t}\n }\n \n static void diff_flush_raw(struct diff_filepair *p, struct diff_options *opt)\n-- \n2.13.6\n\n"},{"id":"332464","messageId":"20171113223654.27732-4-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171113223654.27732-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 4/6] Documentation: user-manual: limit usage of ellipsis","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:52Z","receivedAt":"2017-11-13T22:38:53Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Confusing the ellipsis with the three-dot operator should be made as\ndifficult as possible.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n Documentation/user-manual.txt | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 3a03e63eb0d8..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\n@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this\n \n If you run `git branch` at this point, you'll see that Git has\n temporarily moved you in \"(no branch)\". HEAD is now detached from any\n-branch and points directly to a commit (with commit id 65934...) that\n+branch and points directly to a commit (with commit id 65934) that\n is reachable from \"master\" but not from v2.6.18. Compile and test it,\n and see whether it crashes. Assume it does crash. Then:\n \n@@ -549,14 +549,14 @@ says \"bisect\".  Choose a safe-looking commit nearby, note its commit\n id, and check it out with:\n \n -------------------------------------------------\n-$ git reset --hard fb47ddb2db...\n+$ git reset --hard fb47ddb2db\n -------------------------------------------------\n \n then test, run `bisect good` or `bisect bad` as appropriate, and\n continue.\n \n Instead of `git bisect visualize` and then `git reset --hard\n-fb47ddb2db...`, you might just want to tell Git that you want to skip\n+fb47ddb2db`, you might just want to tell Git that you want to skip\n the current commit:\n \n -------------------------------------------------\n@@ -3416,7 +3416,7 @@ commit abc\n Author:\n Date:\n ...\n-:100644 100644 4b9458b... newsha... M somedirectory/myfile\n+:100644 100644 4b9458b newsha M somedirectory/myfile\n \n \n commit xyz\n@@ -3424,7 +3424,7 @@ Author:\n Date:\n \n ...\n-:100644 100644 oldsha... 4b9458b... M somedirectory/myfile\n+:100644 100644 oldsha 4b9458b M somedirectory/myfile\n ------------------------------------------------\n \n This tells you that the immediately following version of the file was\n@@ -3449,7 +3449,7 @@ and your repository is good again!\n $ git log --raw --all\n ------------------------------------------------\n \n-and just looked for the sha of the missing object (4b9458b..) in that\n+and just looked for the sha of the missing object (4b9458b) in that\n whole thing. It's up to you--Git does *have* a lot of information, it is\n just missing one particular blob version.\n \n@@ -4114,9 +4114,9 @@ program, e.g.  `diff3`, `merge`, or Git's own merge-file, on\n the blob objects from these three stages yourself, like this:\n \n ------------------------------------------------\n-$ git cat-file blob 263414f... >hello.c~1\n-$ git cat-file blob 06fa6a2... >hello.c~2\n-$ git cat-file blob cc44c73... >hello.c~3\n+$ git cat-file blob 263414f >hello.c~1\n+$ git cat-file blob 06fa6a2 >hello.c~2\n+$ git cat-file blob cc44c73 >hello.c~3\n $ git merge-file hello.c~2 hello.c~1 hello.c~3\n ------------------------------------------------\n \n@@ -4374,7 +4374,7 @@ $ git log --no-merges t/\n ------------------------\n \n In the pager (`less`), just search for \"bundle\", go a few lines back,\n-and see that it is in commit 18449ab0...  Now just copy this object name,\n+and see that it is in commit 18449ab0.  Now just copy this object name,\n and paste it into the command line\n \n -------------------\n-- \n2.13.6\n\n"},{"id":"332465","messageId":"20171113223654.27732-5-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171113223654.27732-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 5/6] Documentation: revisions: fix typo: \"three dot\" ---> \"three-dot\" (in line with \"two-dot\").","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:53Z","receivedAt":"2017-11-13T22:38:56Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n Documentation/revisions.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 61277469c874..dfcc49c72c0f 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n  for commits that are reachable from r2 excluding those that are reachable\n  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n \n-The '...' (three dot) Symmetric Difference Notation::\n+The '...' (three-dot) Symmetric Difference Notation::\n  A similar notation 'r1\\...r2' is called symmetric difference\n  of 'r1' and 'r2' and is defined as\n  'r1 r2 --not $(git merge-base --all r1 r2)'.\n-- \n2.13.6\n\n"},{"id":"332466","messageId":"20171113223654.27732-6-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171113223654.27732-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 6/6] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-13T22:36:54Z","receivedAt":"2017-11-13T22:39:00Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Where needed, we arrange for invocations of Git as if\n\n   \"-c core.printsha1ellipsis=true\"\n\nhad been specified on the command-line.  This furnishes ellipses in the\noutput which then matches what is expected.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\n t/t3040-subprojects-basic.sh | 12 ++++++++++++\n t/t4013-diff-various.sh      | 12 ++++++++++++\n t/t9300-fast-import.sh       | 12 ++++++++++++\n 3 files changed, 36 insertions(+)\n\ndiff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh\nindex 0a4ff6d824a0..63b85bfdd4f9 100755\n--- a/t/t3040-subprojects-basic.sh\n+++ b/t/t3040-subprojects-basic.sh\n@@ -3,6 +3,18 @@\n test_description='Basic subproject functionality'\n . ./test-lib.sh\n \n+# Some of the tests expect an ellipsis after the (abbreviated)\n+# SHA-1 value.  The code below results in Git being called with\n+# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n+do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n+if test -z \"${GIT_CONFIG_PARAMETERS}\"\n+then\n+\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n+else\n+\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n+fi\n+export GIT_CONFIG_PARAMETERS\n+\n test_expect_success 'setup: create superproject' '\n \t: >Makefile &&\n \tgit add Makefile &&\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex c515e3e53fee..8ee14c7c6796 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -7,6 +7,18 @@ test_description='Various diff formatting options'\n \n . ./test-lib.sh\n \n+# Some of the tests expect an ellipsis after the (abbreviated)\n+# SHA-1 value.  The code below results in Git being called with\n+# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n+do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n+if test -z \"${GIT_CONFIG_PARAMETERS}\"\n+then\n+\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n+else\n+\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n+fi\n+export GIT_CONFIG_PARAMETERS\n+\n LF='\n '\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex d47560b6343d..6cc41b90dafa 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -7,6 +7,18 @@ test_description='test git fast-import utility'\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n \n+# Some of the tests expect an ellipsis after the (abbreviated)\n+# SHA-1 value.  The code below results in Git being called with\n+# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n+do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n+if test -z \"${GIT_CONFIG_PARAMETERS}\"\n+then\n+\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n+else\n+\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n+fi\n+export GIT_CONFIG_PARAMETERS\n+\n verify_packs () {\n \tfor p in .git/objects/pack/*.pack\n \tdo\n-- \n2.13.6\n\n"},{"id":"332496","messageId":"xmqq1sl17e1u.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171113223654.27732-3-bedhanger@gmx.de","subject":"Re: [PATCH v2 3/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-14T03:08:13Z","receivedAt":"2017-11-14T03:08:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> Neither Git nor the user are in need of this (visual) aid anymore, but\n> we must offer a transition period.\n>\n> Also, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n> v2: rename patch series & focus on removal of ellipses\n>  diff.c | 69 +++++++++++++++++++++++++++++++++++++-----------------------------\n>  1 file changed, 39 insertions(+), 30 deletions(-)\n>\n> diff --git a/diff.c b/diff.c\n> index 0763e89263ef..9709dc37c6d7 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -4902,41 +4902,50 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n>  \tint abblen;\n>  \tconst char *abbrev;\n>  \n> +\t/* Do we want all 40 hex characters?\n> +\t */\n\nThe oldest parts of the codebase (including diff.c) deviate from the\nrule in places, but in our multi-line comment, /* and */ occupy a\nline on their own.  In this case, a single-line comment should be\nsufficient, though.\n\n>  \tif (len == GIT_SHA1_HEXSZ)\n>  \t\treturn oid_to_hex(oid);\n>  \n> -\tabbrev = diff_abbrev_oid(oid, len);\n> -\tabblen = strlen(abbrev);\n> -\n> -\t/*\n> -\t * In well-behaved cases, where the abbbreviated result is the\n> -\t * same as the requested length, append three dots after the\n> -\t * abbreviation (hence the whole logic is limited to the case\n> -\t * where abblen < 37); when the actual abbreviated result is a\n> -\t * bit longer than the requested length, we reduce the number\n> -\t * of dots so that they match the well-behaved ones.  However,\n> -\t * if the actual abbreviation is longer than the requested\n> -\t * length by more than three, we give up on aligning, and add\n> -\t * three dots anyway, to indicate that the output is not the\n> -\t * full object name.  Yes, this may be suboptimal, but this\n> -\t * appears only in \"diff --raw --abbrev\" output and it is not\n> -\t * worth the effort to change it now.  Note that this would\n> -\t * likely to work fine when the automatic sizing of default\n> -\t * abbreviation length is used--we would be fed -1 in \"len\" in\n> -\t * that case, and will end up always appending three-dots, but\n> -\t * the automatic sizing is supposed to give abblen that ensures\n> -\t * uniqueness across all objects (statistically speaking).\n> +\t/* An abbreviated value is fine, possibly followed by an\n> +\t * ellipsis.\n>  \t */\n\nDitto.\n\n> -\tif (abblen < GIT_SHA1_HEXSZ - 3) {\n> -\t\tstatic char hex[GIT_MAX_HEXSZ + 1];\n> -\t\tif (len < abblen && abblen <= len + 2)\n> -\t\t\txsnprintf(hex, sizeof(hex), \"%s%.*s\", abbrev, len+3-abblen, \"..\");\n> -\t\telse\n> -\t\t\txsnprintf(hex, sizeof(hex), \"%s...\", abbrev);\n> -\t\treturn hex;\n> -\t}\n> +\tif (print_sha1_ellipsis) {\n> +\t\tabbrev = diff_abbrev_oid(oid, len);\n> +\t\tabblen = strlen(abbrev);\n> +\n> +\t\t/*\n> +\t\t * In well-behaved cases, where the abbreviated result is the\n> +\t\t * same as the requested length, append three dots after the\n> +\t\t * abbreviation (hence the whole logic is limited to the case\n> +\t\t * where abblen < 37); when the actual abbreviated result is a\n> +\t\t * bit longer than the requested length, we reduce the number\n> +\t\t * of dots so that they match the well-behaved ones.  However,\n> +\t\t * if the actual abbreviation is longer than the requested\n> +\t\t * length by more than three, we give up on aligning, and add\n> +\t\t * three dots anyway, to indicate that the output is not the\n> +\t\t * full object name.  Yes, this may be suboptimal, but this\n> +\t\t * appears only in \"diff --raw --abbrev\" output and it is not\n> +\t\t * worth the effort to change it now.  Note that this would\n> +\t\t * likely to work fine when the automatic sizing of default\n> +\t\t * abbreviation length is used--we would be fed -1 in \"len\" in\n> +\t\t * that case, and will end up always appending three-dots, but\n> +\t\t * the automatic sizing is supposed to give abblen that ensures\n> +\t\t * uniqueness across all objects (statistically speaking).\n> +\t\t */\n> +\t\tif (abblen < GIT_SHA1_HEXSZ - 3) {\n> +\t\t\tstatic char hex[GIT_MAX_HEXSZ + 1];\n> +\t\t\tif (len < abblen && abblen <= len + 2)\n> +\t\t\t\txsnprintf(hex, sizeof(hex), \"%s%.*s\", abbrev, len+3-abblen, \"..\");\n> +\t\t\telse\n> +\t\t\t\txsnprintf(hex, sizeof(hex), \"%s...\", abbrev);\n> +\t\t\treturn hex;\n> +\t\t}\n>  \n> -\treturn oid_to_hex(oid);\n> +\t\treturn oid_to_hex(oid);\n> +\t} else {\n> +\t\treturn diff_abbrev_oid(oid, len);\n> +\t}\n>  }\n\nIf I were writing this, I would have called diff_abbrev_oid() before\nchecking print_sha1_ellipsis, returned it if it is not set.  That\nway the indentation level of the code would not have to change.\n\nHOWEVER.\n\nNotice the name of the function.  We no longer even attempt to align\nthe output, and in general the output column length of each line\nwould be shorter than the original.  I am wondering if the change\nwould be of less impact if we try to abbreviate to len+3 and then\nchomp the result at the right hand side to len+3 (only if the result\nis unique) when print_sha1_ellipsis is false.  Of course, once we go\nthat path, the code structure this patch introduces (not the one I\nmentioned in the previous paragraph) would be necessary.  Essentially\nyou would be enhancing the \"else\" clause.\n\n\n>  \n>  static void diff_flush_raw(struct diff_filepair *p, struct diff_options *opt)\n"},{"id":"332498","messageId":"xmqqwp2t5yxg.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171113223654.27732-6-bedhanger@gmx.de","subject":"Re: [PATCH v2 6/6] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-14T03:20:11Z","receivedAt":"2017-11-14T03:20:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> Where needed, we arrange for invocations of Git as if\n>\n>    \"-c core.printsha1ellipsis=true\"\n>\n> had been specified on the command-line.  This furnishes ellipses in the\n> output which then matches what is expected.\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n\nI am not a huge fan of exposing undocumented implementation details\nto the test scripts that much.  There are three in t13xx series that\nmention GIT_CONFIG_PARAMETERS, but these are about testing the config\nmechanism itself.  \n\nAn end-user script would instead be doing \"git -c var=val\" for each\ninvocation but this one is being lazy because it does not want to\nbother identifying which \"git\" invocation needs the treatment and\nalso it does not want to keep maintaining it, which is understandable,\nbut it feels dirty.\n\nThis makes me wonder if core.printsha1ellipsis should really be a\nconfiguration variable in the first place.  Wouldn't an environment\nvariable be more appropriate?  After all, the users of scripts that\nwould be broken by this series would need to the same thing as what\nwe do to our tests to keep them working while they update them.\n\n> v2: rename patch series & focus on removal of ellipses\n>  t/t3040-subprojects-basic.sh | 12 ++++++++++++\n>  t/t4013-diff-various.sh      | 12 ++++++++++++\n>  t/t9300-fast-import.sh       | 12 ++++++++++++\n>  3 files changed, 36 insertions(+)\n>\n> diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh\n> index 0a4ff6d824a0..63b85bfdd4f9 100755\n> --- a/t/t3040-subprojects-basic.sh\n> +++ b/t/t3040-subprojects-basic.sh\n> @@ -3,6 +3,18 @@\n>  test_description='Basic subproject functionality'\n>  . ./test-lib.sh\n>  \n> +# Some of the tests expect an ellipsis after the (abbreviated)\n> +# SHA-1 value.  The code below results in Git being called with\n> +# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n> +do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n> +if test -z \"${GIT_CONFIG_PARAMETERS}\"\n> +then\n> +\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n> +else\n> +\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n> +fi\n> +export GIT_CONFIG_PARAMETERS\n> +\n>  test_expect_success 'setup: create superproject' '\n>  \t: >Makefile &&\n>  \tgit add Makefile &&\n> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\n> index c515e3e53fee..8ee14c7c6796 100755\n> --- a/t/t4013-diff-various.sh\n> +++ b/t/t4013-diff-various.sh\n> @@ -7,6 +7,18 @@ test_description='Various diff formatting options'\n>  \n>  . ./test-lib.sh\n>  \n> +# Some of the tests expect an ellipsis after the (abbreviated)\n> +# SHA-1 value.  The code below results in Git being called with\n> +# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n> +do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n> +if test -z \"${GIT_CONFIG_PARAMETERS}\"\n> +then\n> +\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n> +else\n> +\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n> +fi\n> +export GIT_CONFIG_PARAMETERS\n> +\n>  LF='\n>  '\n>  \n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index d47560b6343d..6cc41b90dafa 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -7,6 +7,18 @@ test_description='test git fast-import utility'\n>  . ./test-lib.sh\n>  . \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n>  \n> +# Some of the tests expect an ellipsis after the (abbreviated)\n> +# SHA-1 value.  The code below results in Git being called with\n> +# \"-c core.printsha1ellipsis=true\" which satisfies those tests.\n> +do_print_sha1_ellipsis=\"'core.printsha1ellipsis=true'\"\n> +if test -z \"${GIT_CONFIG_PARAMETERS}\"\n> +then\n> +\tGIT_CONFIG_PARAMETERS=\"${do_print_sha1_ellipsis}\"\n> +else\n> +\tGIT_CONFIG_PARAMETERS=\"${GIT_CONFIG_PARAMETERS} ${do_print_sha1_ellipsis}\"\n> +fi\n> +export GIT_CONFIG_PARAMETERS\n> +\n>  verify_packs () {\n>  \tfor p in .git/objects/pack/*.pack\n>  \tdo\n"},{"id":"332859","messageId":"20171119173838.8820-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqq1sl17e1u.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 3/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T17:38:38Z","receivedAt":"2017-11-19T17:39:51Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> HOWEVER.\n\n> Notice the name of the function.  We no longer even attempt to align\n> the output, and in general the output column length of each line\n> would be shorter than the original.  I am wondering if the change\n> would be of less impact if we try to abbreviate to len+3 and then\n> chomp the result at the right hand side to len+3 (only if the result\n> is unique) when print_sha1_ellipsis is false.  Of course, once we go\n> that path, the code structure this patch introduces (not the one I\n> mentioned in the previous paragraph) would be necessary.  Essentially\n> you would be enhancing the \"else\" clause.\n\nSorry, but you've lost me there.\n\nI'm in the process of producing v3 of the series (env var\ninstead of config, comments, indentation level), but i can't get\nmy head around the above.\n\nWould you care to elaborate (then based on v3)?\n"},{"id":"332868","messageId":"20171119184113.16630-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqq1sl17e1u.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 1/5] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T18:41:09Z","receivedAt":"2017-11-19T18:42:19Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user (actively!) sets the environment variable PRINT_SHA1_ELLIPSIS\nto \"yes\" (case does not matter).\n\nThe transient nature of this fallback suggests that we should not prefix\nthe variable by \"GIT_\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n builtin/checkout.c | 11 +++++++++--\n 1 file changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 7d8bcc383351..e6d3a28fe26e 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -400,10 +400,17 @@ static void show_local_changes(struct object *head,\n static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\tconst char *env_printsha1ellipsis = getenv(\"PRINT_SHA1_ELLIPSIS\");\n+\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (env_printsha1ellipsis && !strcasecmp(env_printsha1ellipsis, \"yes\")) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \n-- \n2.13.6\n\n"},{"id":"332869","messageId":"20171119184113.16630-3-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171119184113.16630-1-bedhanger@gmx.de","subject":"Re: [PATCH v3 3/5] Documentation: user-manual: limit usage of ellipsis","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T18:41:11Z","receivedAt":"2017-11-19T18:42:22Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Confusing the ellipsis with the three-dot operator should be made as\ndifficult as possible.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n Documentation/user-manual.txt | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 3a03e63eb0d8..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\n@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this\n \n If you run `git branch` at this point, you'll see that Git has\n temporarily moved you in \"(no branch)\". HEAD is now detached from any\n-branch and points directly to a commit (with commit id 65934...) that\n+branch and points directly to a commit (with commit id 65934) that\n is reachable from \"master\" but not from v2.6.18. Compile and test it,\n and see whether it crashes. Assume it does crash. Then:\n \n@@ -549,14 +549,14 @@ says \"bisect\".  Choose a safe-looking commit nearby, note its commit\n id, and check it out with:\n \n -------------------------------------------------\n-$ git reset --hard fb47ddb2db...\n+$ git reset --hard fb47ddb2db\n -------------------------------------------------\n \n then test, run `bisect good` or `bisect bad` as appropriate, and\n continue.\n \n Instead of `git bisect visualize` and then `git reset --hard\n-fb47ddb2db...`, you might just want to tell Git that you want to skip\n+fb47ddb2db`, you might just want to tell Git that you want to skip\n the current commit:\n \n -------------------------------------------------\n@@ -3416,7 +3416,7 @@ commit abc\n Author:\n Date:\n ...\n-:100644 100644 4b9458b... newsha... M somedirectory/myfile\n+:100644 100644 4b9458b newsha M somedirectory/myfile\n \n \n commit xyz\n@@ -3424,7 +3424,7 @@ Author:\n Date:\n \n ...\n-:100644 100644 oldsha... 4b9458b... M somedirectory/myfile\n+:100644 100644 oldsha 4b9458b M somedirectory/myfile\n ------------------------------------------------\n \n This tells you that the immediately following version of the file was\n@@ -3449,7 +3449,7 @@ and your repository is good again!\n $ git log --raw --all\n ------------------------------------------------\n \n-and just looked for the sha of the missing object (4b9458b..) in that\n+and just looked for the sha of the missing object (4b9458b) in that\n whole thing. It's up to you--Git does *have* a lot of information, it is\n just missing one particular blob version.\n \n@@ -4114,9 +4114,9 @@ program, e.g.  `diff3`, `merge`, or Git's own merge-file, on\n the blob objects from these three stages yourself, like this:\n \n ------------------------------------------------\n-$ git cat-file blob 263414f... >hello.c~1\n-$ git cat-file blob 06fa6a2... >hello.c~2\n-$ git cat-file blob cc44c73... >hello.c~3\n+$ git cat-file blob 263414f >hello.c~1\n+$ git cat-file blob 06fa6a2 >hello.c~2\n+$ git cat-file blob cc44c73 >hello.c~3\n $ git merge-file hello.c~2 hello.c~1 hello.c~3\n ------------------------------------------------\n \n@@ -4374,7 +4374,7 @@ $ git log --no-merges t/\n ------------------------\n \n In the pager (`less`), just search for \"bundle\", go a few lines back,\n-and see that it is in commit 18449ab0...  Now just copy this object name,\n+and see that it is in commit 18449ab0.  Now just copy this object name,\n and paste it into the command line\n \n -------------------\n-- \n2.13.6\n\n"},{"id":"332870","messageId":"20171119184113.16630-2-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171119184113.16630-1-bedhanger@gmx.de","subject":"Re: [PATCH v3 2/5] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T18:41:10Z","receivedAt":"2017-11-19T18:42:25Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Neither Git nor the user are in need of this (visual) aid anymore, but\nwe must offer a transition period.\n\nAlso, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n diff.c | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/diff.c b/diff.c\nindex 0763e89263ef..359c6fc85a27 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4901,15 +4901,22 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n {\n \tint abblen;\n \tconst char *abbrev;\n+\tconst char *env_printsha1ellipsis = getenv(\"PRINT_SHA1_ELLIPSIS\");\n \n+\t/* Do we want all 40 hex characters? */\n \tif (len == GIT_SHA1_HEXSZ)\n \t\treturn oid_to_hex(oid);\n \n+\t/* An abbreviated value is fine, possibly followed by an ellipsis. */\n \tabbrev = diff_abbrev_oid(oid, len);\n+\n+\tif (!(env_printsha1ellipsis && !strcasecmp(env_printsha1ellipsis, \"yes\")))\n+\t\treturn abbrev;\n+\n \tabblen = strlen(abbrev);\n \n \t/*\n-\t * In well-behaved cases, where the abbbreviated result is the\n+\t * In well-behaved cases, where the abbreviated result is the\n \t * same as the requested length, append three dots after the\n \t * abbreviation (hence the whole logic is limited to the case\n \t * where abblen < 37); when the actual abbreviated result is a\n-- \n2.13.6\n\n"},{"id":"332871","messageId":"20171119184113.16630-5-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171119184113.16630-1-bedhanger@gmx.de","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T18:41:13Z","receivedAt":"2017-11-19T18:42:28Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Where needed[*1*], we arrange for the environment of a Git invocation to\ncontain the variable\n\n   PRINT_SHA1_ELLIPSIS=\"yes\"\n\nThis furnishes ellipses in the output which then matches what is\nexpected.\n\n[Footnote]\n\n*1* We are being overly generous in t4013-diff-various.sh because we do\nnot want to destroy/take apart the here-document.  Given that all this a\ntemporary measure, we should get away with it.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n t/t3040-subprojects-basic.sh | 2 +-\n t/t4013-diff-various.sh      | 6 +++++-\n t/t9300-fast-import.sh       | 2 +-\n 3 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh\nindex 0a4ff6d824a0..dfd46a5672da 100755\n--- a/t/t3040-subprojects-basic.sh\n+++ b/t/t3040-subprojects-basic.sh\n@@ -19,7 +19,7 @@ test_expect_success 'setup: create subprojects' '\n \tgit update-index --add sub1 &&\n \tgit add sub2 &&\n \tgit commit -q -m \"subprojects added\" &&\n-\tgit diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n+\tPRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n \tgit branch save HEAD &&\n \tcat >expected <<-\\EOF &&\n \t:000000 160000 00000... A\tsub1\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex c515e3e53fee..79f213dddd92 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -131,7 +131,11 @@ do\n \ttest_expect_success \"git $cmd\" '\n \t\t{\n \t\t\techo \"\\$ git $cmd\"\n-\t\t\tgit $cmd |\n+\t\t\t# All invocations receive the env var.\n+\t\t\t# We would destroy the here-doc if we\n+\t\t\t# tried to apply it to only the ones\n+\t\t\t# truly needing it.\n+\t\t\tPRINT_SHA1_ELLIPSIS=\"yes\" git $cmd |\n \t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n \t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n \t\t\techo \"\\$\"\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex d47560b6343d..d93ddd91093e 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -876,7 +876,7 @@ test_expect_success 'L: verify internal tree sorting' '\n \tEXPECT_END\n \n \tgit fast-import <input &&\n-\tgit diff-tree --abbrev --raw L^ L >output &&\n+\tPRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev --raw L^ L >output &&\n \ttest_cmp expect output\n '\n \n-- \n2.13.6\n\n"},{"id":"332872","messageId":"20171119184113.16630-4-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171119184113.16630-1-bedhanger@gmx.de","subject":"Re: [PATCH v3 4/5] Documentation: revisions: fix typo: \"three dot\" ---> \"three-dot\" (in line with \"two-dot\").","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-19T18:41:12Z","receivedAt":"2017-11-19T18:42:32Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n Documentation/revisions.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 61277469c874..dfcc49c72c0f 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n  for commits that are reachable from r2 excluding those that are reachable\n  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n \n-The '...' (three dot) Symmetric Difference Notation::\n+The '...' (three-dot) Symmetric Difference Notation::\n  A similar notation 'r1\\...r2' is called symmetric difference\n  of 'r1' and 'r2' and is defined as\n  'r1 r2 --not $(git merge-base --all r1 r2)'.\n-- \n2.13.6\n\n"},{"id":"332875","messageId":"CAPig+cT-r0uLLv_GyTRddPe=ATX883S1jt-8gc=ANZW21S81Mg@mail.gmail.com","threadId":"47122","inReplyTo":"20171119184113.16630-2-bedhanger@gmx.de","subject":"Re: [PATCH v3 2/5] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2017-11-19T19:11:32Z","receivedAt":"2017-11-19T19:11:40Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Nov 19, 2017 at 1:41 PM, Ann T Ropea <bedhanger@gmx.de> wrote:\n> Neither Git nor the user are in need of this (visual) aid anymore, but\n> we must offer a transition period.\n>\n> Also, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n> diff --git a/diff.c b/diff.c\n> @@ -4901,15 +4901,22 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n>  {\n>         int abblen;\n>         const char *abbrev;\n> +       const char *env_printsha1ellipsis = getenv(\"PRINT_SHA1_ELLIPSIS\");\n\nCan you move the getenv() call down to the point where the result is\nactually used so we don't have to worry about its value going stale[1]\nby some intervening call to getenv(), setenv(), unsetenv() or\nputenv()? Alternately, move the check against \"yes\" up here and assign\nit to a boolean (int) which you consult later.\n\nDitto for the other patches. Thanks.\n\n[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html\n\n> +       /* Do we want all 40 hex characters? */\n>         if (len == GIT_SHA1_HEXSZ)\n>                 return oid_to_hex(oid);\n>\n> +       /* An abbreviated value is fine, possibly followed by an ellipsis. */\n>         abbrev = diff_abbrev_oid(oid, len);\n> +\n> +       if (!(env_printsha1ellipsis && !strcasecmp(env_printsha1ellipsis, \"yes\")))\n> +               return abbrev;\n> +\n>         abblen = strlen(abbrev);\n"},{"id":"332876","messageId":"CAPig+cT4MvjLDvFEB6hJOSip=dqkp10ydnpfnoUabK=53OmQkw@mail.gmail.com","threadId":"47122","inReplyTo":"20171119184113.16630-3-bedhanger@gmx.de","subject":"Re: [PATCH v3 3/5] Documentation: user-manual: limit usage of ellipsis","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2017-11-19T19:15:57Z","receivedAt":"2017-11-19T19:16:03Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Nov 19, 2017 at 1:41 PM, Ann T Ropea <bedhanger@gmx.de> wrote:\n> Confusing the ellipsis with the three-dot operator should be made as\n> difficult as possible.\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n> v2: rename patch series & focus on removal of ellipses\n> v3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n\nI dont' see the  new PRINT_SHA1_ELLIPSIS environment variable\ndocumented anywhere in this series. Did I overlook it? Without\ndocumentation, it's not very discoverable (aside from reading the\nsource code).\n"},{"id":"332888","messageId":"xmqqtvxpn2jk.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171119173838.8820-1-bedhanger@gmx.de","subject":"Re: [PATCH v2 3/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-20T01:48:15Z","receivedAt":"2017-11-20T01:48:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n>> Notice the name of the function.  We no longer even attempt to align\n>> the output, and in general the output column length of each line\n>> would be shorter than the original.  I am wondering if the change\n>> would be of less impact if we try to abbreviate to len+3 and then\n>> chomp the result at the right hand side to len+3 (only if the result\n>> is unique) when print_sha1_ellipsis is false.  Of course, once we go\n>> that path, the code structure this patch introduces (not the one I\n>> mentioned in the previous paragraph) would be necessary.  Essentially\n>> you would be enhancing the \"else\" clause.\n>\n> Sorry, but you've lost me there.\n\nAfter diff_aligned_abbrev(const struct object_id *oid, int len)\nreturns the full-size result when asked, it does this:\n\n\tabbrev = diff_abbrev_oid(oid, len);\n\tabblen = strlen(abbrev);\n\n\tif (abblen < GIT_SHA1_HEXSZ - 3) {\n\t\tstatic char hex[GIT_MAX_HEXSZ + 1];\n\t\tif (len < abblen && abblen <= len + 2)\n\t\t\txsnprintf(hex, sizeof(hex), \"%s%.*s\", abbrev, len+3-abblen, \"..\");\n\t\telse\n\t\t\txsnprintf(hex, sizeof(hex), \"%s...\", abbrev);\n\t\treturn hex;\n\t}\n\nWhen asked to abbreviate to 4, which is shorter than 40-3=37, and\nthe unique abbreviation results in \"dead\" (iow, no other object that\nshares that prefix), then len=4, abblen=4, so we get \"dead...\" as\nthe output.  If the unique abbreviation is \"deadb\" (iow, some other\nobject shares \"dead\" prefix and we require one more hexdigit for\nuniqueness), len=4, abblen=5, and abblen <= len + 2, so we get\n\"deadb..\" as the output.  Either codepath yields 7 hexdigits, and\nthis is because the function wants to help the user of its output\nto produce lines that are as aligned as possible.\n\nOf course, the leeway we have ... that can be reduced is small and\nlimited.  For a len that is too small in a repository with many\nobjects that share the same prefix, we cannot fit the result in 7\n(i.e. len+3) columns and may have to return a longer result.\n\nBut the point is that the existing callers that ask for len=7 are\nexpecting output that is \"7+3=10 output columns most of the time,\neven though it might yield a string longer than 10 output columns\nwhen the object names cannot be uniquely shown with that output\nwidth\".  \n\nAnd that was why I was wondering if it gives less negative impact to\ncallers if we abbreviate to (len+3) hexdigits and return the result.\n\nNote that this was not (and is not) \"I think yours is wrong\nbecause...\" but was (and is) \"I am wondering if doing it differently\nis better because...\".  Asking for 7 and getting 10 feels strange\nand that is one valid reason to \"correct\" the existing behaviour by\nabbreviating to len and just dropping the padding with dots, and it\nmay be worth a bit of surprise to existing users.  I dunno, and that\nis why it was \"I wonder...\".\n\n\n\n"},{"id":"332892","messageId":"xmqqa7zhmxld.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171119184113.16630-1-bedhanger@gmx.de","subject":"Re: [PATCH v3 1/5] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-20T03:35:10Z","receivedAt":"2017-11-20T03:35:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> We do not want an ellipsis displayed following an (abbreviated) SHA-1\n> value.\n>\n> The days when this was necessary to indicate the truncation to\n> lower-level Git commands and/or the user are bygone.\n>\n> However, to ease the transition, the ellipsis will still be printed if\n> the user (actively!) sets the environment variable PRINT_SHA1_ELLIPSIS\n> to \"yes\" (case does not matter).\n\nDoes \"(actively!)\" add any value here?  For that matter, it appears\nto me that \"(case does not matter)\" does not, either.  I thought\nyou'd be also reacting to Print_SHA1_Ellipsis variable, too, but the\ncode does not seem to be doing so (for obvious reasons).  If the users\ncan get what they want by setting it to \"yes\", that is sufficient to\nsay, whether your implementation accepts \"Yes\" as a synonym or not,\nespecially for something like this that we would want to remove in\nan year or two.\n\n> The transient nature of this fallback suggests that we should not prefix\n> the variable by \"GIT_\".\n\nHmph.  That nature does not suggest anything like it to me.  When I\nfind an unfamiliar environment variable in my ~/.login I defined or\nadded to an existing script a few years back and forgot what it was\nfor, with a GIT_ prefix I would have one extra clue to help me\nrecall that it was once needed but no longer supported one that I\ncan safely remove.\n\nI do agree that moving to an environment variable is a more useful\nescape hatch for existing scripts that could be broken with this\nchange.\n\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index 7d8bcc383351..e6d3a28fe26e 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -400,10 +400,17 @@ static void show_local_changes(struct object *head,\n>  static void describe_detached_head(const char *msg, struct commit *commit)\n>  {\n>  \tstruct strbuf sb = STRBUF_INIT;\n> +\tconst char *env_printsha1ellipsis = getenv(\"PRINT_SHA1_ELLIPSIS\");\n> +\n>  \tif (!parse_commit(commit))\n>  \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n> -\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n> -\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n> +\tif (env_printsha1ellipsis && !strcasecmp(env_printsha1ellipsis, \"yes\")) {\n> +\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n> +\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n> +\t} else {\n> +\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n> +\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n> +\t}\n>  \tstrbuf_release(&sb);\n>  }\n\nI would actually have expected a helper function like\n\nint print_sha1_ellipsis(void)\n{\n        static int cached_result = -1; /* unknown */\n\n\tif (cached_result < 0) {\n\t\tconst char *v = getenv(\"PRINT_SHA1_ELLIPSIS\");\n                cached_result = (v && !strcasecmp(v, \"yes\"));\n\t}\n\treturn cached_result;\n}\n\nso that you can reuse that in here and in quite a different place\nlike in diff.c.\n\n"},{"id":"332893","messageId":"xmqqzi7hlhkx.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171119184113.16630-5-bedhanger@gmx.de","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-20T04:06:22Z","receivedAt":"2017-11-20T04:06:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> *1* We are being overly generous in t4013-diff-various.sh because we do\n> not want to destroy/take apart the here-document.  Given that all this a\n> temporary measure, we should get away with it.\n\nI do not think the patch is being particularly generous.  If\nanything, it is being unnecessarily sloppy by not adding new checks\nto verify the updated behaviour.\n\nThe above comment mentions \"destroy/take apart\" the here-document,\nbut I do see no need to destroy anything.  All you need to do is to\nenhance and extend.  For example, you could do it like so (this is\nwritten in my e-mail client, and not an output of diff, so the\nindentation etc. may be all off, but should be sufficient to\nillustrate the idea):\n\n    while read cmd\n    do\n            case \"$cmd\" in\n            '' | '#'*) continue ;;\n            esac\n            test=$(echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g')\n            pfx=$(printf \"%04d\" $test_count)\n            expect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n            actual=\"$pfx-diff.$test\"\n   +        case \"$cmd\" in\n   +        X*) cmd=${cmd#X}; no_ellipses=\" (no ellipses)\" ;;\n   +        *) no_ellipses= ;;\n   +        esac\n   -        test_expect_success \"git $cmd\" '\n   +        test_expect_success \"git $cmd$no_ellipses\" '\n                {\n                        echo \"\\$ git $cmd\"\n   -                    git $cmd |\n   +                    if test -n \"$no_ellipses\"\n   +                    then\n   +                            git $cmd\n   +                    else\n   +                            PRINT_SHA1_ELLIPSES=yes git $cmd\n   +                    fi |\n                        sed -e ....\n        ...\n    done <<\\EOF\n    diff-tree initial\n    diff-tree -r initial\n    diff-tree -r --abbrev initial\n    diff-tree -r --abbrev=4 initial\n   +Xdiff-tree -r --abbrev=4 initial\n    ...\n    EOF\n\nThere is a new and duplicated line with a prefix X for one existing\ntest in the above.  The idea is that the ones marked as such will\ntest and verify the effect of this new behaviour by not setting the\nenvironment variable.  The expected and actual test output for the\nnew test will have X prefixed to it.  t4013 is arranged in such a\nway that it is easy to add a new test like this---you only need to\nadd an expected output in a new file in t/t4013/. directory.  And\nthe output with these ellipses removed will be something we would\nexpect see in the new world (without the escape hatch environment\nvariable), we would need to add a new file there to record what the\nexpected output from the command is.\n\nI singled out the diff-tree invocation with --abbrev=4 as an example\nin the above, but in a more thorough final version, we'd need to\ncover both \"abbreviation with ellipses\" and \"abbreviation without\nellipses\" output for other lines in the test case listed in the\nhere-document.\n"},{"id":"332920","messageId":"5AE7AD53CF184A27BF8F484D415083D9@PhilipOakley","threadId":"47122","inReplyTo":"xmqqzi7hlhkx.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-20T17:26:51Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\n> Ann T Ropea <bedhanger@gmx.de> writes:\n>\n>> *1* We are being overly generous in t4013-diff-various.sh because we do\n>> not want to destroy/take apart the here-document.  Given that all this a\n>> temporary measure, we should get away with it.\n\nSo, the need to reformat the test for the future post-deprecation period is \nbeing deferred to the time that the PRINT_SHA1_ELLIPSIS env variable, and \nall ellipis, is removed - is that the case? Maybe it just needs saying \nplainly.\n\nOr is the env variable being retained as a fallback 'forever'? I'm half \nguessing that it may tend toward the latter as it's an easier backward \ncompatibility decision.\n\n[apologioes this is mid thread, I'm catching up on 2 weeks of emails]\n\n>\n> I do not think the patch is being particularly generous.  If\n> anything, it is being unnecessarily sloppy by not adding new checks\n> to verify the updated behaviour.\n>\n> The above comment mentions \"destroy/take apart\" the here-document,\n> but I do see no need to destroy anything.  All you need to do is to\n> enhance and extend.  For example, you could do it like so (this is\n> written in my e-mail client, and not an output of diff, so the\n> indentation etc. may be all off, but should be sufficient to\n> illustrate the idea):\n>\n>    while read cmd\n>    do\n>            case \"$cmd\" in\n>            '' | '#'*) continue ;;\n>            esac\n>            test=$(echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g')\n>            pfx=$(printf \"%04d\" $test_count)\n>            expect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n>            actual=\"$pfx-diff.$test\"\n>   +        case \"$cmd\" in\n>   +        X*) cmd=${cmd#X}; no_ellipses=\" (no ellipses)\" ;;\n>   +        *) no_ellipses= ;;\n>   +        esac\n>   -        test_expect_success \"git $cmd\" '\n>   +        test_expect_success \"git $cmd$no_ellipses\" '\n>                {\n>                        echo \"\\$ git $cmd\"\n>   -                    git $cmd |\n>   +                    if test -n \"$no_ellipses\"\n>   +                    then\n>   +                            git $cmd\n>   +                    else\n>   +                            PRINT_SHA1_ELLIPSES=yes git $cmd\n>   +                    fi |\n>                        sed -e ....\n>        ...\n>    done <<\\EOF\n>    diff-tree initial\n>    diff-tree -r initial\n>    diff-tree -r --abbrev initial\n>    diff-tree -r --abbrev=4 initial\n>   +Xdiff-tree -r --abbrev=4 initial\n>    ...\n>    EOF\n>\n> There is a new and duplicated line with a prefix X for one existing\n> test in the above.  The idea is that the ones marked as such will\n> test and verify the effect of this new behaviour by not setting the\n> environment variable.  The expected and actual test output for the\n> new test will have X prefixed to it.  t4013 is arranged in such a\n> way that it is easy to add a new test like this---you only need to\n> add an expected output in a new file in t/t4013/. directory.  And\n> the output with these ellipses removed will be something we would\n> expect see in the new world (without the escape hatch environment\n> variable), we would need to add a new file there to record what the\n> expected output from the command is.\n>\n> I singled out the diff-tree invocation with --abbrev=4 as an example\n> in the above, but in a more thorough final version, we'd need to\n> cover both \"abbreviation with ellipses\" and \"abbreviation without\n> ellipses\" output for other lines in the test case listed in the\n> here-document. \n\n"},{"id":"333248","messageId":"xmqqo9nuuadm.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"5AE7AD53CF184A27BF8F484D415083D9@PhilipOakley","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-22T05:53:57Z","receivedAt":"2017-11-22T05:54:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n> From: \"Junio C Hamano\" <gitster@pobox.com>\n>> Ann T Ropea <bedhanger@gmx.de> writes:\n>>\n>>> *1* We are being overly generous in t4013-diff-various.sh because we do\n>>> not want to destroy/take apart the here-document.  Given that all this a\n>>> temporary measure, we should get away with it.\n>\n> So, the need to reformat the test for the future post-deprecation\n> period is being deferred to the time that the PRINT_SHA1_ELLIPSIS env\n> variable, and all ellipis, is removed - is that the case? Maybe it\n> just needs saying plainly.\n\nAnd if we say it that way, it is clear that with this series, we are\nshipping a new feature with a test that does not protect the output\nformat we claim to be the improved and preferred one.  That sounds\nquite bad.\n\nHaving said that, I have already queued this to 'pu' and I do not\nterribly mind to merge it down to 'next', leaving the test updates\nto cover the new output format as well as the backward compatible\none at the same time for a later follow-up patch.  \n\nI'd however hate it if I have to carry the topic in the current\nshape in 'next' forever, waiting for such an update to come, that\nmay never materialize, and be forced to do it myself without being\nexplicitly asked by (and thanked for) anybody, especially because\nthis is not exactly my itch X-<.\n\n> Or is the env variable being retained as a fallback 'forever'? I'm\n> half guessing that it may tend toward the latter as it's an easier\n> backward compatibility decision.\n\nWe do not know until this change is released to the wild, at which\ntime we will hear noises about the lack of expected ellipses their\n(poorly written) scripts rely on and tell them to set the workaround\nenvironment variable.  We may not hear from such people at all, in\nwhich case we may be able to remove it within a year or so, but it\nis too early to tell.\n"},{"id":"333352","messageId":"FDCFD8EC7A754412A6369F03E91926C5@PhilipOakley","threadId":"47122","inReplyTo":"xmqqo9nuuadm.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2017-11-22T23:41:42Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\n> \"Philip Oakley\" <philipoakley@iee.org> writes:\n>\n>> From: \"Junio C Hamano\" <gitster@pobox.com>\n>>> Ann T Ropea <bedhanger@gmx.de> writes:\n>>>\n>>>> *1* We are being overly generous in t4013-diff-various.sh because we do\n>>>> not want to destroy/take apart the here-document.  Given that all this \n>>>> a\n>>>> temporary measure, we should get away with it.\n>>\n>> So, the need to reformat the test for the future post-deprecation\n>> period is being deferred to the time that the PRINT_SHA1_ELLIPSIS env\n>> variable, and all ellipis, is removed - is that the case? Maybe it\n>> just needs saying plainly.\n>\n> And if we say it that way, it is clear that with this series, we are\n> shipping a new feature with a test that does not protect the output\n> format we claim to be the improved and preferred one.  That sounds\n> quite bad.\n>\n> Having said that, I have already queued this to 'pu' and I do not\n> terribly mind to merge it down to 'next', leaving the test updates\n> to cover the new output format as well as the backward compatible\n> one at the same time for a later follow-up patch.\n\nI'd agree. I just wanted to ensure that I had the right understanding.\n>\n> I'd however hate it if I have to carry the topic in the current\n> shape in 'next' forever, waiting for such an update to come, that\n> may never materialize, and be forced to do it myself without being\n> explicitly asked by (and thanked for) anybody, especially because\n> this is not exactly my itch X-<.\n\nTrue.\n>\n>> Or is the env variable being retained as a fallback 'forever'? I'm\n>> half guessing that it may tend toward the latter as it's an easier\n>> backward compatibility decision.\n>\n> We do not know until this change is released to the wild, at which\n> time we will hear noises about the lack of expected ellipses their\n> (poorly written) scripts rely on and tell them to set the workaround\n> environment variable.  We may not hear from such people at all, in\n> which case we may be able to remove it within a year or so, but it\n> is too early to tell.\n\nI was wondering if there should be a small documentation change for the env \nvariable and states that it is a temporary measure for short term \ncompatibility. Though I'm not sure where the 'right' place would be for it.\n\n\n"},{"id":"333401","messageId":"xmqqd148qzko.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"FDCFD8EC7A754412A6369F03E91926C5@PhilipOakley","subject":"Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-24T00:40:07Z","receivedAt":"2017-11-24T00:40:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n>> We do not know until this change is released to the wild, at which\n>> time we will hear noises about the lack of expected ellipses their\n>> (poorly written) scripts rely on and tell them to set the workaround\n>> environment variable.  We may not hear from such people at all, in\n>> which case we may be able to remove it within a year or so, but it\n>> is too early to tell.\n>\n> I was wondering if there should be a small documentation change for\n> the env variable and states that it is a temporary measure for short\n> term compatibility. Though I'm not sure where the 'right' place would\n> be for it.\n\nWe list environment variables that applies git-wide in git(1), I\nthink.  If this is going to be only applicable for the \"diff\"\nfamily, Documentation/diff-format.txt may be a better place, and\nin that case the name of the environment variable may need to\ninclude a word DIFF somewhere.\n\n\n"},{"id":"333460","messageId":"20171124235330.15157-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqqo9nuuadm.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v4 1/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:25Z","receivedAt":"2017-11-24T23:54:56Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Neither Git nor the user are in need of this (visual) aid anymore, but\nwe must offer a transition period.\n\nAlso, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n diff.c | 23 ++++++++++++++++++++++-\n diff.h |  6 ++++++\n 2 files changed, 28 insertions(+), 1 deletion(-)\n\ndiff --git a/diff.c b/diff.c\nindex 0763e89263ef..8395623acdb1 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4902,14 +4902,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n \tint abblen;\n \tconst char *abbrev;\n \n+\t/* Do we want all 40 hex characters? */\n \tif (len == GIT_SHA1_HEXSZ)\n \t\treturn oid_to_hex(oid);\n \n+\t/* An abbreviated value is fine, possibly followed by an ellipsis. */\n \tabbrev = diff_abbrev_oid(oid, len);\n+\n+\tif (!print_sha1_ellipsis())\n+\t\treturn abbrev;\n+\n \tabblen = strlen(abbrev);\n \n \t/*\n-\t * In well-behaved cases, where the abbbreviated result is the\n+\t * In well-behaved cases, where the abbreviated result is the\n \t * same as the requested length, append three dots after the\n \t * abbreviation (hence the whole logic is limited to the case\n \t * where abblen < 37); when the actual abbreviated result is a\n@@ -6067,3 +6073,18 @@ void setup_diff_pager(struct diff_options *opt)\n \t    check_pager_config(\"diff\") != 0)\n \t\tsetup_pager();\n }\n+\n+int print_sha1_ellipsis(void)\n+{\n+\t/*\n+\t * Determine if the calling environment contains the variable\n+\t * GIT_PRINT_SHA1_ELLIPSIS set to \"yes\".\n+\t */\n+\tstatic int cached_result = -1; /* unknown */\n+\n+\tif (cached_result < 0) {\n+\t\tconst char *v = getenv(\"GIT_PRINT_SHA1_ELLIPSIS\");\n+\t\tcached_result = (v && !strcasecmp(v, \"yes\"));\n+\t}\n+\treturn cached_result;\n+}\ndiff --git a/diff.h b/diff.h\nindex 0fb18dd735b5..a98c9e1cc367 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -438,4 +438,10 @@ extern void print_stat_summary(FILE *fp, int files,\n \t\t\t       int insertions, int deletions);\n extern void setup_diff_pager(struct diff_options *);\n \n+/*\n+ * Should we print an ellipsis after an abbreviated SHA-1 value\n+ * when doing diff-raw output or indicating a detached HEAD?\n+ */\n+extern int print_sha1_ellipsis(void);\n+\n #endif /* DIFF_H */\n-- \n2.13.6\n\n"},{"id":"333461","messageId":"20171124235330.15157-2-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 2/6] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:26Z","receivedAt":"2017-11-24T23:55:04Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user sets the environment variable GIT_PRINT_SHA1_ELLIPSIS to \"yes\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n builtin/checkout.c | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 7d8bcc383351..d260fb925cac 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -400,10 +400,16 @@ static void show_local_changes(struct object *head,\n static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (print_sha1_ellipsis()) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \n-- \n2.13.6\n\n"},{"id":"333462","messageId":"20171124235330.15157-4-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 4/6] Documentation: revisions: fix typo: \"three dot\" ---> \"three-dot\" (in line with \"two-dot\").","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:28Z","receivedAt":"2017-11-24T23:55:06Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n Documentation/revisions.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 61277469c874..dfcc49c72c0f 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n  for commits that are reachable from r2 excluding those that are reachable\n  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n \n-The '...' (three dot) Symmetric Difference Notation::\n+The '...' (three-dot) Symmetric Difference Notation::\n  A similar notation 'r1\\...r2' is called symmetric difference\n  of 'r1' and 'r2' and is defined as\n  'r1 r2 --not $(git merge-base --all r1 r2)'.\n-- \n2.13.6\n\n"},{"id":"333463","messageId":"20171124235330.15157-6-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 6/6] Testing: provide existing tests requiring them with ellipses after SHA-1 values","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:30Z","receivedAt":"2017-11-24T23:55:09Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"At the moment, this patch's concern is to not break existing tests.\n\nA follow-up patch (series) will rectify the situation by covering the\nnew output format as well as the backward compatible one.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n t/t3040-subprojects-basic.sh | 2 +-\n t/t4013-diff-various.sh      | 2 +-\n t/t9300-fast-import.sh       | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh\nindex 0a4ff6d824a0..b81eb5fd6ffa 100755\n--- a/t/t3040-subprojects-basic.sh\n+++ b/t/t3040-subprojects-basic.sh\n@@ -19,7 +19,7 @@ test_expect_success 'setup: create subprojects' '\n \tgit update-index --add sub1 &&\n \tgit add sub2 &&\n \tgit commit -q -m \"subprojects added\" &&\n-\tgit diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n \tgit branch save HEAD &&\n \tcat >expected <<-\\EOF &&\n \t:000000 160000 00000... A\tsub1\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex c515e3e53fee..9bed64d53e01 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -131,7 +131,7 @@ do\n \ttest_expect_success \"git $cmd\" '\n \t\t{\n \t\t\techo \"\\$ git $cmd\"\n-\t\t\tgit $cmd |\n+\t\t\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git $cmd |\n \t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n \t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n \t\t\techo \"\\$\"\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex d47560b6343d..e4d06accc458 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -876,7 +876,7 @@ test_expect_success 'L: verify internal tree sorting' '\n \tEXPECT_END\n \n \tgit fast-import <input &&\n-\tgit diff-tree --abbrev --raw L^ L >output &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev --raw L^ L >output &&\n \ttest_cmp expect output\n '\n \n-- \n2.13.6\n\n"},{"id":"333464","messageId":"20171124235330.15157-5-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 5/6] Documentation: git: document GIT_PRINT_SHA1_ELLIPSIS","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:29Z","receivedAt":"2017-11-24T23:55:11Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n Documentation/git.txt | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 483a1f35475e..395c88c8a31f 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -731,6 +731,15 @@ corresponding standard handle, and if `GIT_REDIRECT_STDERR` is\n `2>&1`, standard error will be redirected to the same handle as\n standard output.\n \n+`GIT_PRINT_SHA1_ELLIPSIS` (deprecated)::\n+\tIf set to `yes`, print an ellipsis following an\n+\t(abbreviated) SHA-1 value.  This affects indications of\n+\tdetached HEADs (linkgit:git-checkout[1]) and the raw\n+\tdiff output (linkgit:git-diff[1]).  Printing an\n+\tellipsis in the cases mentioned is no longer considered\n+\tadequate and support for it is likely to be removed in the\n+\tforeseeable future (along with the variable).\n+\n Discussion[[Discussion]]\n ------------------------\n \n-- \n2.13.6\n\n"},{"id":"333465","messageId":"20171124235330.15157-3-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 3/6] Documentation: user-manual: limit usage of ellipsis","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-11-24T23:53:27Z","receivedAt":"2017-11-24T23:55:14Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Confusing the ellipsis with the three-dot operator should be made as\ndifficult as possible.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\n Documentation/user-manual.txt | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 3a03e63eb0d8..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\n@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this\n \n If you run `git branch` at this point, you'll see that Git has\n temporarily moved you in \"(no branch)\". HEAD is now detached from any\n-branch and points directly to a commit (with commit id 65934...) that\n+branch and points directly to a commit (with commit id 65934) that\n is reachable from \"master\" but not from v2.6.18. Compile and test it,\n and see whether it crashes. Assume it does crash. Then:\n \n@@ -549,14 +549,14 @@ says \"bisect\".  Choose a safe-looking commit nearby, note its commit\n id, and check it out with:\n \n -------------------------------------------------\n-$ git reset --hard fb47ddb2db...\n+$ git reset --hard fb47ddb2db\n -------------------------------------------------\n \n then test, run `bisect good` or `bisect bad` as appropriate, and\n continue.\n \n Instead of `git bisect visualize` and then `git reset --hard\n-fb47ddb2db...`, you might just want to tell Git that you want to skip\n+fb47ddb2db`, you might just want to tell Git that you want to skip\n the current commit:\n \n -------------------------------------------------\n@@ -3416,7 +3416,7 @@ commit abc\n Author:\n Date:\n ...\n-:100644 100644 4b9458b... newsha... M somedirectory/myfile\n+:100644 100644 4b9458b newsha M somedirectory/myfile\n \n \n commit xyz\n@@ -3424,7 +3424,7 @@ Author:\n Date:\n \n ...\n-:100644 100644 oldsha... 4b9458b... M somedirectory/myfile\n+:100644 100644 oldsha 4b9458b M somedirectory/myfile\n ------------------------------------------------\n \n This tells you that the immediately following version of the file was\n@@ -3449,7 +3449,7 @@ and your repository is good again!\n $ git log --raw --all\n ------------------------------------------------\n \n-and just looked for the sha of the missing object (4b9458b..) in that\n+and just looked for the sha of the missing object (4b9458b) in that\n whole thing. It's up to you--Git does *have* a lot of information, it is\n just missing one particular blob version.\n \n@@ -4114,9 +4114,9 @@ program, e.g.  `diff3`, `merge`, or Git's own merge-file, on\n the blob objects from these three stages yourself, like this:\n \n ------------------------------------------------\n-$ git cat-file blob 263414f... >hello.c~1\n-$ git cat-file blob 06fa6a2... >hello.c~2\n-$ git cat-file blob cc44c73... >hello.c~3\n+$ git cat-file blob 263414f >hello.c~1\n+$ git cat-file blob 06fa6a2 >hello.c~2\n+$ git cat-file blob cc44c73 >hello.c~3\n $ git merge-file hello.c~2 hello.c~1 hello.c~3\n ------------------------------------------------\n \n@@ -4374,7 +4374,7 @@ $ git log --no-merges t/\n ------------------------\n \n In the pager (`less`), just search for \"bundle\", go a few lines back,\n-and see that it is in commit 18449ab0...  Now just copy this object name,\n+and see that it is in commit 18449ab0.  Now just copy this object name,\n and paste it into the command line\n \n -------------------\n-- \n2.13.6\n\n"},{"id":"333472","messageId":"xmqq4lpjkl4g.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171124235330.15157-1-bedhanger@gmx.de","subject":"Re: [PATCH v4 1/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-25T05:01:03Z","receivedAt":"2017-11-25T05:01:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> Neither Git nor the user are in need of this (visual) aid anymore, but\n> we must offer a transition period.\n>\n> Also, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n>\n> Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n> ---\n> v2: rename patch series & focus on removal of ellipses\n> v3: env var instead of config option, use one-line comments where appropriate, preserve indent level\n> v4: improve env var handling (rename, helper func to query, docu)\n\nThanks for sticking with this topic---very much appreciated, as we\nsaw many newcomers get tired of doing repeated polishing and abandon\ntheir topic in the past.  I have to go offline now, but will comment\nlater when I come back.\n\n"},{"id":"333511","messageId":"xmqqd145k9td.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"xmqq4lpjkl4g.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v4 1/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-26T03:17:34Z","receivedAt":"2017-11-26T03:17:44Z","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> Thanks for sticking with this topic---very much appreciated, as we\n> saw many newcomers get tired of doing repeated polishing and abandon\n> their topic in the past.  I have to go offline now, but will comment\n> later when I come back.\n\nRegarding the overall structure of the series, I think 1/6 will\nbreak tests and the breakage will stay until it is fixed at the\nlast step.  Also, now print_sha1_ellipsis() is prominently not about\n\"diff\", it may want to move out of \"diff.[ch]\".\n\nSo, perhaps this may be a better structure:\n\n - 1/6: What we see in [v4 4/6] as an independent typofix.\n\n - 2/6: What we see in [v4 3/6] that is not about the output from\n        \"git checkout\" (e.g. the use of ellipsis to shorten the\n        example input the user gives, as if the user is using full\n        40-hex and we are not bothering to show everything in the\n        documentation), with \"there is no need to use full 40-hex to\n        identify the object names like the examples hint at by\n        omitting the tail part of an object name as if that has to\n        be spelled out but the example omits them only for\n        brevity. Give examples using an abbreviated object names\n        without ellipses just like how people do in real life\", or\n        something like that, as an explanation.\n\n - 3/6: Introduce a helper print_sha1_ellipsis() that pays attention\n        to GIT_PRINT_SHA1_ELLIPSIS environment, and prepares the\n        tests to unconditionally set it for the test pieces that\n        will be broken once the code stops showing the extra dots by\n        default.  What we see in [v4 5/6] may also want to be rolled\n        into this patch.\n\n        Nobody calls print_sha1_ellipsis() function yet at this\n        step.  cache.h and environment.c may be a better place for\n        the declaration and definition of the helper.\n\n\tMention that the removal of these dots is merely a plan at\n        this step and has not happened yet but soon will be in the\n        proposed log message.\n\n - 4/6: What we see in [v4 2/6], optionally with two additional\n        tests that looks at the output with and without the\n        environment variable (it is optional because the output is\n        purely for human consumption sent to the standard error\n        stream).  Parts of [v4 3/6] about the output from the \"git\n        checkout\" command also belongs to this step.\n\n - 5/6: What we see in [v4 1/6] (except for introduction of the\n        helper, which already happened in an earlier step).  Move\n        the promise of covering this new output format with a follow\n        up series to the proposed log message of this step from [v4\n        6/6].\n\n - 6/6: Realize the promise made in 5/6.\n\n\tAlternatively, just like the step 3/6 above prepares the\n        tests for \"upcoming\" feature without exercising that\n        preparation, a part of this can be split to allow annotating\n        the \"here-document\" test vectors with \"does this test expect\n        that ellipsis will be missing in the output?\" (i.e. change\n        the logic in the loop that parses \"<<EOF\") without adding\n        anything to the test vectors, and made into a separate step\n        between 4/6 and 5/6 above.  Then we can include an update to\n        the test in 5/6 that looks at the new output format without\n        the environment in 5/6, which makes it clearer what the\n        change is doing when viewing 5/6 alone.\n\n\nFor rererence, here is what I just whipped up that would come in\nbetween the steps 4/6 and 5/6 in the above outline (i.e. split from\n6/6 to be placed before 5/6 happens).\n\n-- >8 --\nSubject: [PATCH] t4013: prepare for upcoming \"diff --raw --abbrev\" format change\n\nMost of the t4013 tests go through a list of sample command lines,\nand each of them is executed and its output compared with an\nexpected one stored in t4013/ directory.  Allow these lines to begin\nwith a colon followed by magic word(s) so that test conditions can\neasily be tweaked.\n\nThe expected use that will happen in later steps of this is to run\ntests expecting the traditional output and run the same test without\nthe GIT_PRINT_SHA1_ELLIPSIS=yes environment exported for (perhaps\nsome of) them, which will have to expect different output.  Since\nall of the existing tests are meant to run with the environment,\nuse the magic word \"noellipses\" to cause the variable not to be set\nand exported.\n\nAs this step does not add any new test with the magic word, all\ntests still run with the environment variable, expecting the\ntraditional output, but it will change soon.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t4013-diff-various.sh | 29 +++++++++++++++++++++++------\n 1 file changed, 23 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 9bed64d53e..7288b54045 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -118,20 +118,37 @@ test_expect_success setup '\n EOF\n \n V=$(git version | sed -e 's/^git version //' -e 's/\\./\\\\./g')\n-while read cmd\n+while read magic cmd\n do\n-\tcase \"$cmd\" in\n-\t'' | '#'*) continue ;;\n+\tcase \"$magic\" in\n+\t'' | '#'*)\n+\t\tcontinue ;;\n+\t:*)\n+\t\tmagic=${magic#:}\n+\t\tlabel=\"$magic-$cmd\"\n+\t\tcase \"$magic\" in\n+\t\tnoellipses) ;;\n+\t\t*)\n+\t\t\tdie \"bug in t4103: unknown magic $magic\" ;;\n+\t\tesac ;;\n+\t*)\n+\t\tcmd=\"$magic $cmd\" magic=\n+\t\tlabel=\"$cmd\" ;;\n \tesac\n-\ttest=$(echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g')\n+\ttest=$(echo \"$label\" | sed -e 's|[/ ][/ ]*|_|g')\n \tpfx=$(printf \"%04d\" $test_count)\n \texpect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n \tactual=\"$pfx-diff.$test\"\n \n \ttest_expect_success \"git $cmd\" '\n \t\t{\n-\t\t\techo \"\\$ git $cmd\"\n-\t\t\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git $cmd |\n+\t\t\techo \"$ git $cmd\"\n+\t\t\tcase \"$magic\" in\n+\t\t\t\"\")\n+\t\t\t\tGIT_PRINT_SHA1_ELLIPSIS=yes git $cmd ;;\n+\t\t\tnoellipses)\n+\t\t\t\tgit $cmd ;;\n+\t\t\tesac |\n \t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n \t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n \t\t\techo \"\\$\"\n-- \n2.15.0-479-ge11ee266c9\n\n"},{"id":"333512","messageId":"xmqq609xk9pl.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"xmqqd145k9td.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v4 1/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-26T03:19:50Z","receivedAt":"2017-11-26T03:19:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"... and this is a sample of the \"remainder\" of 6/6 outlined in the\nprevious message, to become part of 5/6 to show how the new output\nwould look like in a test form.\n\n t/t4013-diff-various.sh                                        | 1 +\n t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial | 6 ++++++\n 2 files changed, 7 insertions(+)\n create mode 100644 t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 7288b54045..8b5474a087 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -178,6 +178,7 @@ diff-tree --root --abbrev initial\n diff-tree --root -r initial\n diff-tree --root -r --abbrev initial\n diff-tree --root -r --abbrev=4 initial\n+:noellipses diff-tree --root -r --abbrev=4 initial\n diff-tree -p initial\n diff-tree --root -p initial\n diff-tree --patch-with-stat initial\ndiff --git a/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\nnew file mode 100644\nindex 0000000000..26fbfeb177\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\n@@ -0,0 +1,6 @@\n+$ git diff-tree --root -r --abbrev=4 initial\n+444ac553ac7612cc88969031b02b3767fb8a353a\n+:000000 100644 0000 35d2 A\tdir/sub\n+:000000 100644 0000 01e7 A\tfile0\n+:000000 100644 0000 01e7 A\tfile2\n+$\n-- \n2.15.0-479-ge11ee266c9\n\n"},{"id":"333513","messageId":"xmqq1sklk9gy.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"xmqqd145k9td.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v4 1/6] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-26T03:25:01Z","receivedAt":"2017-11-26T03:25:09Z","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>  - 5/6: What we see in [v4 1/6] (except for introduction of the\n>         helper, which already happened in an earlier step).  Move\n>         the promise of covering this new output format with a follow\n>         up series to the proposed log message of this step from [v4\n>         6/6].\n>\n>  - 6/6: Realize the promise made in 5/6.\n> ...\n> For rererence, here is what I just whipped up that would come in\n> between the steps 4/6 and 5/6 in the above outline (i.e. split from\n> 6/6 to be placed before 5/6 happens).\n\nJust to be sure, I wrote this on top of [v4 1-6/6], so you'd see\nthat its preimage already knows about GIT_PRINT_SHA1_ELLIPSIS=yes.\nIn a real reroll of the series that follow the above reorganized\nstructure, of course that would not appear as \"-\" line in the patch\n;-)\n\nThanks.\n"},{"id":"334006","messageId":"20171203212743.10228-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqqd145k9td.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v5 1/7] Documentation: revisions: fix typo: \"three dot\" ---> \"three-dot\" (in line with \"two-dot\").","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:37Z","receivedAt":"2017-12-03T21:29:03Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Signed-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n Documentation/revisions.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 61277469c874..dfcc49c72c0f 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::\n  for commits that are reachable from r2 excluding those that are reachable\n  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.\n \n-The '...' (three dot) Symmetric Difference Notation::\n+The '...' (three-dot) Symmetric Difference Notation::\n  A similar notation 'r1\\...r2' is called symmetric difference\n  of 'r1' and 'r2' and is defined as\n  'r1 r2 --not $(git merge-base --all r1 r2)'.\n-- \n2.13.6\n\n"},{"id":"334007","messageId":"20171203212743.10228-2-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 2/7] Documentation: user-manual: limit usage of ellipsis","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:38Z","receivedAt":"2017-12-03T21:29:08Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"There is no need to use full 40-hex to identify the object names like\nthe examples hint at by omitting the tail part of an object name as if\nthat has to be spelled out but the example omits them only for brevity.\nGive examples using abbreviated object names without ellipses just like\nhow people do in real life.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n Documentation/user-manual.txt | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 3a03e63eb0d8..497e82e88dd0 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this\n \n If you run `git branch` at this point, you'll see that Git has\n temporarily moved you in \"(no branch)\". HEAD is now detached from any\n-branch and points directly to a commit (with commit id 65934...) that\n+branch and points directly to a commit (with commit id 65934) that\n is reachable from \"master\" but not from v2.6.18. Compile and test it,\n and see whether it crashes. Assume it does crash. Then:\n \n@@ -549,14 +549,14 @@ says \"bisect\".  Choose a safe-looking commit nearby, note its commit\n id, and check it out with:\n \n -------------------------------------------------\n-$ git reset --hard fb47ddb2db...\n+$ git reset --hard fb47ddb2db\n -------------------------------------------------\n \n then test, run `bisect good` or `bisect bad` as appropriate, and\n continue.\n \n Instead of `git bisect visualize` and then `git reset --hard\n-fb47ddb2db...`, you might just want to tell Git that you want to skip\n+fb47ddb2db`, you might just want to tell Git that you want to skip\n the current commit:\n \n -------------------------------------------------\n@@ -3416,7 +3416,7 @@ commit abc\n Author:\n Date:\n ...\n-:100644 100644 4b9458b... newsha... M somedirectory/myfile\n+:100644 100644 4b9458b newsha M somedirectory/myfile\n \n \n commit xyz\n@@ -3424,7 +3424,7 @@ Author:\n Date:\n \n ...\n-:100644 100644 oldsha... 4b9458b... M somedirectory/myfile\n+:100644 100644 oldsha 4b9458b M somedirectory/myfile\n ------------------------------------------------\n \n This tells you that the immediately following version of the file was\n@@ -3449,7 +3449,7 @@ and your repository is good again!\n $ git log --raw --all\n ------------------------------------------------\n \n-and just looked for the sha of the missing object (4b9458b..) in that\n+and just looked for the sha of the missing object (4b9458b) in that\n whole thing. It's up to you--Git does *have* a lot of information, it is\n just missing one particular blob version.\n \n@@ -4114,9 +4114,9 @@ program, e.g.  `diff3`, `merge`, or Git's own merge-file, on\n the blob objects from these three stages yourself, like this:\n \n ------------------------------------------------\n-$ git cat-file blob 263414f... >hello.c~1\n-$ git cat-file blob 06fa6a2... >hello.c~2\n-$ git cat-file blob cc44c73... >hello.c~3\n+$ git cat-file blob 263414f >hello.c~1\n+$ git cat-file blob 06fa6a2 >hello.c~2\n+$ git cat-file blob cc44c73 >hello.c~3\n $ git merge-file hello.c~2 hello.c~1 hello.c~3\n ------------------------------------------------\n \n@@ -4374,7 +4374,7 @@ $ git log --no-merges t/\n ------------------------\n \n In the pager (`less`), just search for \"bundle\", go a few lines back,\n-and see that it is in commit 18449ab0...  Now just copy this object name,\n+and see that it is in commit 18449ab0.  Now just copy this object name,\n and paste it into the command line\n \n -------------------\n-- \n2.13.6\n\n"},{"id":"334008","messageId":"20171203212743.10228-3-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 3/7] print_sha1_ellipsis: introduce helper","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:39Z","receivedAt":"2017-12-03T21:29:13Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Introduce a helper print_sha1_ellipsis() that pays attention to the\nGIT_PRINT_SHA1_ELLIPSIS environment variable, and prepare the tests to\nunconditionally set it for the test pieces that will be broken once the code\nstops showing the extra dots by default.\n\nThe removal of these dots is merely a plan at this step and has not happened\nyet but soon will.\n\nDocument GIT_PRINT_SHA1_ELLIPSIS.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n Documentation/git.txt        |  9 +++++++++\n cache.h                      |  6 ++++++\n environment.c                | 15 +++++++++++++++\n t/t3040-subprojects-basic.sh |  2 +-\n t/t4013-diff-various.sh      |  2 +-\n t/t9300-fast-import.sh       |  2 +-\n 6 files changed, 33 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 483a1f35475e..395c88c8a31f 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -731,6 +731,15 @@ corresponding standard handle, and if `GIT_REDIRECT_STDERR` is\n `2>&1`, standard error will be redirected to the same handle as\n standard output.\n \n+`GIT_PRINT_SHA1_ELLIPSIS` (deprecated)::\n+\tIf set to `yes`, print an ellipsis following an\n+\t(abbreviated) SHA-1 value.  This affects indications of\n+\tdetached HEADs (linkgit:git-checkout[1]) and the raw\n+\tdiff output (linkgit:git-diff[1]).  Printing an\n+\tellipsis in the cases mentioned is no longer considered\n+\tadequate and support for it is likely to be removed in the\n+\tforeseeable future (along with the variable).\n+\n Discussion[[Discussion]]\n ------------------------\n \ndiff --git a/cache.h b/cache.h\nindex 2e143450514c..dc30f6b92025 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1958,4 +1958,10 @@ void sleep_millisec(int millisec);\n  */\n void safe_create_dir(const char *dir, int share);\n \n+/*\n+ * Should we print an ellipsis after an abbreviated SHA-1 value\n+ * when doing diff-raw output or indicating a detached HEAD?\n+ */\n+extern int print_sha1_ellipsis(void);\n+\n #endif /* CACHE_H */\ndiff --git a/environment.c b/environment.c\nindex 8fa032f30742..63ac38a46f8f 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -344,3 +344,18 @@ int use_optional_locks(void)\n {\n \treturn git_env_bool(GIT_OPTIONAL_LOCKS_ENVIRONMENT, 1);\n }\n+\n+int print_sha1_ellipsis(void)\n+{\n+\t/*\n+\t * Determine if the calling environment contains the variable\n+\t * GIT_PRINT_SHA1_ELLIPSIS set to \"yes\".\n+\t */\n+\tstatic int cached_result = -1; /* unknown */\n+\n+\tif (cached_result < 0) {\n+\t\tconst char *v = getenv(\"GIT_PRINT_SHA1_ELLIPSIS\");\n+\t\tcached_result = (v && !strcasecmp(v, \"yes\"));\n+\t}\n+\treturn cached_result;\n+}\ndiff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh\nindex 0a4ff6d824a0..b81eb5fd6ffa 100755\n--- a/t/t3040-subprojects-basic.sh\n+++ b/t/t3040-subprojects-basic.sh\n@@ -19,7 +19,7 @@ test_expect_success 'setup: create subprojects' '\n \tgit update-index --add sub1 &&\n \tgit add sub2 &&\n \tgit commit -q -m \"subprojects added\" &&\n-\tgit diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d\" \" -f-3,5- >current &&\n \tgit branch save HEAD &&\n \tcat >expected <<-\\EOF &&\n \t:000000 160000 00000... A\tsub1\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex c515e3e53fee..9bed64d53e01 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -131,7 +131,7 @@ do\n \ttest_expect_success \"git $cmd\" '\n \t\t{\n \t\t\techo \"\\$ git $cmd\"\n-\t\t\tgit $cmd |\n+\t\t\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git $cmd |\n \t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n \t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n \t\t\techo \"\\$\"\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex d47560b6343d..e4d06accc458 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -876,7 +876,7 @@ test_expect_success 'L: verify internal tree sorting' '\n \tEXPECT_END\n \n \tgit fast-import <input &&\n-\tgit diff-tree --abbrev --raw L^ L >output &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git diff-tree --abbrev --raw L^ L >output &&\n \ttest_cmp expect output\n '\n \n-- \n2.13.6\n\n"},{"id":"334009","messageId":"20171203212743.10228-5-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 5/7] t4013: prepare for upcoming \"diff --raw --abbrev\" output format change","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:41Z","receivedAt":"2017-12-03T21:29:24Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Most of the t4013 tests go through a list of sample command lines,\nand each of them is executed and its output compared with an\nexpected one stored in t4013/ directory.  Allow these lines to begin\nwith a colon followed by magic word(s) so that test conditions can\neasily be tweaked.\n\nThe expected use that will happen in later steps of this is to run\ntests expecting the traditional output and run the same test without\nthe GIT_PRINT_SHA1_ELLIPSIS=yes environment exported for (perhaps\nsome of) them, which will have to expect different output.  Since\nall of the existing tests are meant to run with the environment,\nuse the magic word \"noellipses\" to cause the variable not to be set\nand exported.\n\nAs this step does not add any new test with the magic word, all\ntests still run with the environment variable, expecting the\ntraditional output, but it will change soon.\n\nBased-on-patch-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n t/t4013-diff-various.sh | 29 +++++++++++++++++++++++------\n 1 file changed, 23 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 9bed64d53e01..7288b540450f 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -118,20 +118,37 @@ test_expect_success setup '\n EOF\n \n V=$(git version | sed -e 's/^git version //' -e 's/\\./\\\\./g')\n-while read cmd\n+while read magic cmd\n do\n-\tcase \"$cmd\" in\n-\t'' | '#'*) continue ;;\n+\tcase \"$magic\" in\n+\t'' | '#'*)\n+\t\tcontinue ;;\n+\t:*)\n+\t\tmagic=${magic#:}\n+\t\tlabel=\"$magic-$cmd\"\n+\t\tcase \"$magic\" in\n+\t\tnoellipses) ;;\n+\t\t*)\n+\t\t\tdie \"bug in t4103: unknown magic $magic\" ;;\n+\t\tesac ;;\n+\t*)\n+\t\tcmd=\"$magic $cmd\" magic=\n+\t\tlabel=\"$cmd\" ;;\n \tesac\n-\ttest=$(echo \"$cmd\" | sed -e 's|[/ ][/ ]*|_|g')\n+\ttest=$(echo \"$label\" | sed -e 's|[/ ][/ ]*|_|g')\n \tpfx=$(printf \"%04d\" $test_count)\n \texpect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n \tactual=\"$pfx-diff.$test\"\n \n \ttest_expect_success \"git $cmd\" '\n \t\t{\n-\t\t\techo \"\\$ git $cmd\"\n-\t\t\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git $cmd |\n+\t\t\techo \"$ git $cmd\"\n+\t\t\tcase \"$magic\" in\n+\t\t\t\"\")\n+\t\t\t\tGIT_PRINT_SHA1_ELLIPSIS=yes git $cmd ;;\n+\t\t\tnoellipses)\n+\t\t\t\tgit $cmd ;;\n+\t\t\tesac |\n \t\t\tsed -e \"s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/\" \\\n \t\t\t    -e \"s/^\\\\(.*mixed; boundary=\\\"-*\\\\)$V\\\\(-*\\\\)\\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\\"/\"\n \t\t\techo \"\\$\"\n-- \n2.13.6\n\n"},{"id":"334010","messageId":"20171203212743.10228-4-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:40Z","receivedAt":"2017-12-03T21:29:32Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user sets the environment variable GIT_PRINT_SHA1_ELLIPSIS to \"yes\".\n\nCorrect documentation with respect to what describe_detached_head prints\nwhen GIT_PRINT_SHA1_ELLIPSIS is not set as indicated above.\n\nAdd tests for the old and new behaviour.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n Documentation/user-manual.txt |   2 +-\n builtin/checkout.c            |  10 +++-\n t/t2020-checkout-detach.sh    | 106 ++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 115 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 497e82e88dd0..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3faae382de4f..b0499542158f 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -400,10 +400,16 @@ static void show_local_changes(struct object *head,\n static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (print_sha1_ellipsis()) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh\nindex fbb4ee9bb42d..9d42e38ed905 100755\n--- a/t/t2020-checkout-detach.sh\n+++ b/t/t2020-checkout-detach.sh\n@@ -186,4 +186,110 @@ test_expect_success 'no advice given for explicit detached head state' '\n \ttest_cmp expect.no-advice actual\n '\n \n+# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS\n+\n+# The first detach operation is more chatty than the following ones.\n+cat > 1st_detach <<'EOF'\n+Note: checking out 'HEAD^'.\n+\n+You are in 'detached HEAD' state. You can look around, make experimental\n+changes and commit them, and you can discard any commits you make in this\n+state without impacting any branches by performing another checkout.\n+\n+If you want to create a new branch to retain commits you create, you may\n+do so (now or later) by using -b with the checkout command again. Example:\n+\n+  git checkout -b <new-branch-name>\n+\n+HEAD is now at 7c7cd714e262 three\n+EOF\n+# The remaining ones just show info about previous and current HEADs.\n+cat > 2nd_detach <<'EOF'\n+Previous HEAD position was 7c7cd714e262 three\n+HEAD is now at 139b20d8e6c5 two\n+EOF\n+cat > 3rd_detach <<'EOF'\n+Previous HEAD position was 139b20d8e6c5 two\n+HEAD is now at d79ce1670bdc one\n+EOF\n+test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' '\n+\treset && check_not_detached && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Various ways of *not* asking for ellipses\n+\n+\tunset GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 1st_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"no\" git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 2nd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS= git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 3rd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# We only have four commits, but we can re-use them\n+\treset && check_not_detached && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Make no mention of the env var at all\n+\tgit -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 1st_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='nope' && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 2nd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=nein && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 3rd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\ttrue\n+'\n+\n+# The first detach operation is more chatty than the following ones.\n+cat > 1st_detach <<'EOF'\n+Note: checking out 'HEAD^'.\n+\n+You are in 'detached HEAD' state. You can look around, make experimental\n+changes and commit them, and you can discard any commits you make in this\n+state without impacting any branches by performing another checkout.\n+\n+If you want to create a new branch to retain commits you create, you may\n+do so (now or later) by using -b with the checkout command again. Example:\n+\n+  git checkout -b <new-branch-name>\n+\n+HEAD is now at 7c7cd714e262... three\n+EOF\n+# The remaining ones just show info about previous and current HEADs.\n+cat > 2nd_detach <<'EOF'\n+Previous HEAD position was 7c7cd714e262... three\n+HEAD is now at 139b20d8e6c5... two\n+EOF\n+cat > 3rd_detach <<'EOF'\n+Previous HEAD position was 139b20d8e6c5... two\n+HEAD is now at d79ce1670bdc... one\n+EOF\n+test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' '\n+\treset && check_not_detached && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Various ways of asking for ellipses...\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 1st_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='yes' git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 2nd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=yes git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_cmp 3rd_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\ttrue\n+'\n+\n test_done\n-- \n2.13.6\n\n"},{"id":"334011","messageId":"20171203212743.10228-6-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 6/7] diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:42Z","receivedAt":"2017-12-03T21:29:35Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Neither Git nor the user are in need of this (visual) aid anymore, but\nwe must offer a transition period.\n\nA follow-up patch (series) will rectify the situation by covering the\nnew output format as well as the backward compatible one.\n\nAlso, fix a typo: \"abbbreviated\" ---> \"abbreviated\".\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n diff.c | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/diff.c b/diff.c\nindex 2ebe2227b467..a187c670df6b 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4902,14 +4902,20 @@ const char *diff_aligned_abbrev(const struct object_id *oid, int len)\n \tint abblen;\n \tconst char *abbrev;\n \n+\t/* Do we want all 40 hex characters? */\n \tif (len == GIT_SHA1_HEXSZ)\n \t\treturn oid_to_hex(oid);\n \n+\t/* An abbreviated value is fine, possibly followed by an ellipsis. */\n \tabbrev = diff_abbrev_oid(oid, len);\n+\n+\tif (!print_sha1_ellipsis())\n+\t\treturn abbrev;\n+\n \tabblen = strlen(abbrev);\n \n \t/*\n-\t * In well-behaved cases, where the abbbreviated result is the\n+\t * In well-behaved cases, where the abbreviated result is the\n \t * same as the requested length, append three dots after the\n \t * abbreviation (hence the whole logic is limited to the case\n \t * where abblen < 37); when the actual abbreviated result is a\n-- \n2.13.6\n\n"},{"id":"334012","messageId":"20171203212743.10228-7-bedhanger@gmx.de","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 7/7] t4013: test new output from diff --abbrev --raw","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-03T21:27:43Z","receivedAt":"2017-12-03T21:29:39Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Use newly-introduced finely-grained control to teach the diff-family to\nhonor the new environment GIT_PRINT_SHA1_ELLIPSIS and remove the\nellipses when it is not set.\n\nMentored-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\n t/t4013-diff-various.sh                            | 16 ++++++++-\n ...ff.noellipses-diff-tree_--root_--abbrev_initial |  6 ++++\n ...ellipses-diff-tree_--root_-r_--abbrev=4_initial |  6 ++++\n ...noellipses-diff-tree_--root_-r_--abbrev_initial |  6 ++++\n .../diff.noellipses-diff-tree_-c_--abbrev_master   |  5 +++\n ...ipses-diff_--no-index_--raw_--abbrev=4_dir2_dir |  3 ++\n .../diff.noellipses-diff_--no-index_--raw_dir2_dir |  3 ++\n ...ellipses-diff_--patch-with-raw_-r_initial..side | 36 +++++++++++++++++++\n ....noellipses-diff_--patch-with-raw_initial..side | 36 +++++++++++++++++++\n .../diff.noellipses-diff_--raw_--abbrev=4_initial  |  6 ++++\n t/t4013/diff.noellipses-diff_--raw_initial         |  6 ++++\n t/t4013/diff.noellipses-show_--patch-with-raw_side | 42 ++++++++++++++++++++++\n t/t4013/diff.noellipses-whatchanged_--root_master  | 42 ++++++++++++++++++++++\n t/t4013/diff.noellipses-whatchanged_-SF_master     |  9 +++++\n t/t4013/diff.noellipses-whatchanged_master         | 32 +++++++++++++++++\n 15 files changed, 253 insertions(+), 1 deletion(-)\n create mode 100644 t/t4013/diff.noellipses-diff-tree_--root_--abbrev_initial\n create mode 100644 t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\n create mode 100644 t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev_initial\n create mode 100644 t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master\n create mode 100644 t/t4013/diff.noellipses-diff_--no-index_--raw_--abbrev=4_dir2_dir\n create mode 100644 t/t4013/diff.noellipses-diff_--no-index_--raw_dir2_dir\n create mode 100644 t/t4013/diff.noellipses-diff_--patch-with-raw_-r_initial..side\n create mode 100644 t/t4013/diff.noellipses-diff_--patch-with-raw_initial..side\n create mode 100644 t/t4013/diff.noellipses-diff_--raw_--abbrev=4_initial\n create mode 100644 t/t4013/diff.noellipses-diff_--raw_initial\n create mode 100644 t/t4013/diff.noellipses-show_--patch-with-raw_side\n create mode 100644 t/t4013/diff.noellipses-whatchanged_--root_master\n create mode 100644 t/t4013/diff.noellipses-whatchanged_-SF_master\n create mode 100644 t/t4013/diff.noellipses-whatchanged_master\n\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 7288b540450f..f10798b2dff3 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -140,7 +140,7 @@ do\n \texpect=\"$TEST_DIRECTORY/t4013/diff.$test\"\n \tactual=\"$pfx-diff.$test\"\n \n-\ttest_expect_success \"git $cmd\" '\n+\ttest_expect_success \"git $cmd # magic is ${magic:-\"(not used)\"}\" '\n \t\t{\n \t\t\techo \"$ git $cmd\"\n \t\t\tcase \"$magic\" in\n@@ -175,9 +175,12 @@ diff-tree -r --abbrev initial\n diff-tree -r --abbrev=4 initial\n diff-tree --root initial\n diff-tree --root --abbrev initial\n+:noellipses diff-tree --root --abbrev initial\n diff-tree --root -r initial\n diff-tree --root -r --abbrev initial\n+:noellipses diff-tree --root -r --abbrev initial\n diff-tree --root -r --abbrev=4 initial\n+:noellipses diff-tree --root -r --abbrev=4 initial\n diff-tree -p initial\n diff-tree --root -p initial\n diff-tree --patch-with-stat initial\n@@ -226,6 +229,7 @@ diff-tree -p master\n diff-tree -p -m master\n diff-tree -c master\n diff-tree -c --abbrev master\n+:noellipses diff-tree -c --abbrev master\n diff-tree --cc master\n # stat only should show the diffstat with the first parent\n diff-tree -c --stat master\n@@ -272,8 +276,10 @@ rev-list --parents HEAD\n rev-list --children HEAD\n \n whatchanged master\n+:noellipses whatchanged master\n whatchanged -p master\n whatchanged --root master\n+:noellipses whatchanged --root master\n whatchanged --root -p master\n whatchanged --patch-with-stat master\n whatchanged --root --patch-with-stat master\n@@ -283,6 +289,7 @@ whatchanged --root -c --patch-with-stat --summary master\n # improved by Timo's patch\n whatchanged --root --cc --patch-with-stat --summary master\n whatchanged -SF master\n+:noellipses whatchanged -SF master\n whatchanged -SF -p master\n \n log --patch-with-stat master -- dir/\n@@ -301,6 +308,7 @@ show --stat side\n show --stat --summary side\n show --patch-with-stat side\n show --patch-with-raw side\n+:noellipses show --patch-with-raw side\n show --patch-with-stat --summary side\n \n format-patch --stdout initial..side\n@@ -328,8 +336,10 @@ diff -r --stat initial..side\n diff initial..side\n diff --patch-with-stat initial..side\n diff --patch-with-raw initial..side\n+:noellipses diff --patch-with-raw initial..side\n diff --patch-with-stat -r initial..side\n diff --patch-with-raw -r initial..side\n+:noellipses diff --patch-with-raw -r initial..side\n diff --name-status dir2 dir\n diff --no-index --name-status dir2 dir\n diff --no-index --name-status -- dir2 dir\n@@ -342,10 +352,14 @@ diff --dirstat initial rearrange\n diff --dirstat-by-file initial rearrange\n # No-index --abbrev and --no-abbrev\n diff --raw initial\n+:noellipses diff --raw initial\n diff --raw --abbrev=4 initial\n+:noellipses diff --raw --abbrev=4 initial\n diff --raw --no-abbrev initial\n diff --no-index --raw dir2 dir\n+:noellipses diff --no-index --raw dir2 dir\n diff --no-index --raw --abbrev=4 dir2 dir\n+:noellipses diff --no-index --raw --abbrev=4 dir2 dir\n diff --no-index --raw --no-abbrev dir2 dir\n EOF\n \ndiff --git a/t/t4013/diff.noellipses-diff-tree_--root_--abbrev_initial b/t/t4013/diff.noellipses-diff-tree_--root_--abbrev_initial\nnew file mode 100644\nindex 000000000000..4bdad4072ebf\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff-tree_--root_--abbrev_initial\n@@ -0,0 +1,6 @@\n+$ git diff-tree --root --abbrev initial\n+444ac553ac7612cc88969031b02b3767fb8a353a\n+:000000 040000 0000000 da7a33f A\tdir\n+:000000 100644 0000000 01e79c3 A\tfile0\n+:000000 100644 0000000 01e79c3 A\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\nnew file mode 100644\nindex 000000000000..26fbfeb177be\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial\n@@ -0,0 +1,6 @@\n+$ git diff-tree --root -r --abbrev=4 initial\n+444ac553ac7612cc88969031b02b3767fb8a353a\n+:000000 100644 0000 35d2 A\tdir/sub\n+:000000 100644 0000 01e7 A\tfile0\n+:000000 100644 0000 01e7 A\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev_initial b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev_initial\nnew file mode 100644\nindex 000000000000..2ac856119190\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev_initial\n@@ -0,0 +1,6 @@\n+$ git diff-tree --root -r --abbrev initial\n+444ac553ac7612cc88969031b02b3767fb8a353a\n+:000000 100644 0000000 35d242b A\tdir/sub\n+:000000 100644 0000000 01e79c3 A\tfile0\n+:000000 100644 0000000 01e79c3 A\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master b/t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master\nnew file mode 100644\nindex 000000000000..bb80f013b37d\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master\n@@ -0,0 +1,5 @@\n+$ git diff-tree -c --abbrev master\n+59d314ad6f356dd08601a4cd5e530381da3e3c64\n+::100644 100644 100644 cead32e 7289e35 992913c MM\tdir/sub\n+::100644 100644 100644 b414108 f4615da 10a8a9f MM\tfile0\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--no-index_--raw_--abbrev=4_dir2_dir b/t/t4013/diff.noellipses-diff_--no-index_--raw_--abbrev=4_dir2_dir\nnew file mode 100644\nindex 000000000000..41b7baf0a534\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--no-index_--raw_--abbrev=4_dir2_dir\n@@ -0,0 +1,3 @@\n+$ git diff --no-index --raw --abbrev=4 dir2 dir\n+:000000 100644 0000 0000 A\tdir/sub\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--no-index_--raw_dir2_dir b/t/t4013/diff.noellipses-diff_--no-index_--raw_dir2_dir\nnew file mode 100644\nindex 000000000000..0cf3a3efea83\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--no-index_--raw_dir2_dir\n@@ -0,0 +1,3 @@\n+$ git diff --no-index --raw dir2 dir\n+:000000 100644 0000000 0000000 A\tdir/sub\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--patch-with-raw_-r_initial..side b/t/t4013/diff.noellipses-diff_--patch-with-raw_-r_initial..side\nnew file mode 100644\nindex 000000000000..8d1f1e372199\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--patch-with-raw_-r_initial..side\n@@ -0,0 +1,36 @@\n+$ git diff --patch-with-raw -r initial..side\n+:100644 100644 35d242b 7289e35 M\tdir/sub\n+:100644 100644 01e79c3 f4615da M\tfile0\n+:000000 100644 0000000 7289e35 A\tfile3\n+\n+diff --git a/dir/sub b/dir/sub\n+index 35d242b..7289e35 100644\n+--- a/dir/sub\n++++ b/dir/sub\n+@@ -1,2 +1,4 @@\n+ A\n+ B\n++1\n++2\n+diff --git a/file0 b/file0\n+index 01e79c3..f4615da 100644\n+--- a/file0\n++++ b/file0\n+@@ -1,3 +1,6 @@\n+ 1\n+ 2\n+ 3\n++A\n++B\n++C\n+diff --git a/file3 b/file3\n+new file mode 100644\n+index 0000000..7289e35\n+--- /dev/null\n++++ b/file3\n+@@ -0,0 +1,4 @@\n++A\n++B\n++1\n++2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--patch-with-raw_initial..side b/t/t4013/diff.noellipses-diff_--patch-with-raw_initial..side\nnew file mode 100644\nindex 000000000000..50d8aee4f7f3\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--patch-with-raw_initial..side\n@@ -0,0 +1,36 @@\n+$ git diff --patch-with-raw initial..side\n+:100644 100644 35d242b 7289e35 M\tdir/sub\n+:100644 100644 01e79c3 f4615da M\tfile0\n+:000000 100644 0000000 7289e35 A\tfile3\n+\n+diff --git a/dir/sub b/dir/sub\n+index 35d242b..7289e35 100644\n+--- a/dir/sub\n++++ b/dir/sub\n+@@ -1,2 +1,4 @@\n+ A\n+ B\n++1\n++2\n+diff --git a/file0 b/file0\n+index 01e79c3..f4615da 100644\n+--- a/file0\n++++ b/file0\n+@@ -1,3 +1,6 @@\n+ 1\n+ 2\n+ 3\n++A\n++B\n++C\n+diff --git a/file3 b/file3\n+new file mode 100644\n+index 0000000..7289e35\n+--- /dev/null\n++++ b/file3\n+@@ -0,0 +1,4 @@\n++A\n++B\n++1\n++2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--raw_--abbrev=4_initial b/t/t4013/diff.noellipses-diff_--raw_--abbrev=4_initial\nnew file mode 100644\nindex 000000000000..8ae44d6c8365\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--raw_--abbrev=4_initial\n@@ -0,0 +1,6 @@\n+$ git diff --raw --abbrev=4 initial\n+:100644 100644 35d2 9929 M\tdir/sub\n+:100644 100644 01e7 10a8 M\tfile0\n+:000000 100644 0000 b1e6 A\tfile1\n+:100644 000000 01e7 0000 D\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-diff_--raw_initial b/t/t4013/diff.noellipses-diff_--raw_initial\nnew file mode 100644\nindex 000000000000..0175bfb28166\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-diff_--raw_initial\n@@ -0,0 +1,6 @@\n+$ git diff --raw initial\n+:100644 100644 35d242b 992913c M\tdir/sub\n+:100644 100644 01e79c3 10a8a9f M\tfile0\n+:000000 100644 0000000 b1e6722 A\tfile1\n+:100644 000000 01e79c3 0000000 D\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-show_--patch-with-raw_side b/t/t4013/diff.noellipses-show_--patch-with-raw_side\nnew file mode 100644\nindex 000000000000..32fed3d5764b\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-show_--patch-with-raw_side\n@@ -0,0 +1,42 @@\n+$ git show --patch-with-raw side\n+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:03:00 2006 +0000\n+\n+    Side\n+\n+:100644 100644 35d242b 7289e35 M\tdir/sub\n+:100644 100644 01e79c3 f4615da M\tfile0\n+:000000 100644 0000000 7289e35 A\tfile3\n+\n+diff --git a/dir/sub b/dir/sub\n+index 35d242b..7289e35 100644\n+--- a/dir/sub\n++++ b/dir/sub\n+@@ -1,2 +1,4 @@\n+ A\n+ B\n++1\n++2\n+diff --git a/file0 b/file0\n+index 01e79c3..f4615da 100644\n+--- a/file0\n++++ b/file0\n+@@ -1,3 +1,6 @@\n+ 1\n+ 2\n+ 3\n++A\n++B\n++C\n+diff --git a/file3 b/file3\n+new file mode 100644\n+index 0000000..7289e35\n+--- /dev/null\n++++ b/file3\n+@@ -0,0 +1,4 @@\n++A\n++B\n++1\n++2\n+$\ndiff --git a/t/t4013/diff.noellipses-whatchanged_--root_master b/t/t4013/diff.noellipses-whatchanged_--root_master\nnew file mode 100644\nindex 000000000000..c2cfd4e72927\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-whatchanged_--root_master\n@@ -0,0 +1,42 @@\n+$ git whatchanged --root master\n+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:03:00 2006 +0000\n+\n+    Side\n+\n+:100644 100644 35d242b 7289e35 M\tdir/sub\n+:100644 100644 01e79c3 f4615da M\tfile0\n+:000000 100644 0000000 7289e35 A\tfile3\n+\n+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:02:00 2006 +0000\n+\n+    Third\n+\n+:100644 100644 8422d40 cead32e M\tdir/sub\n+:000000 100644 0000000 b1e6722 A\tfile1\n+\n+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:01:00 2006 +0000\n+\n+    Second\n+    \n+    This is the second commit.\n+\n+:100644 100644 35d242b 8422d40 M\tdir/sub\n+:100644 100644 01e79c3 b414108 M\tfile0\n+:100644 000000 01e79c3 0000000 D\tfile2\n+\n+commit 444ac553ac7612cc88969031b02b3767fb8a353a\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:00:00 2006 +0000\n+\n+    Initial\n+\n+:000000 100644 0000000 35d242b A\tdir/sub\n+:000000 100644 0000000 01e79c3 A\tfile0\n+:000000 100644 0000000 01e79c3 A\tfile2\n+$\ndiff --git a/t/t4013/diff.noellipses-whatchanged_-SF_master b/t/t4013/diff.noellipses-whatchanged_-SF_master\nnew file mode 100644\nindex 000000000000..b36ce5886e0e\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-whatchanged_-SF_master\n@@ -0,0 +1,9 @@\n+$ git whatchanged -SF master\n+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:02:00 2006 +0000\n+\n+    Third\n+\n+:100644 100644 8422d40 cead32e M\tdir/sub\n+$\ndiff --git a/t/t4013/diff.noellipses-whatchanged_master b/t/t4013/diff.noellipses-whatchanged_master\nnew file mode 100644\nindex 000000000000..55e500f2edbe\n--- /dev/null\n+++ b/t/t4013/diff.noellipses-whatchanged_master\n@@ -0,0 +1,32 @@\n+$ git whatchanged master\n+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:03:00 2006 +0000\n+\n+    Side\n+\n+:100644 100644 35d242b 7289e35 M\tdir/sub\n+:100644 100644 01e79c3 f4615da M\tfile0\n+:000000 100644 0000000 7289e35 A\tfile3\n+\n+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:02:00 2006 +0000\n+\n+    Third\n+\n+:100644 100644 8422d40 cead32e M\tdir/sub\n+:000000 100644 0000000 b1e6722 A\tfile1\n+\n+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44\n+Author: A U Thor <author@example.com>\n+Date:   Mon Jun 26 00:01:00 2006 +0000\n+\n+    Second\n+    \n+    This is the second commit.\n+\n+:100644 100644 35d242b 8422d40 M\tdir/sub\n+:100644 100644 01e79c3 b414108 M\tfile0\n+:100644 000000 01e79c3 0000000 D\tfile2\n+$\n-- \n2.13.6\n\n"},{"id":"334063","messageId":"xmqqshcqmoe7.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171203212743.10228-4-bedhanger@gmx.de","subject":"Re: [PATCH v5 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-12-04T16:46:56Z","receivedAt":"2017-12-04T16:47:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> +# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS\n> +\n> +# The first detach operation is more chatty than the following ones.\n> +cat > 1st_detach <<'EOF'\n> +Note: checking out 'HEAD^'.\n> +\n> +You are in 'detached HEAD' state. You can look around, make experimental\n> +changes and commit them, and you can discard any commits you make in this\n> +state without impacting any branches by performing another checkout.\n> +\n> +If you want to create a new branch to retain commits you create, you may\n> +do so (now or later) by using -b with the checkout command again. Example:\n> +\n> +  git checkout -b <new-branch-name>\n> +\n> +HEAD is now at 7c7cd714e262 three\n> +EOF\n> +# The remaining ones just show info about previous and current HEADs.\n> +cat > 2nd_detach <<'EOF'\n> +Previous HEAD position was 7c7cd714e262 three\n> +HEAD is now at 139b20d8e6c5 two\n> +EOF\n> +cat > 3rd_detach <<'EOF'\n> +Previous HEAD position was 139b20d8e6c5 two\n> +HEAD is now at d79ce1670bdc one\n> +EOF\n\nIt is preferrable to have all of the above inside the\ntest_expect_success block that uses them.  \n\nAlso lose the SP between redirection operator and its target\nfilename, i.e.\n\n\tcommand >file\n\nnot\n\n\tcommand > file\n\n> +test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' '\n> +\treset && check_not_detached && unset GIT_PRINT_SHA1_ELLIPSIS &&\n> +\n> +\t# Various ways of *not* asking for ellipses\n> +\n> +\tunset GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1> actual 2>&1 &&\n\nUse sane_unset from t/test-lib-functions.sh instead, unless you are\nabsolutely sure that the variable you are unsetting _is_ set at this\npoint.\n\n> +\tcheck_detached &&\n> +\ttest_cmp 1st_detach actual && unset GIT_PRINT_SHA1_ELLIPSIS &&\n\nIs the output we are grabbing with check_detached from the command\ninternationalized?  If so, the comparison should be done with\ntest_i18ncmp (otherwise, the test will break under the \"poisoned\ngettext\" build).\n\nThanks.\n"},{"id":"334064","messageId":"xmqqo9nemo52.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171203212743.10228-1-bedhanger@gmx.de","subject":"Re: [PATCH v5 1/7] Documentation: revisions: fix typo: \"three dot\" ---> \"three-dot\" (in line with \"two-dot\").","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-12-04T16:52:25Z","receivedAt":"2017-12-04T16:53:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I found a few questionable pieces in 4/7 but other than that the\nwhole series is very nicely done.\n\nWill queue; thanks.\n"},{"id":"334107","messageId":"20171204231313.17929-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqqshcqmoe7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v6 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-04T23:13:13Z","receivedAt":"2017-12-04T23:15:20Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user sets the environment variable GIT_PRINT_SHA1_ELLIPSIS to \"yes\".\n\nCorrect documentation with respect to what describe_detached_head prints\nwhen GIT_PRINT_SHA1_ELLIPSIS is not set as indicated above.\n\nAdd tests for the old and new behaviour.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\nv6: polish to take Junio's comments from <xmqqshcqmoe7.fsf@gitster.mtv.corp.google.com> into account\n Documentation/user-manual.txt |   2 +-\n builtin/checkout.c            |  10 +++-\n t/t2020-checkout-detach.sh    | 114 ++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 123 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 497e82e88dd0..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3faae382de4f..b0499542158f 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -400,10 +400,16 @@ static void show_local_changes(struct object *head,\n static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (print_sha1_ellipsis()) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh\nindex fbb4ee9bb42d..3a37e07531ce 100755\n--- a/t/t2020-checkout-detach.sh\n+++ b/t/t2020-checkout-detach.sh\n@@ -186,4 +186,118 @@ test_expect_success 'no advice given for explicit detached head state' '\n \ttest_cmp expect.no-advice actual\n '\n \n+# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)\n+test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' \"\n+\n+\t# The first detach operation is more chatty than the following ones.\n+\tcat 1>1st_detach <<'EOF' &&\n+Note: checking out 'HEAD^'.\n+\n+You are in 'detached HEAD' state. You can look around, make experimental\n+changes and commit them, and you can discard any commits you make in this\n+state without impacting any branches by performing another checkout.\n+\n+If you want to create a new branch to retain commits you create, you may\n+do so (now or later) by using -b with the checkout command again. Example:\n+\n+  git checkout -b <new-branch-name>\n+\n+HEAD is now at 7c7cd714e262 three\n+EOF\n+\n+\t# The remaining ones just show info about previous and current HEADs.\n+\tcat 1>2nd_detach <<'EOF' &&\n+Previous HEAD position was 7c7cd714e262 three\n+HEAD is now at 139b20d8e6c5 two\n+EOF\n+\n+\tcat 1>3rd_detach <<'EOF' &&\n+Previous HEAD position was 139b20d8e6c5 two\n+HEAD is now at d79ce1670bdc one\n+EOF\n+\n+\treset && check_not_detached && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Various ways of *not* asking for ellipses\n+\n+\tsane_unset GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"no\" git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS= git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# We only have four commits, but we can re-use them\n+\treset && check_not_detached && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Make no mention of the env var at all\n+\tgit -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='nope' && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=nein && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\ttrue\n+\"\n+\n+# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)\n+test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' \"\n+\n+\t# The first detach operation is more chatty than the following ones.\n+\tcat 1>1st_detach <<'EOF' &&\n+Note: checking out 'HEAD^'.\n+\n+You are in 'detached HEAD' state. You can look around, make experimental\n+changes and commit them, and you can discard any commits you make in this\n+state without impacting any branches by performing another checkout.\n+\n+If you want to create a new branch to retain commits you create, you may\n+do so (now or later) by using -b with the checkout command again. Example:\n+\n+  git checkout -b <new-branch-name>\n+\n+HEAD is now at 7c7cd714e262... three\n+EOF\n+\n+\t# The remaining ones just show info about previous and current HEADs.\n+\tcat 1>2nd_detach <<'EOF' &&\n+Previous HEAD position was 7c7cd714e262... three\n+HEAD is now at 139b20d8e6c5... two\n+EOF\n+\n+\tcat 1>3rd_detach <<'EOF' &&\n+Previous HEAD position was 139b20d8e6c5... two\n+HEAD is now at d79ce1670bdc... one\n+EOF\n+\n+\treset && check_not_detached && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# Various ways of asking for ellipses...\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='yes' git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=yes git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\ttrue\n+\"\n+\n test_done\n-- \n2.13.6\n\n"},{"id":"334160","messageId":"xmqq8tehjh6f.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171204231313.17929-1-bedhanger@gmx.de","subject":"Re: [PATCH v6 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-12-05T16:03:20Z","receivedAt":"2017-12-05T16:03:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> v6: polish to take Junio's comments from <xmqqshcqmoe7.fsf@gitster.mtv.corp.google.com> into account\n\n>  t/t2020-checkout-detach.sh    | 114 ++++++++++++++++++++++++++++++++++++++++++\n> ...\n\nThanks; with this one replaced, I'd expect that poisoned gettext\ntest to pass now.\n\nI saw some style issues, so I'll queue a tentative fix-up on top.\n\n> +\t# The first detach operation is more chatty than the following ones.\n> +\tcat 1>1st_detach <<'EOF' &&\n> +Note: checking out 'HEAD^'.\n> +\n> +You are in 'detached HEAD' state. You can look around, make experimental\n> +changes and commit them, and you can discard any commits you make in this\n> +state without impacting any branches by performing another checkout.\n> +\n> +If you want to create a new branch to retain commits you create, you may\n> +do so (now or later) by using -b with the checkout command again. Example:\n> +\n> +  git checkout -b <new-branch-name>\n> +\n> +HEAD is now at 7c7cd714e262 three\n> +EOF\n\nIt looks somewhat strange to explicitly say 1> when redirecting the\nstandard output.  Also we prefer to indent our here-doc to the same\ndepth as commands by using \"<<-\", i.e.\n\n\tcat >1st_detach <<-'EOF' &&\n\tNote: checking out 'HEAD^'.\n\t...\n\tEOF\n\n> +\treset && check_not_detached && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n\nIt also was a bit irritating to see multiple commands form an\noverlong single line, like this one.\n\n> +\ttest_i18ncmp 1st_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n> +\n> +\tGIT_PRINT_SHA1_ELLIPSIS=\"no\" git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n> +\tcheck_detached &&\n> +\ttest_i18ncmp 2nd_detach actual && sane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n\nThis part uses \"set and export only for a single invocation of git\",\nand because the variable is unset at the end of the previous step\nafter 1st_detach and actual are compared, this unset at the end\nfeels redundant.\n\n> +\tGIT_PRINT_SHA1_ELLIPSIS='nope' && export GIT_PRINT_SHA1_ELLIPSIS && git -c 'core.abbrev=12' checkout HEAD^ 1>actual 2>&1 &&\n\nBut now this part sets and exports the variable for the remainder of\nthe script (until it is unset).\n\nIs the use of these two styles, i.e.\n\n\tVAR=value && export VAR && git -c core.abbrev=12 subcmd\n\tVAR=value git -c core.abbrev=12 subcmd\n\nintended?  If so for what purpose?  It's not like we are testing if\nthe shell implements environment variables correctly, so I'd expect\nthat the result would be easier to follow if it stuck to a single\nstyle and used it consistently.\n\n"},{"id":"334238","messageId":"20171206002042.18863-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqq8tehjh6f.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v7 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-06T00:20:42Z","receivedAt":"2017-12-06T00:22:21Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"We do not want an ellipsis displayed following an (abbreviated) SHA-1\nvalue.\n\nThe days when this was necessary to indicate the truncation to\nlower-level Git commands and/or the user are bygone.\n\nHowever, to ease the transition, the ellipsis will still be printed if\nthe user sets the environment variable GIT_PRINT_SHA1_ELLIPSIS to \"yes\".\n\nCorrect documentation with respect to what describe_detached_head prints\nwhen GIT_PRINT_SHA1_ELLIPSIS is not set as indicated above.\n\nAdd tests for the old and new behaviour.\n\nSigned-off-by: Ann T Ropea <bedhanger@gmx.de>\n---\nv2: rename patch series & focus on removal of ellipses\nv3: env var instead of config option, use one-line comments where appropriate, preserve indent level\nv4: improve env var handling (rename, helper func to query, docu)\nv5: rewrite series to take Junio's comments in <xmqqd145k9td.fsf@gitster.mtv.corp.google.com> aboard\nv6: polish to take Junio's comments from <xmqqshcqmoe7.fsf@gitster.mtv.corp.google.com> into account\nv7: fix style issues (redirection, here-dox, long lines, setting/exporting/unsetting of env var): cf. <xmqq8tehjh6f.fsf@gitster.mtv.corp.google.com>\n Documentation/user-manual.txt |   2 +-\n builtin/checkout.c            |  10 +++-\n t/t2020-checkout-detach.sh    | 123 ++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 132 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 497e82e88dd0..eff78902742a 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:\n \n   git checkout -b new_branch_name\n \n-HEAD is now at 427abfa... Linux v2.6.17\n+HEAD is now at 427abfa Linux v2.6.17\n ------------------------------------------------\n \n The HEAD then refers to the SHA-1 of the commit instead of to a branch,\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex 3faae382de4f..b0499542158f 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -400,10 +400,16 @@ static void show_local_changes(struct object *head,\n static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n+\n \tif (!parse_commit(commit))\n \t\tpp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);\n-\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n-\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\tif (print_sha1_ellipsis()) {\n+\t\tfprintf(stderr, \"%s %s... %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t} else {\n+\t\tfprintf(stderr, \"%s %s %s\\n\", msg,\n+\t\t\tfind_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);\n+\t}\n \tstrbuf_release(&sb);\n }\n \ndiff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh\nindex fbb4ee9bb42d..e8e284cf9c04 100755\n--- a/t/t2020-checkout-detach.sh\n+++ b/t/t2020-checkout-detach.sh\n@@ -186,4 +186,127 @@ test_expect_success 'no advice given for explicit detached head state' '\n \ttest_cmp expect.no-advice actual\n '\n \n+# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)\n+test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' \"\n+\n+\t# The first detach operation is more chatty than the following ones.\n+\tcat >1st_detach <<-'EOF' &&\n+\tNote: checking out 'HEAD^'.\n+\n+\tYou are in 'detached HEAD' state. You can look around, make experimental\n+\tchanges and commit them, and you can discard any commits you make in this\n+\tstate without impacting any branches by performing another checkout.\n+\n+\tIf you want to create a new branch to retain commits you create, you may\n+\tdo so (now or later) by using -b with the checkout command again. Example:\n+\n+\t  git checkout -b <new-branch-name>\n+\n+\tHEAD is now at 7c7cd714e262 three\n+\tEOF\n+\n+\t# The remaining ones just show info about previous and current HEADs.\n+\tcat >2nd_detach <<-'EOF' &&\n+\tPrevious HEAD position was 7c7cd714e262 three\n+\tHEAD is now at 139b20d8e6c5 two\n+\tEOF\n+\n+\tcat >3rd_detach <<-'EOF' &&\n+\tPrevious HEAD position was 139b20d8e6c5 two\n+\tHEAD is now at d79ce1670bdc one\n+\tEOF\n+\n+\treset &&\n+\tcheck_not_detached &&\n+\n+\t# Various ways of *not* asking for ellipses\n+\n+\tsane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\tgit -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"no\" git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS= git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual &&\n+\n+\tsane_unset GIT_PRINT_SHA1_ELLIPSIS &&\n+\n+\t# We only have four commits, but we can re-use them\n+\treset &&\n+\tcheck_not_detached &&\n+\n+\t# Make no mention of the env var at all\n+\tgit -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='nope' &&\n+\tgit -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=nein &&\n+\tgit -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual &&\n+\n+\ttrue\n+\"\n+\n+# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)\n+test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' \"\n+\n+\t# The first detach operation is more chatty than the following ones.\n+\tcat >1st_detach <<-'EOF' &&\n+\tNote: checking out 'HEAD^'.\n+\t\n+\tYou are in 'detached HEAD' state. You can look around, make experimental\n+\tchanges and commit them, and you can discard any commits you make in this\n+\tstate without impacting any branches by performing another checkout.\n+\t\n+\tIf you want to create a new branch to retain commits you create, you may\n+\tdo so (now or later) by using -b with the checkout command again. Example:\n+\t\n+\t  git checkout -b <new-branch-name>\n+\t\n+\tHEAD is now at 7c7cd714e262... three\n+\tEOF\n+\n+\t# The remaining ones just show info about previous and current HEADs.\n+\tcat >2nd_detach <<-'EOF' &&\n+\tPrevious HEAD position was 7c7cd714e262... three\n+\tHEAD is now at 139b20d8e6c5... two\n+\tEOF\n+\n+\tcat >3rd_detach <<-'EOF' &&\n+\tPrevious HEAD position was 139b20d8e6c5... two\n+\tHEAD is now at d79ce1670bdc... one\n+\tEOF\n+\n+\treset &&\n+\tcheck_not_detached &&\n+\n+\t# Various ways of asking for ellipses...\n+\t# The user can just use any kind of quoting (including none).\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 1st_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS='yes' git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 2nd_detach actual &&\n+\n+\tGIT_PRINT_SHA1_ELLIPSIS=yes git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tcheck_detached &&\n+\ttest_i18ncmp 3rd_detach actual &&\n+\n+\ttrue\n+\"\n+\n test_done\n-- \n2.13.6\n\n"},{"id":"334255","messageId":"xmqqpo7rhkg7.fsf@gitster.mtv.corp.google.com","threadId":"47122","inReplyTo":"20171206002042.18863-1-bedhanger@gmx.de","subject":"Re: [PATCH v7 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-12-06T16:47:52Z","receivedAt":"2017-12-06T16:48:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ann T Ropea <bedhanger@gmx.de> writes:\n\n> v7: fix style issues (redirection, here-dox, long lines, setting/exporting/unsetting of env var): cf. <xmqq8tehjh6f.fsf@gitster.mtv.corp.google.com>\n\nThanks.  I'd say this is polished enough already.  Let's stop\nrerolling, wait for a few days for others to give final comments and\nmerge it to 'next'.\n\nI've however queued the following on top of the entire series.  I do\nnot mind squashing it into this step, though.\n\n-- >8 --\nSubject: [PATCH] t2020: test variations that matter\n\nBecause our test suite is not about validating the working of the\nshell, it is pointless to test variations of how a literal string\n'yes' is quoted when assigned to an environment variable.\n\nInstead, test various ways to spell 'yes' (we use strcasecmp() so\nuppercased and capitalized variant should work just like 'yes'\nspelled in all lowercase) and make sure we take them as 'yes'.  That\nis more relevant in testing Git.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t2020-checkout-detach.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh\nindex 9464069d15..bb4f2e0c63 100755\n--- a/t/t2020-checkout-detach.sh\n+++ b/t/t2020-checkout-detach.sh\n@@ -294,15 +294,15 @@ test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked\n \t# Various ways of asking for ellipses...\n \t# The user can just use any kind of quoting (including none).\n \n-\tGIT_PRINT_SHA1_ELLIPSIS=\"yes\" git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=yes git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n \tcheck_detached &&\n \ttest_i18ncmp 1st_detach actual &&\n \n-\tGIT_PRINT_SHA1_ELLIPSIS='yes' git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=Yes git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n \tcheck_detached &&\n \ttest_i18ncmp 2nd_detach actual &&\n \n-\tGIT_PRINT_SHA1_ELLIPSIS=yes git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n+\tGIT_PRINT_SHA1_ELLIPSIS=YES git -c 'core.abbrev=12' checkout HEAD^ >actual 2>&1 &&\n \tcheck_detached &&\n \ttest_i18ncmp 3rd_detach actual &&\n \n-- \n2.15.1-465-g070199a3f5\n\n"},{"id":"334280","messageId":"20171206220206.3559-1-bedhanger@gmx.de","threadId":"47122","inReplyTo":"xmqqpo7rhkg7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v7 4/7] checkout: describe_detached_head: remove ellipsis after committish","fromName":"Ann T Ropea","fromEmail":"bedhanger@gmx.de","sentAt":"2017-12-06T22:02:06Z","receivedAt":"2017-12-06T22:03:43Z","isPatch":true,"sender":{"key":"bedhanger@gmx.de","avatar":"https://avatars.githubusercontent.com/u/21041143?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I've however queued the following on top of the entire series.  I do\n> not mind squashing it into this step, though.\n\n> Subject: [PATCH] t2020: test variations that matter\n\nThat sounds and looks fine to me.  I'm going to do this on my\nside (getting it from 'pu' once the squashing is done).\n\nThanks.\n"}]}