{"thread":{"id":"38401","subject":"[PATCH] rebase -i: respect core.abbrev for real","startedAt":"2015-01-19T14:20:48Z","lastAt":"2015-01-23T00:39:37Z","messageCount":8,"participants":["Kirill A. Shutemov","Eric Sunshine","Junio C Hamano","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"254879","messageId":"1421677248-137853-1-git-send-email-kirill.shutemov@linux.intel.com","threadId":"38401","inReplyTo":null,"subject":"[PATCH] rebase -i: respect core.abbrev for real","fromName":"Kirill A. Shutemov","fromEmail":"kirill.shutemov@linux.intel.com","sentAt":"2015-01-19T14:20:48Z","receivedAt":"2015-01-19T14:20:48Z","isPatch":true,"sender":{"key":"kirill.shutemov@linux.intel.com","avatar":"https://avatars.githubusercontent.com/u/588661?v=4"},"body":"I have tried to fix this before: see 568950388be2, but it doesn't\nreally work.\n\nI don't know how it happend, but that commit makes interactive rebase to\nrespect core.abbrev only during --edit-todo, but not the initial todo\nlist edit.\n\nFor this time I've included a test-case to avoid this frustration again.\n\nSigned-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n---\n git-rebase--interactive.sh    | 4 ++--\n t/t3404-rebase-interactive.sh | 7 +++++++\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c6a4629cbc2b..1855e12f1ada 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -962,7 +962,7 @@ else\n \tshortrevisions=$shorthead\n fi\n git rev-list $merges_option --pretty=oneline --abbrev-commit \\\n-\t--abbrev=7 --reverse --left-right --topo-order \\\n+\t--reverse --left-right --topo-order \\\n \t$revisions ${restrict_revision+^$restrict_revision} | \\\n \tsed -n \"s/^>//p\" |\n while read -r shortsha1 rest\n@@ -1020,7 +1020,7 @@ then\n \t\t\t# just the history of its first-parent for others that will\n \t\t\t# be rebasing on top of it\n \t\t\tgit rev-list --parents -1 $rev | cut -d' ' -s -f2 > \"$dropped\"/$rev\n-\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n+\t\t\tshort=$(git rev-list -1 --abbrev-commit $rev)\n \t\t\tsane_grep -v \"^[a-z][a-z]* $short\" <\"$todo\" > \"${todo}2\" ; mv \"${todo}2\" \"$todo\"\n \t\t\trm \"$rewritten\"/$rev\n \t\tfi\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8197ed29a9ec..a8ffc24ce46b 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n \t)\n '\n \n+test_expect_success 'respect core.abbrev' '\n+\tgit config core.abbrev 12 &&\n+\tset_cat_todo_editor &&\n+\ttest_must_fail git rebase -i HEAD~4 >todo-list 2>&1\n+\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n+'\n+\n test_done\n-- \n2.1.4\n"},{"id":"254908","messageId":"CAPig+cQcYXzRwHMRcKQJf-mWq7d9Kgp7KndnEhFs4_mwgLpiiA@mail.gmail.com","threadId":"38401","inReplyTo":"1421677248-137853-1-git-send-email-kirill.shutemov@linux.intel.com","subject":"Re: [PATCH] rebase -i: respect core.abbrev for real","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-01-19T22:43:52Z","receivedAt":"2015-01-19T22:43:52Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Jan 19, 2015 at 9:20 AM, Kirill A. Shutemov\n<kirill.shutemov@linux.intel.com> wrote:\n> I have tried to fix this before: see 568950388be2, but it doesn't\n> really work.\n>\n> I don't know how it happend, but that commit makes interactive rebase to\n> respect core.abbrev only during --edit-todo, but not the initial todo\n> list edit.\n>\n> For this time I've included a test-case to avoid this frustration again.\n>\n> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n> ---\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 8197ed29a9ec..a8ffc24ce46b 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n>         )\n>  '\n>\n> +test_expect_success 'respect core.abbrev' '\n> +       git config core.abbrev 12 &&\n> +       set_cat_todo_editor &&\n> +       test_must_fail git rebase -i HEAD~4 >todo-list 2>&1\n\nBroken &&-chain.\n\n> +       test 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n> +'\n> +\n>  test_done\n> --\n> 2.1.4\n"},{"id":"254914","messageId":"1421750552-110075-1-git-send-email-kirill.shutemov@linux.intel.com","threadId":"38401","inReplyTo":"CAPig+cQcYXzRwHMRcKQJf-mWq7d9Kgp7KndnEhFs4_mwgLpiiA@mail.gmail.com","subject":"[PATCHv2] rebase -i: respect core.abbrev for real","fromName":"Kirill A. Shutemov","fromEmail":"kirill.shutemov@linux.intel.com","sentAt":"2015-01-20T10:42:32Z","receivedAt":"2015-01-20T10:42:32Z","isPatch":false,"sender":{"key":"kirill.shutemov@linux.intel.com","avatar":"https://avatars.githubusercontent.com/u/588661?v=4"},"body":"I have tried to fix this before: see 568950388be2, but it doesn't\nreally work.\n\nI don't know how it happend, but that commit makes interactive rebase to\nrespect core.abbrev only during --edit-todo, but not the initial todo\nlist edit.\n\nFor this time I've included a test-case to avoid this frustration again.\n\nSigned-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n---\n v2: fix &&-chain in the test-case\n---\n git-rebase--interactive.sh    | 4 ++--\n t/t3404-rebase-interactive.sh | 7 +++++++\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c6a4629cbc2b..1855e12f1ada 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -962,7 +962,7 @@ else\n \tshortrevisions=$shorthead\n fi\n git rev-list $merges_option --pretty=oneline --abbrev-commit \\\n-\t--abbrev=7 --reverse --left-right --topo-order \\\n+\t--reverse --left-right --topo-order \\\n \t$revisions ${restrict_revision+^$restrict_revision} | \\\n \tsed -n \"s/^>//p\" |\n while read -r shortsha1 rest\n@@ -1020,7 +1020,7 @@ then\n \t\t\t# just the history of its first-parent for others that will\n \t\t\t# be rebasing on top of it\n \t\t\tgit rev-list --parents -1 $rev | cut -d' ' -s -f2 > \"$dropped\"/$rev\n-\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n+\t\t\tshort=$(git rev-list -1 --abbrev-commit $rev)\n \t\t\tsane_grep -v \"^[a-z][a-z]* $short\" <\"$todo\" > \"${todo}2\" ; mv \"${todo}2\" \"$todo\"\n \t\t\trm \"$rewritten\"/$rev\n \t\tfi\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8197ed29a9ec..a31f7e0430e1 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n \t)\n '\n \n+test_expect_success 'respect core.abbrev' '\n+\tgit config core.abbrev 12 &&\n+\tset_cat_todo_editor &&\n+\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n+\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n+'\n+\n test_done\n-- \n2.1.4\n"},{"id":"255062","messageId":"xmqqsif3uwv7.fsf@gitster.dls.corp.google.com","threadId":"38401","inReplyTo":"1421750552-110075-1-git-send-email-kirill.shutemov@linux.intel.com","subject":"Re: [PATCHv2] rebase -i: respect core.abbrev for real","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-22T06:56:28Z","receivedAt":"2015-01-22T06:56:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com> writes:\n\n> I have tried to fix this before: see 568950388be2, but it doesn't\n> really work.\n>\n> I don't know how it happend, but that commit makes interactive rebase to\n> respect core.abbrev only during --edit-todo, but not the initial todo\n> list edit.\n>\n> For this time I've included a test-case to avoid this frustration again.\n\nI suspect that the work that introduced expand/collapse could have\ngone one step further so that all of the short object names you are\ntouching in this patch can stay in the full 40-hex name to avoid\nambiguity.  That is, keep the internal representation always use the\nfull object name, and then always call these three:\n\n    collapse_todo_ids \n    git_sequence_editor\n    expand_todo_ids\n\nin this order.\n\nWouldn't that make the end result a lot cleaner, I wonder?\n\n\n>\n> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n> ---\n>  v2: fix &&-chain in the test-case\n> ---\n>  git-rebase--interactive.sh    | 4 ++--\n>  t/t3404-rebase-interactive.sh | 7 +++++++\n>  2 files changed, 9 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index c6a4629cbc2b..1855e12f1ada 100644\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -962,7 +962,7 @@ else\n>  \tshortrevisions=$shorthead\n>  fi\n>  git rev-list $merges_option --pretty=oneline --abbrev-commit \\\n> -\t--abbrev=7 --reverse --left-right --topo-order \\\n> +\t--reverse --left-right --topo-order \\\n>  \t$revisions ${restrict_revision+^$restrict_revision} | \\\n>  \tsed -n \"s/^>//p\" |\n>  while read -r shortsha1 rest\n> @@ -1020,7 +1020,7 @@ then\n>  \t\t\t# just the history of its first-parent for others that will\n>  \t\t\t# be rebasing on top of it\n>  \t\t\tgit rev-list --parents -1 $rev | cut -d' ' -s -f2 > \"$dropped\"/$rev\n> -\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n> +\t\t\tshort=$(git rev-list -1 --abbrev-commit $rev)\n>  \t\t\tsane_grep -v \"^[a-z][a-z]* $short\" <\"$todo\" > \"${todo}2\" ; mv \"${todo}2\" \"$todo\"\n>  \t\t\trm \"$rewritten\"/$rev\n>  \t\tfi\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 8197ed29a9ec..a31f7e0430e1 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'respect core.abbrev' '\n> +\tgit config core.abbrev 12 &&\n> +\tset_cat_todo_editor &&\n> +\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n> +\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n> +'\n> +\n>  test_done\n"},{"id":"255082","messageId":"1421927415-114643-1-git-send-email-kirill.shutemov@linux.intel.com","threadId":"38401","inReplyTo":"CAPig+cQcYXzRwHMRcKQJf-mWq7d9Kgp7KndnEhFs4_mwgLpiiA@mail.gmail.com","subject":"[PATCHv3] rebase -i: respect core.abbrev for real","fromName":"Kirill A. Shutemov","fromEmail":"kirill.shutemov@linux.intel.com","sentAt":"2015-01-22T11:50:15Z","receivedAt":"2015-01-22T11:50:15Z","isPatch":false,"sender":{"key":"kirill.shutemov@linux.intel.com","avatar":"https://avatars.githubusercontent.com/u/588661?v=4"},"body":"I have tried to fix this before: see 568950388be2, but it doesn't\nreally work.\n\nI don't know how it happend, but that commit makes interactive rebase to\nrespect core.abbrev only during --edit-todo, but not the initial todo\nlist edit.\n\nFor this time I've included a test-case to avoid this frustration again.\n\nThe patch change code to use full 40-hex revision ids for todo actions\neverywhere and collapse them only to show to user.\n\nSigned-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n---\n v3:\n    - use full 40-hex revision ids for todo actions everywhere and collapse them\n      only to show to user;\n v2:\n    - fix &&-chain in the test-case\n---\n git-rebase--interactive.sh    | 17 ++++++++---------\n t/t3404-rebase-interactive.sh |  7 +++++++\n 2 files changed, 15 insertions(+), 9 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c6a4629cbc2b..c96b9847e9fc 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -961,14 +961,13 @@ else\n \trevisions=$onto...$orig_head\n \tshortrevisions=$shorthead\n fi\n-git rev-list $merges_option --pretty=oneline --abbrev-commit \\\n-\t--abbrev=7 --reverse --left-right --topo-order \\\n+git rev-list $merges_option --pretty=oneline --reverse --left-right --topo-order \\\n \t$revisions ${restrict_revision+^$restrict_revision} | \\\n \tsed -n \"s/^>//p\" |\n-while read -r shortsha1 rest\n+while read -r sha1 rest\n do\n \n-\tif test -z \"$keep_empty\" && is_empty_commit $shortsha1 && ! is_merge_commit $shortsha1\n+\tif test -z \"$keep_empty\" && is_empty_commit $sha1 && ! is_merge_commit $sha1\n \tthen\n \t\tcomment_out=\"$comment_char \"\n \telse\n@@ -977,9 +976,8 @@ do\n \n \tif test t != \"$preserve_merges\"\n \tthen\n-\t\tprintf '%s\\n' \"${comment_out}pick $shortsha1 $rest\" >>\"$todo\"\n+\t\tprintf '%s\\n' \"${comment_out}pick $sha1 $rest\" >>\"$todo\"\n \telse\n-\t\tsha1=$(git rev-parse $shortsha1)\n \t\tif test -z \"$rebase_root\"\n \t\tthen\n \t\t\tpreserve=t\n@@ -996,7 +994,7 @@ do\n \t\tif test f = \"$preserve\"\n \t\tthen\n \t\t\ttouch \"$rewritten\"/$sha1\n-\t\t\tprintf '%s\\n' \"${comment_out}pick $shortsha1 $rest\" >>\"$todo\"\n+\t\t\tprintf '%s\\n' \"${comment_out}pick $sha1 $rest\" >>\"$todo\"\n \t\tfi\n \tfi\n done\n@@ -1020,8 +1018,8 @@ then\n \t\t\t# just the history of its first-parent for others that will\n \t\t\t# be rebasing on top of it\n \t\t\tgit rev-list --parents -1 $rev | cut -d' ' -s -f2 > \"$dropped\"/$rev\n-\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n-\t\t\tsane_grep -v \"^[a-z][a-z]* $short\" <\"$todo\" > \"${todo}2\" ; mv \"${todo}2\" \"$todo\"\n+\t\t\tsha1=$(git rev-list -1 $rev)\n+\t\t\tsane_grep -v \"^[a-z][a-z]* $sha1\" <\"$todo\" > \"${todo}2\" ; mv \"${todo}2\" \"$todo\"\n \t\t\trm \"$rewritten\"/$rev\n \t\tfi\n \tdone\n@@ -1054,6 +1052,7 @@ has_action \"$todo\" ||\n \treturn 2\n \n cp \"$todo\" \"$todo\".backup\n+collapse_todo_ids\n git_sequence_editor \"$todo\" ||\n \tdie_abort \"Could not execute editor\"\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8197ed29a9ec..a31f7e0430e1 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n \t)\n '\n \n+test_expect_success 'respect core.abbrev' '\n+\tgit config core.abbrev 12 &&\n+\tset_cat_todo_editor &&\n+\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n+\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n+'\n+\n test_done\n-- \n2.1.4\n"},{"id":"255126","messageId":"xmqq3872tw4j.fsf@gitster.dls.corp.google.com","threadId":"38401","inReplyTo":"1421927415-114643-1-git-send-email-kirill.shutemov@linux.intel.com","subject":"Re: [PATCHv3] rebase -i: respect core.abbrev for real","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-22T20:10:04Z","receivedAt":"2015-01-22T20:10:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com> writes:\n\n> I have tried to fix this before: see 568950388be2, but it doesn't\n> really work.\n>\n> I don't know how it happend, but that commit makes interactive rebase to\n> respect core.abbrev only during --edit-todo, but not the initial todo\n> list edit.\n>\n> For this time I've included a test-case to avoid this frustration again.\n>\n> The patch change code to use full 40-hex revision ids for todo actions\n> everywhere and collapse them only to show to user.\n>\n> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n> ---\n>  v3:\n>     - use full 40-hex revision ids for todo actions everywhere and collapse them\n>       only to show to user;\n\n> @@ -1054,6 +1052,7 @@ has_action \"$todo\" ||\n>  \treturn 2\n>  \n>  cp \"$todo\" \"$todo\".backup\n> +collapse_todo_ids\n>  git_sequence_editor \"$todo\" ||\n>  \tdie_abort \"Could not execute editor\"\n>  \n\nOK, the matching expand_todo_ids is just beyond the horizon of this\npatch context.\n\nI was hoping that with this change we internally operate with the\nfull object names throughout the program, only to show shortened\nones in the editor, but I still see a handful of \"rev-parse --short\"\noutside collapse_todo_ids.  Upon closer inspection, it turns out\nthat they are only about formatting \"# Rebase a..b onto c\", which is\nnever rewritten in transform/collapse/expand_todo_ids, so I think\nall is well.\n\nThanks.\n\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 8197ed29a9ec..a31f7e0430e1 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'respect core.abbrev' '\n> +\tgit config core.abbrev 12 &&\n> +\tset_cat_todo_editor &&\n> +\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n> +\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n> +'\n> +\n>  test_done\n"},{"id":"255130","messageId":"xmqqvbjysh4o.fsf_-_@gitster.dls.corp.google.com","threadId":"38401","inReplyTo":"1421927415-114643-1-git-send-email-kirill.shutemov@linux.intel.com","subject":"RFC \"grep '...\\{m,n\\}\"?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-22T20:19:19Z","receivedAt":"2015-01-22T20:19:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com> writes:\n\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 8197ed29a9ec..a31f7e0430e1 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n>  \t)\n>  '\n>  \n> +test_expect_success 'respect core.abbrev' '\n> +\tgit config core.abbrev 12 &&\n> +\tset_cat_todo_editor &&\n> +\ttest_must_fail git rebase -i HEAD~4 >todo-list &&\n> +\ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n> +'\n\nDocumentation/CodingGuidelines says\n\n - As to use of grep, stick to a subset of BRE (namely, no \\{m,n\\},\n   [::], [==], or [..]) for portability.\n\n   - We do not use \\{m,n\\};\n\n   - We do not use -E;\n\n   - We do not use ? or + (which are \\{0,1\\} and \\{1,\\}\n     respectively in BRE) but that goes without saying as these\n     are ERE elements not BRE (note that \\? and \\+ are not even part\n     of BRE -- making them accessible from BRE is a GNU extension).\n\nbut I see we have multiple hits from \"git grep 'grep .*\\\\{'\" (all in\nthe t/ directory).  I wonder\n\n - if everybody's system is now OK with \\{m,n\\} these days, or\n\n - there are people who are grateful that we stayed away from using\n   \\{m,n\\} but they are not running the tests because their system\n   is too exotic to pass other parts of the test suite.\n\nIf the former, we may want to drop the \\{m,n\\} from the forbidden\nlist.\n"},{"id":"255159","messageId":"CACsJy8Boo4tBNDJjSP5Kv_e6WaE=Fg_dGzOHFDjd5HcX3D3r7A@mail.gmail.com","threadId":"38401","inReplyTo":"xmqqvbjysh4o.fsf_-_@gitster.dls.corp.google.com","subject":"Re: RFC \"grep '...\\{m,n\\}\"?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-01-23T00:39:37Z","receivedAt":"2015-01-23T00:39:37Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Jan 23, 2015 at 3:19 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com> writes:\n>\n>> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n>> index 8197ed29a9ec..a31f7e0430e1 100755\n>> --- a/t/t3404-rebase-interactive.sh\n>> +++ b/t/t3404-rebase-interactive.sh\n>> @@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '\n>>       )\n>>  '\n>>\n>> +test_expect_success 'respect core.abbrev' '\n>> +     git config core.abbrev 12 &&\n>> +     set_cat_todo_editor &&\n>> +     test_must_fail git rebase -i HEAD~4 >todo-list &&\n>> +     test 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n>> +'\n>\n> Documentation/CodingGuidelines says\n>\n>  - As to use of grep, stick to a subset of BRE (namely, no \\{m,n\\},\n>    [::], [==], or [..]) for portability.\n>\n>    - We do not use \\{m,n\\};\n>\n>    - We do not use -E;\n>\n>    - We do not use ? or + (which are \\{0,1\\} and \\{1,\\}\n>      respectively in BRE) but that goes without saying as these\n>      are ERE elements not BRE (note that \\? and \\+ are not even part\n>      of BRE -- making them accessible from BRE is a GNU extension).\n>\n> but I see we have multiple hits from \"git grep 'grep .*\\\\{'\" (all in\n> the t/ directory).  I wonder\n>\n>  - if everybody's system is now OK with \\{m,n\\} these days, or\n>\n>  - there are people who are grateful that we stayed away from using\n>    \\{m,n\\} but they are not running the tests because their system\n>    is too exotic to pass other parts of the test suite.\n\nCan we switch to using git-grep in the test suite and avoid these\nplatform issues? Or maybe switch to test-grep.c that is a wrapper of\ncompat regex to make sure the same feature set is used across\nplatforms.\n-- \nDuy\n"}]}