{"thread":{"id":"48760","subject":"[PATCH v2 0/4] branch -l deprecation revisited","startedAt":"2018-06-22T09:23:32Z","lastAt":"2018-08-30T21:08:00Z","messageCount":14,"participants":["Jeff King","Eric Sunshine","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"350717","messageId":"20180622092327.GA8361@sigill.intra.peff.net","threadId":"48760","inReplyTo":null,"subject":"[PATCH v2 0/4] branch -l deprecation revisited","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T09:23:27Z","receivedAt":"2018-06-22T09:23:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This series replaces the contents of jk/branch-l-0-deprecation,\njk/branch-l-1-removal, and jk/branch-l-2-reincarnation.\n\nIt implements the idea discussed in the subthread in:\n\n  https://public-inbox.org/git/xmqqzi0hety4.fsf@gitster-ct.c.googlers.com/\n\nNamely that \"branch -l\" would warn about deprecation only when we're not\nin list mode, and then we'll eventually jump straight to repurposing\n\"-l\" as \"--list\".\n\nThis gets us to the end result faster, without the annoying \"-l doesn't\nmean anything\" step in between, and without useless warnings on \"git\nbranch -l\". It also sidesteps any pager issues since list mode will not\nprint the warning.\n\nThe first 3 patches would become jk/branch-l-0-deprecate, and then the\nfinal one would become jk/branch-l-1-repurpose or similar. No third step\nrequired.\n\n  [1/4]: t3200: unset core.logallrefupdates when testing reflog creation\n  [2/4]: t: switch \"branch -l\" to \"branch --create-reflog\"\n  [3/4]: branch: deprecate \"-l\" option\n  [4/4]: branch: make \"-l\" a synonym for \"--list\"\n\n Documentation/git-branch.txt |  2 +-\n builtin/branch.c             |  4 ++--\n t/t1410-reflog.sh            |  4 ++--\n t/t3200-branch.sh            | 34 +++++++++++++++++-----------------\n 4 files changed, 22 insertions(+), 22 deletions(-)\n\n-Peff\n"},{"id":"350718","messageId":"20180622092352.GA13573@sigill.intra.peff.net","threadId":"48760","inReplyTo":"20180622092327.GA8361@sigill.intra.peff.net","subject":"[PATCH v2 1/4] t3200: unset core.logallrefupdates when testing reflog creation","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T09:23:52Z","receivedAt":"2018-06-22T09:23:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This test checks that the \"-l\" option creates a reflog. But\nin fact we'd create one even without it, since the default\nin a non-bare repository is to do so. Let's unset the config\nso we can be sure our \"-l\" option is kicking in.\n\nNote that we can't do this with test_config, since that\nwould leave the variable unset after our test finishes,\nconfusing downstream tests (the helper is not not smart\nenough to restore the previous value, and just always runs\ntest_unconfig).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nSame as before.\n\n t/t3200-branch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 08467982f6..ec56176093 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -51,7 +51,7 @@ $ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbran\n EOF\n test_expect_success 'git branch -l d/e/f should create a branch and a log' '\n \tGIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n-\tgit branch -l d/e/f &&\n+\tgit -c core.logallrefupdates=false branch -l d/e/f &&\n \ttest_path_is_file .git/refs/heads/d/e/f &&\n \ttest_path_is_file .git/logs/refs/heads/d/e/f &&\n \ttest_cmp expect .git/logs/refs/heads/d/e/f\n-- \n2.18.0.539.gcf23d6d4f1\n\n"},{"id":"350719","messageId":"20180622092359.GB13573@sigill.intra.peff.net","threadId":"48760","inReplyTo":"20180622092327.GA8361@sigill.intra.peff.net","subject":"[PATCH v2 2/4] t: switch \"branch -l\" to \"branch --create-reflog\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T09:23:59Z","receivedAt":"2018-06-22T09:24:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"In preparation for deprecating \"-l\", let's make sure we're\nusing the recommended option ourselves.\n\nThis patch just mechanically converts \"branch -l\" to \"branch\n--create-reflog\".  Note that with the exception of the\nactual \"--create-reflog\" test, we could actually remove \"-l\"\nentirely from most of these callers. That's because these\ndays core.logallrefupdates defaults to true in a non-bare\nrepository.\n\nI've left them in place, though, since they serve to\ndocument the expectation of the test, even if they are\ntechnically noops.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nSame as before.\n\n t/t1410-reflog.sh |  4 ++--\n t/t3200-branch.sh | 34 +++++++++++++++++-----------------\n 2 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 553e26d9ce..8293131001 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -339,8 +339,8 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '\n '\n \n test_expect_success 'reflog expire operates on symref not referrent' '\n-\tgit branch -l the_symref &&\n-\tgit branch -l referrent &&\n+\tgit branch --create-reflog the_symref &&\n+\tgit branch --create-reflog referrent &&\n \tgit update-ref referrent HEAD &&\n \tgit symbolic-ref refs/heads/the_symref refs/heads/referrent &&\n \ttest_when_finished \"rm -f .git/refs/heads/referrent.lock\" &&\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex ec56176093..dbca665da4 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -49,9 +49,9 @@ test_expect_success 'git branch HEAD should fail' '\n cat >expect <<EOF\n $ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n EOF\n-test_expect_success 'git branch -l d/e/f should create a branch and a log' '\n+test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '\n \tGIT_COMMITTER_DATE=\"2005-05-26 23:30\" \\\n-\tgit -c core.logallrefupdates=false branch -l d/e/f &&\n+\tgit -c core.logallrefupdates=false branch --create-reflog d/e/f &&\n \ttest_path_is_file .git/refs/heads/d/e/f &&\n \ttest_path_is_file .git/logs/refs/heads/d/e/f &&\n \ttest_cmp expect .git/logs/refs/heads/d/e/f\n@@ -82,7 +82,7 @@ test_expect_success 'git branch -m dumps usage' '\n \n test_expect_success 'git branch -m m broken_symref should work' '\n \ttest_when_finished \"git branch -D broken_symref\" &&\n-\tgit branch -l m &&\n+\tgit branch --create-reflog m &&\n \tgit symbolic-ref refs/heads/broken_symref refs/heads/i_am_broken &&\n \tgit branch -m m broken_symref &&\n \tgit reflog exists refs/heads/broken_symref &&\n@@ -90,13 +90,13 @@ test_expect_success 'git branch -m m broken_symref should work' '\n '\n \n test_expect_success 'git branch -m m m/m should work' '\n-\tgit branch -l m &&\n+\tgit branch --create-reflog m &&\n \tgit branch -m m m/m &&\n \tgit reflog exists refs/heads/m/m\n '\n \n test_expect_success 'git branch -m n/n n should work' '\n-\tgit branch -l n/n &&\n+\tgit branch --create-reflog n/n &&\n \tgit branch -m n/n n &&\n \tgit reflog exists refs/heads/n\n '\n@@ -378,9 +378,9 @@ mv .git/config-saved .git/config\n git config branch.s/s.dummy Hello\n \n test_expect_success 'git branch -m s/s s should work when s/t is deleted' '\n-\tgit branch -l s/s &&\n+\tgit branch --create-reflog s/s &&\n \tgit reflog exists refs/heads/s/s &&\n-\tgit branch -l s/t &&\n+\tgit branch --create-reflog s/t &&\n \tgit reflog exists refs/heads/s/t &&\n \tgit branch -d s/t &&\n \tgit branch -m s/s s &&\n@@ -444,7 +444,7 @@ test_expect_success 'git branch --copy dumps usage' '\n '\n \n test_expect_success 'git branch -c d e should work' '\n-\tgit branch -l d &&\n+\tgit branch --create-reflog d &&\n \tgit reflog exists refs/heads/d &&\n \tgit config branch.d.dummy Hello &&\n \tgit branch -c d e &&\n@@ -459,7 +459,7 @@ test_expect_success 'git branch -c d e should work' '\n '\n \n test_expect_success 'git branch --copy is a synonym for -c' '\n-\tgit branch -l copy &&\n+\tgit branch --create-reflog copy &&\n \tgit reflog exists refs/heads/copy &&\n \tgit config branch.copy.dummy Hello &&\n \tgit branch --copy copy copy-to &&\n@@ -486,7 +486,7 @@ test_expect_success 'git branch -c ee ef should copy ee to create branch ef' '\n '\n \n test_expect_success 'git branch -c f/f g/g should work' '\n-\tgit branch -l f/f &&\n+\tgit branch --create-reflog f/f &&\n \tgit reflog exists refs/heads/f/f &&\n \tgit config branch.f/f.dummy Hello &&\n \tgit branch -c f/f g/g &&\n@@ -497,7 +497,7 @@ test_expect_success 'git branch -c f/f g/g should work' '\n '\n \n test_expect_success 'git branch -c m2 m2 should work' '\n-\tgit branch -l m2 &&\n+\tgit branch --create-reflog m2 &&\n \tgit reflog exists refs/heads/m2 &&\n \tgit config branch.m2.dummy Hello &&\n \tgit branch -c m2 m2 &&\n@@ -506,18 +506,18 @@ test_expect_success 'git branch -c m2 m2 should work' '\n '\n \n test_expect_success 'git branch -c zz zz/zz should fail' '\n-\tgit branch -l zz &&\n+\tgit branch --create-reflog zz &&\n \tgit reflog exists refs/heads/zz &&\n \ttest_must_fail git branch -c zz zz/zz\n '\n \n test_expect_success 'git branch -c b/b b should fail' '\n-\tgit branch -l b/b &&\n+\tgit branch --create-reflog b/b &&\n \ttest_must_fail git branch -c b/b b\n '\n \n test_expect_success 'git branch -C o/q o/p should work when o/p exists' '\n-\tgit branch -l o/q &&\n+\tgit branch --create-reflog o/q &&\n \tgit reflog exists refs/heads/o/q &&\n \tgit reflog exists refs/heads/o/p &&\n \tgit branch -C o/q o/p\n@@ -570,10 +570,10 @@ test_expect_success 'git branch -C master5 master5 should work when master is ch\n '\n \n test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '\n-\tgit branch -l cd &&\n+\tgit branch --create-reflog cd &&\n \tgit reflog exists refs/heads/cd &&\n \tgit config branch.cd.dummy CD &&\n-\tgit branch -l ab &&\n+\tgit branch --create-reflog ab &&\n \tgit reflog exists refs/heads/ab &&\n \tgit config branch.ab.dummy AB &&\n \tgit branch -C ab cd &&\n@@ -685,7 +685,7 @@ test_expect_success 'renaming a symref is not allowed' '\n '\n \n test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '\n-\tgit branch -l u &&\n+\tgit branch --create-reflog u &&\n \tmv .git/logs/refs/heads/u real-u &&\n \tln -s real-u .git/logs/refs/heads/u &&\n \ttest_must_fail git branch -m u v\n-- \n2.18.0.539.gcf23d6d4f1\n\n"},{"id":"350720","messageId":"20180622092414.GC13573@sigill.intra.peff.net","threadId":"48760","inReplyTo":"20180622092327.GA8361@sigill.intra.peff.net","subject":"[PATCH v2 3/4] branch: deprecate \"-l\" option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T09:24:14Z","receivedAt":"2018-06-22T09:24:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The \"-l\" option is short for \"--create-reflog\". This has\ncaused much confusion over the years. Most people expect it\nto work as \"--list\", because that would match the other\n\"mode\" options like -d/--delete and -m/--move, as well as\nthe similar -l/--list option of git-tag.\n\nAdding to the confusion, using \"-l\" _appears_ to work as\n\"--list\" in some cases:\n\n  $ git branch -l\n  * master\n\nbecause the branch command defaults to listing (so even\ntrying to specify --list in the command above is redundant).\nBut that may bite the user later when they add a pattern,\nlike:\n\n  $ git branch -l foo\n\nwhich does not return an empty list, but in fact creates a\nnew branch (with a reflog, naturally) called \"foo\".\n\nIt's also probably quite uncommon for people to actually use\n\"-l\" to create a reflog. Since 0bee591869 (Enable reflogs by\ndefault in any repository with a working directory.,\n2006-12-14), this is the default in non-bare repositories.\nSo it's rather unfortunate that the feature squats on the\nshort-and-sweet \"-l\" (which was only added in 3a4b3f269c\n(Create/delete branch ref logs., 2006-05-19), meaning there\nwere only 7 months where it was actually useful).\n\nLet's deprecate \"-l\" in hopes of eventually re-purposing it\nto \"--list\".\n\nNote that we issue the warning only when we're not in list\nmode. This means that people for whom it works as a happy\naccident, namely:\n\n  $ git branch -l\n  master\n\nwon't see the warning at all. And when we eventually switch\nto it meaning \"--list\", that will just continue to work.\n\nWe do the issue the warning for these important cases:\n\n  - when we are actually creating a branch, in case the user\n    really did mean it as \"--create-reflog\"\n\n  - when we are in some _other_ mode, like deletion. There\n    the \"-l\" is a noop for now, but it will eventually\n    conflict with any other mode request, and the user\n    should be told that this is changing.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis one has the interesting changes in this re-roll.\n\n Documentation/git-branch.txt |  3 ++-\n builtin/branch.c             | 22 +++++++++++++++++++++-\n 2 files changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 02eccbb931..1072ca0eb6 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -91,7 +91,6 @@ OPTIONS\n -D::\n \tShortcut for `--delete --force`.\n \n--l::\n --create-reflog::\n \tCreate the branch's reflog.  This activates recording of\n \tall changes made to the branch ref, enabling use of date\n@@ -101,6 +100,8 @@ OPTIONS\n \tThe negated form `--no-create-reflog` only overrides an earlier\n \t`--create-reflog`, but currently does not negate the setting of\n \t`core.logAllRefUpdates`.\n++\n+The `-l` option is a deprecated synonym for `--create-reflog`.\n \n -f::\n --force::\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 5217ba3bde..ed4c093747 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -36,6 +36,7 @@ static const char * const builtin_branch_usage[] = {\n \n static const char *head;\n static struct object_id head_oid;\n+static int used_deprecated_reflog_option;\n \n static int branch_use_color = -1;\n static char branch_colors[][COLOR_MAXLEN] = {\n@@ -573,6 +574,14 @@ static int edit_branch_description(const char *branch_name)\n \treturn 0;\n }\n \n+static int deprecated_reflog_option_cb(const struct option *opt,\n+\t\t\t\t       const char *arg, int unset)\n+{\n+\tused_deprecated_reflog_option = 1;\n+\t*(int *)opt->value = !unset;\n+\treturn 0;\n+}\n+\n int cmd_branch(int argc, const char **argv, const char *prefix)\n {\n \tint delete = 0, rename = 0, copy = 0, force = 0, list = 0;\n@@ -615,7 +624,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('c', \"copy\", &copy, N_(\"copy a branch and its reflog\"), 1),\n \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n \t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n-\t\tOPT_BOOL('l', \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n+\t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n+\t\t{\n+\t\t\tOPTION_CALLBACK, 'l', NULL, &reflog, NULL,\n+\t\t\tN_(\"deprecated synonym for --create-reflog\"),\n+\t\t\tPARSE_OPT_NOARG | PARSE_OPT_HIDDEN,\n+\t\t\tdeprecated_reflog_option_cb\n+\t\t},\n \t\tOPT_BOOL(0, \"edit-description\", &edit_description,\n \t\t\t N_(\"edit the description for the branch\")),\n \t\tOPT__FORCE(&force, N_(\"force creation, move/rename, deletion\"), PARSE_OPT_NOCOMPLETE),\n@@ -688,6 +703,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n+\tif (used_deprecated_reflog_option && !list) {\n+\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n+\t\twarning(\"it will be removed in a future version of Git\");\n+\t}\n+\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n-- \n2.18.0.539.gcf23d6d4f1\n\n"},{"id":"350721","messageId":"20180622092459.GD13573@sigill.intra.peff.net","threadId":"48760","inReplyTo":"20180622092327.GA8361@sigill.intra.peff.net","subject":"[PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T09:24:59Z","receivedAt":"2018-06-22T09:25:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The other \"mode\" options of git-branch have short-option\naliases that are easy to type (e.g., \"-d\" and \"-m\"). Let's\ngive \"--list\" the same treatment.\n\nThis also makes it consistent with the similar \"git tag -l\"\noption.\n\nWe didn't do this originally because \"--create-reflog\" was\nsquatting on the \"-l\" option. Now that we've deprecated that\nuse for long enough, we can make the switch.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis one is mostly a squash of the remove/reincarnate steps from the\nprevious iteration. I also noticed that my original forgot to update the\ndocumentation, which this patch does.\n\n Documentation/git-branch.txt |  3 +--\n builtin/branch.c             | 22 +---------------------\n 2 files changed, 2 insertions(+), 23 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 1072ca0eb6..fc88e984e1 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -100,8 +100,6 @@ OPTIONS\n \tThe negated form `--no-create-reflog` only overrides an earlier\n \t`--create-reflog`, but currently does not negate the setting of\n \t`core.logAllRefUpdates`.\n-+\n-The `-l` option is a deprecated synonym for `--create-reflog`.\n \n -f::\n --force::\n@@ -156,6 +154,7 @@ This option is only applicable in non-verbose mode.\n --all::\n \tList both remote-tracking branches and local branches.\n \n+-l::\n --list::\n \tList branches.  With optional `<pattern>...`, e.g. `git\n \tbranch --list 'maint-*'`, list only the branches that match\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex ed4c093747..c1662e3db3 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -36,7 +36,6 @@ static const char * const builtin_branch_usage[] = {\n \n static const char *head;\n static struct object_id head_oid;\n-static int used_deprecated_reflog_option;\n \n static int branch_use_color = -1;\n static char branch_colors[][COLOR_MAXLEN] = {\n@@ -574,14 +573,6 @@ static int edit_branch_description(const char *branch_name)\n \treturn 0;\n }\n \n-static int deprecated_reflog_option_cb(const struct option *opt,\n-\t\t\t\t       const char *arg, int unset)\n-{\n-\tused_deprecated_reflog_option = 1;\n-\t*(int *)opt->value = !unset;\n-\treturn 0;\n-}\n-\n int cmd_branch(int argc, const char **argv, const char *prefix)\n {\n \tint delete = 0, rename = 0, copy = 0, force = 0, list = 0;\n@@ -623,14 +614,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('M', NULL, &rename, N_(\"move/rename a branch, even if target exists\"), 2),\n \t\tOPT_BIT('c', \"copy\", &copy, N_(\"copy a branch and its reflog\"), 1),\n \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n-\t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n+\t\tOPT_BOOL('l', \"list\", &list, N_(\"list branch names\")),\n \t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n-\t\t{\n-\t\t\tOPTION_CALLBACK, 'l', NULL, &reflog, NULL,\n-\t\t\tN_(\"deprecated synonym for --create-reflog\"),\n-\t\t\tPARSE_OPT_NOARG | PARSE_OPT_HIDDEN,\n-\t\t\tdeprecated_reflog_option_cb\n-\t\t},\n \t\tOPT_BOOL(0, \"edit-description\", &edit_description,\n \t\t\t N_(\"edit the description for the branch\")),\n \t\tOPT__FORCE(&force, N_(\"force creation, move/rename, deletion\"), PARSE_OPT_NOCOMPLETE),\n@@ -703,11 +688,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n-\tif (used_deprecated_reflog_option && !list) {\n-\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n-\t\twarning(\"it will be removed in a future version of Git\");\n-\t}\n-\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n-- \n2.18.0.539.gcf23d6d4f1\n"},{"id":"350771","messageId":"20180622223428.GA23440@flurp.local","threadId":"48760","inReplyTo":"20180622092414.GC13573@sigill.intra.peff.net","subject":"Re: [PATCH v2 3/4] branch: deprecate \"-l\" option","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-06-22T22:34:28Z","receivedAt":"2018-06-22T22:34:38Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 22, 2018 at 05:24:14AM -0400, Jeff King wrote:\n> Let's deprecate \"-l\" in hopes of eventually re-purposing it\n> to \"--list\".\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> diff --git a/builtin/branch.c b/builtin/branch.c\n> @@ -36,6 +36,7 @@ static const char * const builtin_branch_usage[] = {\n> +static int used_deprecated_reflog_option;\n> @@ -573,6 +574,14 @@ static int edit_branch_description(const char *branch_nam> +static int deprecated_reflog_option_cb(const struct option *opt,\n> +\t\t\t\t       const char *arg, int unset)\n> +{\n> +\tused_deprecated_reflog_option = 1;\n> +\t*(int *)opt->value = !unset;\n> +\treturn 0;\n> +}\n> @@ -615,7 +624,13 @@ int cmd_branch(int argc, const char **argv, const char *p> +\t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n> +\t\t{\n> +\t\t\tOPTION_CALLBACK, 'l', NULL, &reflog, NULL,\n> +\t\t\tN_(\"deprecated synonym for --create-reflog\"),\n> +\t\t\tPARSE_OPT_NOARG | PARSE_OPT_HIDDEN,\n> +\t\t\tdeprecated_reflog_option_cb\n> @@ -688,6 +703,11 @@ int cmd_branch(int argc, const char **argv, const char *p> +\tif (used_deprecated_reflog_option && !list) {\n> +\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> +\t\twarning(\"it will be removed in a future version of Git\");\n> +\t}\n\nI wonder if it would be better and cleaner to limit the visibility of\nthis change to cmd_branch(), rather than spreading it across a global\nvariable, a callback function, and cmd_branch(). Perhaps, like this:\n\n--- >8 ---\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 5217ba3bde..893e5f481a 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -584,6 +584,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tint icase = 0;\n \tstatic struct ref_sorting *sorting = NULL, **sorting_tail = &sorting;\n \tstruct ref_format format = REF_FORMAT_INIT;\n+\tint deprecated_reflog_option = 0;\n \n \tstruct option options[] = {\n \t\tOPT_GROUP(N_(\"Generic options\")),\n@@ -615,7 +616,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('c', \"copy\", &copy, N_(\"copy a branch and its reflog\"), 1),\n \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n \t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n-\t\tOPT_BOOL('l', \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n+\t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n+\t\tOPT_HIDDEN_BOOL('l', NULL, &deprecated_reflog_option,\n+\t\t\t\tN_(\"deprecated synonym for --create-reflog\")),\n \t\tOPT_BOOL(0, \"edit-description\", &edit_description,\n \t\t\t N_(\"edit the description for the branch\")),\n \t\tOPT__FORCE(&force, N_(\"force creation, move/rename, deletion\"), PARSE_OPT_NOCOMPLETE),\n@@ -688,6 +691,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n+\tif (deprecated_reflog_option && !list) {\n+\t\treflog = 1;\n+\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n+\t\twarning(\"it will be removed in a future version of Git\");\n+\t}\n+\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n--- >8 ---\n"},{"id":"350773","messageId":"20180622224349.GA7463@sigill.intra.peff.net","threadId":"48760","inReplyTo":"20180622223428.GA23440@flurp.local","subject":"Re: [PATCH v2 3/4] branch: deprecate \"-l\" option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-22T22:43:50Z","receivedAt":"2018-06-22T22:44:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 22, 2018 at 06:34:28PM -0400, Eric Sunshine wrote:\n\n> I wonder if it would be better and cleaner to limit the visibility of\n> this change to cmd_branch(), rather than spreading it across a global\n> variable, a callback function, and cmd_branch(). Perhaps, like this:\n\nI'd prefer that, too, but...\n\n> @@ -615,7 +616,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_BIT('c', \"copy\", &copy, N_(\"copy a branch and its reflog\"), 1),\n>  \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n>  \t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n> -\t\tOPT_BOOL('l', \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n> +\t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n> +\t\tOPT_HIDDEN_BOOL('l', NULL, &deprecated_reflog_option,\n> +\t\t\t\tN_(\"deprecated synonym for --create-reflog\")),\n\nNow that \"-l\" processing is delayed, it interacts in a funny way with\n--create-reflog. For instance:\n\n  git branch -l --no-create-reflog\n\ncurrently cancels itself out, but after your patch would enable reflogs.\n\nThis is a pretty niche corner case, but I think it's important not to\nchange any behavior during the deprecation period. You'd have to do\nsomething more like:\n\n  reflog = -1;\n\n  ... parse options ...\n\n  if (deprecated_reflog_option && !list)\n    warning(...);\n  if (reflog < 0 && deprecated_reflog_option)\n    reflog = 1;\n\nI think that probably works in all cases, but I actually think the\nexisting callback/global is less invasive.\n\n-Peff\n"},{"id":"356958","messageId":"87wos8cjt8.fsf@evledraar.gmail.com","threadId":"48760","inReplyTo":"20180622092459.GD13573@sigill.intra.peff.net","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-08-30T08:58:27Z","receivedAt":"2018-08-30T08:58:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Jun 22 2018, Jeff King wrote:\n\n> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n> index 1072ca0eb6..fc88e984e1 100644\n> --- a/Documentation/git-branch.txt\n> +++ b/Documentation/git-branch.txt\n> @@ -100,8 +100,6 @@ OPTIONS\n>  \tThe negated form `--no-create-reflog` only overrides an earlier\n>  \t`--create-reflog`, but currently does not negate the setting of\n>  \t`core.logAllRefUpdates`.\n> -+\n> -The `-l` option is a deprecated synonym for `--create-reflog`.\n>\n>  -f::\n>  --force::\n> @@ -156,6 +154,7 @@ This option is only applicable in non-verbose mode.\n>  --all::\n>  \tList both remote-tracking branches and local branches.\n>\n> +-l::\n>  --list::\n>  \tList branches.  With optional `<pattern>...`, e.g. `git\n>  \tbranch --list 'maint-*'`, list only the branches that match\n\nI think it's better to have something like this on top:\n\n    diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n    index 5552dfcec3..a03cb1ebc9 100644\n    --- a/Documentation/git-branch.txt\n    +++ b/Documentation/git-branch.txt\n    @@ -163,6 +163,11 @@ This option is only applicable in non-verbose mode.\n     This should not be confused with `git branch -l <branchname>`,\n     which creates a branch named `<branchname>` with a reflog.\n     See `--create-reflog` above for details.\n    ++\n    +\n    +Until Git version 2.20 `-l` was the short form of\n    +`--create-reflog`. As of version 2.19 using it would warn about a\n    +future deprecation.\n\n     -v::\n     -vv::\n\nWe're about to release 2.19 with the deprecation (but it still means\n--create-reflog), this patch is sitting in next.\n\nSimilarly to your 2/4 we'll have some scripts in the wild using -l,\nlet's at least give them a headsup that this changed in the docs, as\nwell as anyone on >=2.20 (or whenever we plan to merge this down from\nnext) a warning that if they're writing some script they can't rely on\n`-l` for older clients.\n"},{"id":"356998","messageId":"xmqq4lfb667c.fsf@gitster-ct.c.googlers.com","threadId":"48760","inReplyTo":"87wos8cjt8.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-30T18:48:55Z","receivedAt":"2018-08-30T18:48:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n>> +-l::\n>>  --list::\n>>  \tList branches.  With optional `<pattern>...`, e.g. `git\n>>  \tbranch --list 'maint-*'`, list only the branches that match\n>\n> I think it's better to have something like this on top:\n>\n>     diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n>     index 5552dfcec3..a03cb1ebc9 100644\n>     --- a/Documentation/git-branch.txt\n>     +++ b/Documentation/git-branch.txt\n>     @@ -163,6 +163,11 @@ This option is only applicable in non-verbose mode.\n>      This should not be confused with `git branch -l <branchname>`,\n>      which creates a branch named `<branchname>` with a reflog.\n>      See `--create-reflog` above for details.\n>     ++\n>     +\n>     +Until Git version 2.20 `-l` was the short form of\n>     +`--create-reflog`. As of version 2.19 using it would warn about a\n>     +future deprecation.\n\nDoesn't your patch show a more grave issue with the current state of\n'next'?\n\nThe sentence in the pre-context in your suggested patch says that\n\"--list\" should not be confused with \"git branch -l <branchname>\",\nbut --list and -l are now synonyms in the new world order.\n\nWorse yet, '-l' is no longer a way to create the branch with a\nreflog; in the new world, you would say \"--create-reflog\" if you\nwant to do so.  \"git branch -l foo\" would list branches that match\nthat pattern 'foo'.\n\nIn the SYNOPSIS section we still see \"[-l]\" listed; that also must\nbe replaced with \"--create-reflog\", or just dropped, as that is the\ndefault.\n\nI do not know if the documentation that is shipped in 2.20 should\ntalk about how the old world looked like, though.  `-l` was a short\nfor `--create-reflog` is worth saying, but I do not see much value\nin talking about the warning given in 2.19.\n\nThanks.\n\n"},{"id":"357010","messageId":"87in3rd422.fsf@evledraar.gmail.com","threadId":"48760","inReplyTo":"xmqq4lfb667c.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-08-30T19:53:25Z","receivedAt":"2018-08-30T19:53:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Aug 30 2018, Junio C Hamano wrote:\n\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>>> +-l::\n>>>  --list::\n>>>  \tList branches.  With optional `<pattern>...`, e.g. `git\n>>>  \tbranch --list 'maint-*'`, list only the branches that match\n>>\n>> I think it's better to have something like this on top:\n>>\n>>     diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n>>     index 5552dfcec3..a03cb1ebc9 100644\n>>     --- a/Documentation/git-branch.txt\n>>     +++ b/Documentation/git-branch.txt\n>>     @@ -163,6 +163,11 @@ This option is only applicable in non-verbose mode.\n>>      This should not be confused with `git branch -l <branchname>`,\n>>      which creates a branch named `<branchname>` with a reflog.\n>>      See `--create-reflog` above for details.\n>>     ++\n>>     +\n>>     +Until Git version 2.20 `-l` was the short form of\n>>     +`--create-reflog`. As of version 2.19 using it would warn about a\n>>     +future deprecation.\n>\n> Doesn't your patch show a more grave issue with the current state of\n> 'next'?\n>\n> The sentence in the pre-context in your suggested patch says that\n> \"--list\" should not be confused with \"git branch -l <branchname>\",\n> but --list and -l are now synonyms in the new world order.\n>\n> Worse yet, '-l' is no longer a way to create the branch with a\n> reflog; in the new world, you would say \"--create-reflog\" if you\n> want to do so.  \"git branch -l foo\" would list branches that match\n> that pattern 'foo'.\n>\n> In the SYNOPSIS section we still see \"[-l]\" listed; that also must\n> be replaced with \"--create-reflog\", or just dropped, as that is the\n> default.\n\nOh yes, it seems all of the doc indeed wasn't updated!\n\n> I do not know if the documentation that is shipped in 2.20 should\n> talk about how the old world looked like, though.  `-l` was a short\n> for `--create-reflog` is worth saying, but I do not see much value\n> in talking about the warning given in 2.19.\n\nI'm anticipating that there will be users in the wild with similar -l\ninvocations, noting this helps them, because they'll be wondering what\nsome script that does \"git branch -l <name>\" is trying to do while\nreading our docs.\n\nBoth our command-line options (plumbing or otherwise) and file various\nformats (e.g. I had a similar mention of version differences in my\nrecent skipList patches) can be expected to be used across multiple git\nversions, by users who most likely are only browsing the latest version\nof the docs, not comparing how the manpage looked like in multiple git\nversions to see if an option meant something different, or if a format\nwas documented as behaving differently.\n"},{"id":"357012","messageId":"20180830200452.GB22407@sigill.intra.peff.net","threadId":"48760","inReplyTo":"87in3rd422.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-08-30T20:04:53Z","receivedAt":"2018-08-30T20:04:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 30, 2018 at 09:53:25PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> > In the SYNOPSIS section we still see \"[-l]\" listed; that also must\n> > be replaced with \"--create-reflog\", or just dropped, as that is the\n> > default.\n> \n> Oh yes, it seems all of the doc indeed wasn't updated!\n\nSorry, this is my fault. Patch is below (which would go on top of\njk/branch-l-1-repurpose).\n\n> > I do not know if the documentation that is shipped in 2.20 should\n> > talk about how the old world looked like, though.  `-l` was a short\n> > for `--create-reflog` is worth saying, but I do not see much value\n> > in talking about the warning given in 2.19.\n> \n> I'm anticipating that there will be users in the wild with similar -l\n> invocations, noting this helps them, because they'll be wondering what\n> some script that does \"git branch -l <name>\" is trying to do while\n> reading our docs.\n\nI don't have a strong opinion either way. If we do mention it, it should\nprobably be short (\"Until Git v2.20, the `-l` option was a synonym for\n`--create-reflog\").\n\n-Peff\n\n-- >8 --\nSubject: [PATCH] doc/git-branch: remove obsolete \"-l\" references\n\nThe previous commit switched \"-l\" to meaning \"--list\", but a\nfew vestiges of its prior meaning as \"--create-reflog\"\nremained:\n\n  - the synopsis mentioned \"-l\" when creating a new branch;\n    we can drop this entirely, as it has been the default\n    for years\n\n  - the --list command mentions the unfortunate \"-l\"\n    confusion, but we've now fixed that\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/git-branch.txt | 6 +-----\n 1 file changed, 1 insertion(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 5552dfcec3..bf5316ffa9 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -14,7 +14,7 @@ SYNOPSIS\n \t[(--merged | --no-merged) [<commit>]]\n \t[--contains [<commit]] [--no-contains [<commit>]]\n \t[--points-at <object>] [--format=<format>] [<pattern>...]\n-'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]\n+'git branch' [--track | --no-track] [-f] <branchname> [<start-point>]\n 'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]\n 'git branch' --unset-upstream [<branchname>]\n 'git branch' (-m | -M) [<oldbranch>] <newbranch>\n@@ -159,10 +159,6 @@ This option is only applicable in non-verbose mode.\n \tList branches.  With optional `<pattern>...`, e.g. `git\n \tbranch --list 'maint-*'`, list only the branches that match\n \tthe pattern(s).\n-+\n-This should not be confused with `git branch -l <branchname>`,\n-which creates a branch named `<branchname>` with a reflog.\n-See `--create-reflog` above for details.\n \n -v::\n -vv::\n-- \n2.19.0.rc1.546.g3fcb3c0d7c\n\n"},{"id":"357022","messageId":"xmqqo9dj4mym.fsf@gitster-ct.c.googlers.com","threadId":"48760","inReplyTo":"20180830200452.GB22407@sigill.intra.peff.net","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-30T20:29:53Z","receivedAt":"2018-08-30T20:29:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Aug 30, 2018 at 09:53:25PM +0200, Ævar Arnfjörð Bjarmason wrote:\n>\n>> > In the SYNOPSIS section we still see \"[-l]\" listed; that also must\n>> > be replaced with \"--create-reflog\", or just dropped, as that is the\n>> > default.\n>> \n>> Oh yes, it seems all of the doc indeed wasn't updated!\n>\n> Sorry, this is my fault. Patch is below (which would go on top of\n> jk/branch-l-1-repurpose).\n\nHeh, reviewers who did not notice share the same blame.  The patch\nlooks good.  Thanks for a quick update.\n\n>> > I do not know if the documentation that is shipped in 2.20 should\n>> > talk about how the old world looked like, though.  `-l` was a short\n>> > for `--create-reflog` is worth saying, but I do not see much value\n>> > in talking about the warning given in 2.19.\n>> \n>> I'm anticipating that there will be users in the wild with similar -l\n>> invocations, noting this helps them, because they'll be wondering what\n>> some script that does \"git branch -l <name>\" is trying to do while\n>> reading our docs.\n>\n> I don't have a strong opinion either way. If we do mention it, it should\n> probably be short (\"Until Git v2.20, the `-l` option was a synonym for\n> `--create-reflog\").\n\nI agree that the short one would of course be good.  I am on the\nfence about mentioning the warning only given in 2.19.\n\n> -- >8 --\n> Subject: [PATCH] doc/git-branch: remove obsolete \"-l\" references\n>\n> The previous commit switched \"-l\" to meaning \"--list\", but a\n> few vestiges of its prior meaning as \"--create-reflog\"\n> remained:\n>\n>   - the synopsis mentioned \"-l\" when creating a new branch;\n>     we can drop this entirely, as it has been the default\n>     for years\n>\n>   - the --list command mentions the unfortunate \"-l\"\n>     confusion, but we've now fixed that\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  Documentation/git-branch.txt | 6 +-----\n>  1 file changed, 1 insertion(+), 5 deletions(-)\n>\n> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n> index 5552dfcec3..bf5316ffa9 100644\n> --- a/Documentation/git-branch.txt\n> +++ b/Documentation/git-branch.txt\n> @@ -14,7 +14,7 @@ SYNOPSIS\n>  \t[(--merged | --no-merged) [<commit>]]\n>  \t[--contains [<commit]] [--no-contains [<commit>]]\n>  \t[--points-at <object>] [--format=<format>] [<pattern>...]\n> -'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>]\n> +'git branch' [--track | --no-track] [-f] <branchname> [<start-point>]\n>  'git branch' (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]\n>  'git branch' --unset-upstream [<branchname>]\n>  'git branch' (-m | -M) [<oldbranch>] <newbranch>\n> @@ -159,10 +159,6 @@ This option is only applicable in non-verbose mode.\n>  \tList branches.  With optional `<pattern>...`, e.g. `git\n>  \tbranch --list 'maint-*'`, list only the branches that match\n>  \tthe pattern(s).\n> -+\n> -This should not be confused with `git branch -l <branchname>`,\n> -which creates a branch named `<branchname>` with a reflog.\n> -See `--create-reflog` above for details.\n>  \n>  -v::\n>  -vv::\n"},{"id":"357025","messageId":"20180830205033.GA27399@sigill.intra.peff.net","threadId":"48760","inReplyTo":"xmqqo9dj4mym.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-08-30T20:50:34Z","receivedAt":"2018-08-30T20:50:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 30, 2018 at 01:29:53PM -0700, Junio C Hamano wrote:\n\n> >> > I do not know if the documentation that is shipped in 2.20 should\n> >> > talk about how the old world looked like, though.  `-l` was a short\n> >> > for `--create-reflog` is worth saying, but I do not see much value\n> >> > in talking about the warning given in 2.19.\n> >> \n> >> I'm anticipating that there will be users in the wild with similar -l\n> >> invocations, noting this helps them, because they'll be wondering what\n> >> some script that does \"git branch -l <name>\" is trying to do while\n> >> reading our docs.\n> >\n> > I don't have a strong opinion either way. If we do mention it, it should\n> > probably be short (\"Until Git v2.20, the `-l` option was a synonym for\n> > `--create-reflog\").\n> \n> I agree that the short one would of course be good.  I am on the\n> fence about mentioning the warning only given in 2.19.\n\nYeah, I was confused about that part of the thread. Is there something\nproposed to (additionally) go into v2.19? Ævar, can you elaborate?\n\n-Peff\n"},{"id":"357027","messageId":"87h8jbd0lv.fsf@evledraar.gmail.com","threadId":"48760","inReplyTo":"20180830205033.GA27399@sigill.intra.peff.net","subject":"Re: [PATCH v2 4/4] branch: make \"-l\" a synonym for \"--list\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-08-30T21:07:56Z","receivedAt":"2018-08-30T21:08:00Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Aug 30 2018, Jeff King wrote:\n\n> On Thu, Aug 30, 2018 at 01:29:53PM -0700, Junio C Hamano wrote:\n>\n>> >> > I do not know if the documentation that is shipped in 2.20 should\n>> >> > talk about how the old world looked like, though.  `-l` was a short\n>> >> > for `--create-reflog` is worth saying, but I do not see much value\n>> >> > in talking about the warning given in 2.19.\n>> >>\n>> >> I'm anticipating that there will be users in the wild with similar -l\n>> >> invocations, noting this helps them, because they'll be wondering what\n>> >> some script that does \"git branch -l <name>\" is trying to do while\n>> >> reading our docs.\n>> >\n>> > I don't have a strong opinion either way. If we do mention it, it should\n>> > probably be short (\"Until Git v2.20, the `-l` option was a synonym for\n>> > `--create-reflog\").\n>>\n>> I agree that the short one would of course be good.  I am on the\n>> fence about mentioning the warning only given in 2.19.\n>\n> Yeah, I was confused about that part of the thread. Is there something\n> proposed to (additionally) go into v2.19? Ævar, can you elaborate?\n\nThe patch I proposed was badly worded and on reflection I don't think\nit's useful to include this, but FWIW what I meant was:\n\n * 1. <2.19: -l is --create-reflog\n * 2. =2.19: -l is --create-reflog, but will spew a warning to stderr about futre deprecation\n * 3. >2.19: -l is --list\n\nI.e. should we in >2.19 docs say that -l used to mean something\ndifferent <= 2.19? Yeah, but it's probably worthless information to say\nthat it used to warn in that one release, since the actionable thing to\ndo with this information is to change it to --create-reflog, and unlike\ngoing from >2.19 to <2.19 running =2.19 isn't silently going to treat\nthe -l option in a way you might not expect.\n"}]}