{"thread":{"id":"27277","subject":"[PATCH 1/1] status: display \"doing what\" information in git status","startedAt":"2011-05-05T21:48:46Z","lastAt":"2011-05-06T19:15:26Z","messageCount":19,"participants":["Pierre Habouzit","Sverre Rabbelier","Junio C Hamano","Michael J Gruber","Jakub Narebski","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"167194","messageId":"1304632126-16733-1-git-send-email-madcoder@debian.org","threadId":"27277","inReplyTo":null,"subject":"[PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-05T21:48:46Z","receivedAt":"2011-05-05T21:48:46Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"This provides the same information as the git bash prompt about the\ncurrent operation that is going on: rebase, merge, am, cherry-pick or\nbisect.\n\nThis is very useful for \"beginners\" who don't have their shell prompt set\nup for git.\n\nThe logic has been largely borrowed from\ncontrib/completion/git-completion.bash\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n wt-status.c |   74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 74 insertions(+), 0 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 9f4e0ba..aad0f7f 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -527,6 +527,79 @@ static void wt_status_print_unmerged(struct wt_status *s)\n \n }\n \n+static int wt_has_file(const char *what)\n+{\n+\tchar path[PATH_MAX];\n+\n+\treturn access(git_snpath(path, sizeof(path), \"%s\", what), F_OK) == 0;\n+}\n+\n+static void wt_status_print_doingwhat(struct wt_status *s)\n+{\n+\tconst char *status_header   = color(WT_STATUS_HEADER, s);\n+\tconst char *status_nobranch = color(WT_STATUS_NOBRANCH, s);\n+\tstruct strbuf sb = STRBUF_INIT;\n+\tchar path[PATH_MAX];\n+\n+\tif (wt_has_file(\"rebase-merge/interactive\")) {\n+\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\tgit_snpath(path, sizeof(path), \"%s\", \"rebase-merge/head-name\");\n+\t\tstrbuf_read_file(&sb, path, 0);\n+\t\tstrbuf_rtrim(&sb);\n+\n+\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t   _(\"in the middle of a git rebase -i of %s\"),\n+\t\t\t\t   prefixcmp(sb.buf, \"refs/heads/\") == 0 ?\n+\t\t\t\t   sb.buf + 11 : sb.buf);\n+\t} else if (wt_has_file(\"rebase-merge\")) {\n+\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\tgit_snpath(path, sizeof(path), \"%s\", \"rebase-merge/head-name\");\n+\t\tstrbuf_read_file(&sb, path, 0);\n+\t\tstrbuf_rtrim(&sb);\n+\n+\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t   _(\"in the middle of a git rebase -m on %s\"),\n+\t\t\t\t   prefixcmp(sb.buf, \"refs/heads/\") == 0 ?\n+\t\t\t\t   sb.buf + 11 : sb.buf);\n+\t} else {\n+\t\tif (wt_has_file(\"rebase-apply\")) {\n+\t\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\t\tif (wt_has_file(\"rebase-apply/rebasing\")) {\n+\t\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t\t   _(\"in the middle of a git rebase\"));\n+\t\t\t} else if (wt_has_file(\"rebase-apply/applying\")) {\n+\t\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t\t   _(\"in the middle of a git am\"));\n+\t\t\t} else {\n+\t\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t\t   _(\"in the middle of a git rebase or am\"));\n+\t\t\t}\n+\t\t} else if (wt_has_file(\"MERGE_HEAD\")) {\n+\t\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git merge\"));\n+\t\t} else if (wt_has_file(\"CHERRY_PICK_HEAD\")) {\n+\t\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git cherry-pick\"));\n+\t\t} else if (wt_has_file(\"BISECT_LOG\")) {\n+\t\t\tstatus_printf(s, status_header, \"\");\n+\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git bisect\"));\n+\t\t} else {\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\tstatus_printf_more(s, status_header, \"\\n\");\n+\tstrbuf_release(&sb);\n+}\n+\n static void wt_status_print_updated(struct wt_status *s)\n {\n \tint shown_header = 0;\n@@ -732,6 +805,7 @@ void wt_status_print(struct wt_status *s)\n \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"\");\n \t}\n \n+\twt_status_print_doingwhat(s);\n \twt_status_print_updated(s);\n \twt_status_print_unmerged(s);\n \twt_status_print_changed(s);\n-- \n1.7.5.1.289.g76e37.dirty\n"},{"id":"167197","messageId":"BANLkTi=teRP8cMJeDC+khUtYD61SmeSdLA@mail.gmail.com","threadId":"27277","inReplyTo":"1304632126-16733-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-05-05T23:06:45Z","receivedAt":"2011-05-05T23:06:45Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, May 5, 2011 at 23:48, Pierre Habouzit <madcoder@debian.org> wrote:\n> This provides the same information as the git bash prompt about the\n> current operation that is going on: rebase, merge, am, cherry-pick or\n> bisect.\n\nCan you show how this will look like?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"167199","messageId":"20110505232650.GD636@madism.org","threadId":"27277","inReplyTo":"BANLkTi=teRP8cMJeDC+khUtYD61SmeSdLA@mail.gmail.com","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-05T23:26:51Z","receivedAt":"2011-05-05T23:26:51Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 01:06:45AM +0200, Sverre Rabbelier wrote:\n> Heya,\n> \n> On Thu, May 5, 2011 at 23:48, Pierre Habouzit <madcoder@debian.org> wrote:\n> > This provides the same information as the git bash prompt about the\n> > current operation that is going on: rebase, merge, am, cherry-pick or\n> > bisect.\n> \n> Can you show how this will look like?\n\nSure, it adds a line on the top with the same color as \"not on any\nbranch\" iff there is an ongoing operation.\n\nOf course in this setup it makes no sense since my shell shows it\nalready, but I'm frustrated when I use git on a remote machine where I\ndon't have zsh installed or configured, and at work many people would\nlike to know where they left stuff before they grabbed coffee and talked\nfor 1h instead of taking 5 minutes ;)\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167200","messageId":"7vbozg67oj.fsf@alter.siamese.dyndns.org","threadId":"27277","inReplyTo":"1304632126-16733-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T23:37:00Z","receivedAt":"2011-05-05T23:37:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> @@ -732,6 +805,7 @@ void wt_status_print(struct wt_status *s)\n>  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"\");\n>  \t}\n>  \n> +\twt_status_print_doingwhat(s);\n>  \twt_status_print_updated(s);\n>  \twt_status_print_unmerged(s);\n>  \twt_status_print_changed(s);\n\nI am very surprised that a new call to this function is added here.\n\nAs the \"You are in middle of\" information is useful mostly when you are on\ndetached head, I would have expected that the call would be inside the\nif/elif chain near the top of wt_status_print() where we say \"On branch\"\nvs \"Not currently on...\", to replace that information that comes from that\non_what variable.\n"},{"id":"167201","messageId":"20110505233925.GE636@madism.org","threadId":"27277","inReplyTo":"7vbozg67oj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-05T23:39:25Z","receivedAt":"2011-05-05T23:39:25Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, May 05, 2011 at 04:37:00PM -0700, Junio C Hamano wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > @@ -732,6 +805,7 @@ void wt_status_print(struct wt_status *s)\n> >  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"\");\n> >  \t}\n> >  \n> > +\twt_status_print_doingwhat(s);\n> >  \twt_status_print_updated(s);\n> >  \twt_status_print_unmerged(s);\n> >  \twt_status_print_changed(s);\n> \n> I am very surprised that a new call to this function is added here.\n> \n> As the \"You are in middle of\" information is useful mostly when you are on\n> detached head, I would have expected that the call would be inside the\n> if/elif chain near the top of wt_status_print() where we say \"On branch\"\n> vs \"Not currently on...\", to replace that information that comes from that\n> on_what variable.\n\nIt's also useful when you're in the middle of a rebase or during a merge\nconflict who aren't on a detached head.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167202","messageId":"20110505234722.GF636@madism.org","threadId":"27277","inReplyTo":"20110505233925.GE636@madism.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-05T23:47:23Z","receivedAt":"2011-05-05T23:47:23Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 01:39:25AM +0200, Pierre Habouzit wrote:\n> On Thu, May 05, 2011 at 04:37:00PM -0700, Junio C Hamano wrote:\n> > Pierre Habouzit <madcoder@debian.org> writes:\n> > \n> > > @@ -732,6 +805,7 @@ void wt_status_print(struct wt_status *s)\n> > >  \t\tstatus_printf_ln(s, color(WT_STATUS_HEADER, s), \"\");\n> > >  \t}\n> > >  \n> > > +\twt_status_print_doingwhat(s);\n> > >  \twt_status_print_updated(s);\n> > >  \twt_status_print_unmerged(s);\n> > >  \twt_status_print_changed(s);\n> > \n> > I am very surprised that a new call to this function is added here.\n> > \n> > As the \"You are in middle of\" information is useful mostly when you are on\n> > detached head, I would have expected that the call would be inside the\n> > if/elif chain near the top of wt_status_print() where we say \"On branch\"\n> > vs \"Not currently on...\", to replace that information that comes from that\n> > on_what variable.\n> \n> It's also useful when you're in the middle of a rebase or during a merge\n> conflict who aren't on a detached head.\n\ns/rebase/bisect/ sorry it's late.\n\nAnyways it prints nothing if the repository \"looks normal\"\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167203","messageId":"7vr58c4sip.fsf@alter.siamese.dyndns.org","threadId":"27277","inReplyTo":"20110505233925.GE636@madism.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T23:49:50Z","receivedAt":"2011-05-05T23:49:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n>> As the \"You are in middle of\" information is useful mostly when you are on\n>> detached head, I would have expected that the call would be inside the\n>> if/elif chain near the top of wt_status_print() where we say \"On branch\"\n>> vs \"Not currently on...\", to replace that information that comes from that\n>> on_what variable.\n>\n> It's also useful when you're in the middle of a rebase or during a merge\n> conflict who aren't on a detached head.\n\nWhat I would expect in such a case would be like:\n\n\t# On branch master (resolving merge with ph/status)\n\ninstead of wasting an extra line like:\n\n\t# Resolving a merge conflict\n        # On branch master\n\nThat is what I meant \"to replace\".\n"},{"id":"167205","messageId":"20110505235129.GG636@madism.org","threadId":"27277","inReplyTo":"7vr58c4sip.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-05T23:51:29Z","receivedAt":"2011-05-05T23:51:29Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, May 05, 2011 at 04:49:50PM -0700, Junio C Hamano wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> >> As the \"You are in middle of\" information is useful mostly when you are on\n> >> detached head, I would have expected that the call would be inside the\n> >> if/elif chain near the top of wt_status_print() where we say \"On branch\"\n> >> vs \"Not currently on...\", to replace that information that comes from that\n> >> on_what variable.\n> >\n> > It's also useful when you're in the middle of a rebase or during a merge\n> > conflict who aren't on a detached head.\n> \n> What I would expect in such a case would be like:\n> \n> \t# On branch master (resolving merge with ph/status)\n> \n> instead of wasting an extra line like:\n> \n> \t# Resolving a merge conflict\n>         # On branch master\n> \n> That is what I meant \"to replace\".\n\nokay it's really late, sorry, I read too fast, I'll work on something\nlike that, doesn't looks too complicated ;)\n\nI'll post an updated patch on tomorrow.\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167226","messageId":"1304667535-4787-1-git-send-email-madcoder@debian.org","threadId":"27277","inReplyTo":"7vr58c4sip.fsf@alter.siamese.dyndns.org","subject":"[PATCH v2] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-06T07:38:55Z","receivedAt":"2011-05-06T07:38:55Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"This provides the same information as the git bash prompt about the\ncurrent operation that is going on: rebase, merge, am, cherry-pick or\nbisect.\n\nThis is very useful for \"beginners\" who don't have their shell prompt set\nup for git.\n\nThe logic has been largely borrowed from\ncontrib/completion/git-completion.bash\n\nwhen hints are enabled, it also gives hints on how to abort or resolve\nthat pending situation. For example, with this patch and hints activated,\nbeing in the middle of a `git rebase -i` looks like:\n\n\t$ git status\n\t# in the middle of a git rebase -i of master (detached head)\n\t#   (use \"git rebase --abort\" to abort current rebase or proceed)\n\t# Changes not staged for commit:\n\t#   (use \"git add <file>...\" to update what will be committed)\n\t#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n\t#\n\t#       modified:   lib-common (new commits)\n\t#\n\t# Submodules changed but not updated:\n\t#\n\t# * lib-common 0b07a6b...11cdf27 (1):\n\t#   > Add t_sb_init().\n\t#\n\t# Untracked files:\n\t#   (use \"git add <file>...\" to include in what will be committed)\n\t#\n\t#       qdb/a/\n\t#       qkv/A/\n\tno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nIf we have an ongoing operation then:\n- if we are on a branch it displays:\n  # On branch $branch ($what_is_ongoing)\n  #   ($ongoing_hint)\n- if we are on a detached head it displays:\n  # $what_is_ongoing (detached head)\n  #   ($ongoing_hint)\n\nIf we have no ongoing operation the git status does as before:\n- if we are on a branch it displays:\n  # On branch $branch\n- if we are on a detached head it displays:\n  # Not currently on any branch.\n\nSince the ongoing operation is usually something to be done with before\ncontinuing with further git operations, the hint and ongoing operations\nare displayed with the \"WT_STATUS_NOBRANCH\" color to be easy to spot.\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n wt-status.c |  138 ++++++++++++++++++++++++++++++++++++++++++++++++++++------\n 1 files changed, 123 insertions(+), 15 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 9f4e0ba..91f6c7c 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -527,6 +527,128 @@ static void wt_status_print_unmerged(struct wt_status *s)\n \n }\n \n+static int wt_has_file(const char *what)\n+{\n+\tchar path[PATH_MAX];\n+\n+\treturn access(git_snpath(path, sizeof(path), \"%s\", what), F_OK) == 0;\n+}\n+\n+static void wt_status_print_doingwhat(struct wt_status *s)\n+{\n+\tconst char *status_nobranch = color(WT_STATUS_NOBRANCH, s);\n+\tconst char *branch_name = s->branch;\n+\tconst char *advice = NULL;\n+\n+\tconst char * const rebase_advice =\n+\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n+\tconst char * const am_advice =\n+\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n+\tconst char * const merge_advice =\n+\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n+\n+\tstruct strbuf sb = STRBUF_INIT;\n+\tchar path[PATH_MAX];\n+\n+\tif (!prefixcmp(branch_name, \"refs/heads/\"))\n+\t\tbranch_name += 11;\n+\telse if (!strcmp(branch_name, \"HEAD\")) {\n+\t\tbranch_name = NULL;\n+\t}\n+\n+\tstatus_printf(s, color(WT_STATUS_HEADER, s), \"\");\n+\tif (branch_name) {\n+\t\tconst char *status_onbranch = color(WT_STATUS_ONBRANCH, s);\n+\n+\t\tstatus_printf_more(s, status_onbranch, _(\"On branch \"));\n+\t\tstatus_printf_more(s, status_onbranch, \"%s\", branch_name);\n+\t}\n+\tif (wt_has_file(\"rebase-merge\")) {\n+\t\tgit_snpath(path, sizeof(path), \"%s\", \"rebase-merge/head-name\");\n+\t\tstrbuf_read_file(&sb, path, 0);\n+\t\tstrbuf_rtrim(&sb);\n+\n+\t\tif (branch_name)\n+\t\t\tstatus_printf_more(s, status_nobranch, \" (\");\n+\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t   _(\"in the middle of a git rebase -%c of %s\"),\n+\t\t\t\t   wt_has_file(\"rebase-merge/interactive\") ? 'i' : 'm',\n+\t\t\t\t   prefixcmp(sb.buf, \"refs/heads/\") == 0 ?\n+\t\t\t\t   sb.buf + 11 : sb.buf);\n+\t\tadvice = rebase_advice;\n+\t} else if (wt_has_file(\"rebase-apply\")) {\n+\t\tif (branch_name)\n+\t\t\tstatus_printf_more(s, status_nobranch, \" (\");\n+\t\tif (wt_has_file(\"rebase-apply/rebasing\")) {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git rebase\"));\n+\t\t\tadvice = rebase_advice;\n+\t\t} else if (wt_has_file(\"rebase-apply/applying\")) {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git am\"));\n+\t\t\tadvice = am_advice;\n+\t\t} else {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git rebase/am\"));\n+\t\t\tadvice = am_advice;\n+\t\t}\n+\t} else if (wt_has_file(\"MERGE_HEAD\")) {\n+\t\tgit_snpath(path, sizeof(path), \"%s\", \"MERGE_HEAD\");\n+\t\tstrbuf_read_file(&sb, path, 0);\n+\t\tstrbuf_rtrim(&sb);\n+\n+\t\tif (branch_name)\n+\t\t\tstatus_printf_more(s, status_nobranch, \" (\");\n+\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t   _(\"resolving merge with %s\"),\n+\t\t\t\t   prefixcmp(sb.buf, \"refs/heads/\") == 0 ?\n+\t\t\t\t   sb.buf + 11 : sb.buf);\n+\t\tadvice = merge_advice;\n+\t} else if (wt_has_file(\"CHERRY_PICK_HEAD\")) {\n+\t\tunsigned char sha1buf[20];\n+\n+\t\tgit_snpath(path, sizeof(path), \"%s\", \"CHERRY_PICK_HEAD\");\n+\t\tstrbuf_read_file(&sb, path, 0);\n+\t\tstrbuf_rtrim(&sb);\n+\n+\t\tif (branch_name)\n+\t\t\tstatus_printf_more(s, status_nobranch, \" (\");\n+\t\tif (sb.len == 40 && get_sha1_hex(sb.buf, sha1buf) == 0) {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"resolving cherry-pick of %s\"),\n+\t\t\t\t\t   find_unique_abbrev(sha1buf, DEFAULT_ABBREV));\n+\t\t} else {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"resolving cherry-pick of %s\"),\n+\t\t\t\t\t   sb.buf);\n+\t\t}\n+\t\tadvice = merge_advice;\n+\t} else if (wt_has_file(\"BISECT_LOG\")) {\n+\t\tif (branch_name)\n+\t\t\tstatus_printf_more(s, status_nobranch, \" (\");\n+\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"in the middle of a git bisect\"));\n+\t} else {\n+\t\tif (!branch_name) {\n+\t\t\tstatus_printf_more(s, status_nobranch,\n+\t\t\t\t\t   _(\"Not currently on any branch.\"));\n+\t\t}\n+\t\tstatus_printf_more(s, \"\", \"\\n\");\n+\t\treturn;\n+\t}\n+\n+\tif (branch_name) {\n+\t\tstatus_printf_more(s, status_nobranch, \")\\n\");\n+\t} else {\n+\t\tstatus_printf_more(s, status_nobranch, _(\" (detached head)\\n\"));\n+\t}\n+\tif (advice && advice_status_hints) {\n+\t\tstatus_printf(s, color(WT_STATUS_HEADER, s), \"\");\n+\t\tstatus_printf_more(s, status_nobranch, \"  (%s)\\n\", advice);\n+\t}\n+\tstrbuf_release(&sb);\n+}\n+\n static void wt_status_print_updated(struct wt_status *s)\n {\n \tint shown_header = 0;\n@@ -706,22 +828,8 @@ static void wt_status_print_tracking(struct wt_status *s)\n \n void wt_status_print(struct wt_status *s)\n {\n-\tconst char *branch_color = color(WT_STATUS_ONBRANCH, s);\n-\tconst char *branch_status_color = color(WT_STATUS_HEADER, s);\n-\n \tif (s->branch) {\n-\t\tconst char *on_what = _(\"On branch \");\n-\t\tconst char *branch_name = s->branch;\n-\t\tif (!prefixcmp(branch_name, \"refs/heads/\"))\n-\t\t\tbranch_name += 11;\n-\t\telse if (!strcmp(branch_name, \"HEAD\")) {\n-\t\t\tbranch_name = \"\";\n-\t\t\tbranch_status_color = color(WT_STATUS_NOBRANCH, s);\n-\t\t\ton_what = _(\"Not currently on any branch.\");\n-\t\t}\n-\t\tstatus_printf(s, color(WT_STATUS_HEADER, s), \"\");\n-\t\tstatus_printf_more(s, branch_status_color, \"%s\", on_what);\n-\t\tstatus_printf_more(s, branch_color, \"%s\\n\", branch_name);\n+\t\twt_status_print_doingwhat(s);\n \t\tif (!s->is_initial)\n \t\t\twt_status_print_tracking(s);\n \t}\n-- \n1.7.5.1.290.gfe86e2.dirty\n"},{"id":"167228","messageId":"4DC3A7E4.30204@drmicha.warpmail.net","threadId":"27277","inReplyTo":"20110505232650.GD636@madism.org","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-05-06T07:48:52Z","receivedAt":"2011-05-06T07:48:52Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Pierre Habouzit venit, vidit, dixit 06.05.2011 01:26:\n> On Fri, May 06, 2011 at 01:06:45AM +0200, Sverre Rabbelier wrote:\n>> Heya,\n>>\n>> On Thu, May 5, 2011 at 23:48, Pierre Habouzit <madcoder@debian.org> wrote:\n>>> This provides the same information as the git bash prompt about the\n>>> current operation that is going on: rebase, merge, am, cherry-pick or\n>>> bisect.\n>>\n>> Can you show how this will look like?\n> \n> Sure, it adds a line on the top with the same color as \"not on any\n> branch\" iff there is an ongoing operation.\n> \n> Of course in this setup it makes no sense since my shell shows it\n> already, but I'm frustrated when I use git on a remote machine where I\n> don't have zsh installed or configured, and at work many people would\n> like to know where they left stuff before they grabbed coffee and talked\n> for 1h instead of taking 5 minutes ;)\n\nI think this is useful and nice in the compactified version suggested by\nJunio. Be prepared for someone requesting it with \"status -s -b\" :)\n\nWhat became of the colouring of the git-prompt, btw? I see you're using\nsome, and I remember a stalled effort to have this in our shipped\ncompletion. Do have something shareable in that respect?\n\nMichael\n"},{"id":"167229","messageId":"20110506080446.GA26842@madism.org","threadId":"27277","inReplyTo":"4DC3A7E4.30204@drmicha.warpmail.net","subject":"Re: [PATCH 1/1] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-06T08:04:46Z","receivedAt":"2011-05-06T08:04:46Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 09:48:52AM +0200, Michael J Gruber wrote:\n> Pierre Habouzit venit, vidit, dixit 06.05.2011 01:26:\n> > On Fri, May 06, 2011 at 01:06:45AM +0200, Sverre Rabbelier wrote:\n> >> Heya,\n> >>\n> >> On Thu, May 5, 2011 at 23:48, Pierre Habouzit <madcoder@debian.org> wrote:\n> >>> This provides the same information as the git bash prompt about the\n> >>> current operation that is going on: rebase, merge, am, cherry-pick or\n> >>> bisect.\n> >>\n> >> Can you show how this will look like?\n> > \n> > Sure, it adds a line on the top with the same color as \"not on any\n> > branch\" iff there is an ongoing operation.\n> > \n> > Of course in this setup it makes no sense since my shell shows it\n> > already, but I'm frustrated when I use git on a remote machine where I\n> > don't have zsh installed or configured, and at work many people would\n> > like to know where they left stuff before they grabbed coffee and talked\n> > for 1h instead of taking 5 minutes ;)\n> \n> I think this is useful and nice in the compactified version suggested by\n> Junio. Be prepared for someone requesting it with \"status -s -b\" :)\n\nWell, I've written the logic, it's easy to use :P\n\n> What became of the colouring of the git-prompt, btw? I see you're using\n> some, and I remember a stalled effort to have this in our shipped\n> completion. Do have something shareable in that respect?\n\nMy git prompt predates the bash one, it's here\nhttp://madism.org/~madcoder/dotfiles/config/zsh/60_prompt you're\nfree to do what you want with that.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167241","messageId":"m3oc3guogs.fsf@localhost.localdomain","threadId":"27277","inReplyTo":"1304667535-4787-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-05-06T10:13:55Z","receivedAt":"2011-05-06T10:13:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> This provides the same information as the git bash prompt about the\n> current operation that is going on: rebase, merge, am, cherry-pick or\n> bisect.\n> \n> This is very useful for \"beginners\" who don't have their shell prompt set\n> up for git.\n> \n> The logic has been largely borrowed from\n> contrib/completion/git-completion.bash\n\nVery nice idea.\n \n> when hints are enabled, it also gives hints on how to abort or resolve\n\ns/^when/When/\n\n> If we have an ongoing operation then:\n> - if we are on a branch it displays:\n>   # On branch $branch ($what_is_ongoing)\n>   #   ($ongoing_hint)\n> - if we are on a detached head it displays:\n>   # $what_is_ongoing (detached head)\n>   #   ($ongoing_hint)\n> \n> If we have no ongoing operation the git status does as before:\n> - if we are on a branch it displays:\n>   # On branch $branch\n> - if we are on a detached head it displays:\n>   # Not currently on any branch.\n\nVery nice to have such example in commit message.\n \n> Since the ongoing operation is usually something to be done with before\n> continuing with further git operations, the hint and ongoing operations\n> are displayed with the \"WT_STATUS_NOBRANCH\" color to be easy to spot.\n> \n> Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n> ---\n>  wt-status.c |  138 ++++++++++++++++++++++++++++++++++++++++++++++++++++------\n>  1 files changed, 123 insertions(+), 15 deletions(-)\n\nCould you please add some *tests* for this new feature?  \n\nDon't forget to mark it with C_LOCALE_OUTPUT or use test_i18ncmp /\n/ test_i18ngrep in tests.\n \n> +static void wt_status_print_doingwhat(struct wt_status *s)\n> +{\n> +\tconst char *status_nobranch = color(WT_STATUS_NOBRANCH, s);\n> +\tconst char *branch_name = s->branch;\n> +\tconst char *advice = NULL;\n> +\n> +\tconst char * const rebase_advice =\n> +\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n> +\tconst char * const am_advice =\n> +\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n> +\tconst char * const merge_advice =\n> +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n\nThanks for marking it up for i18n... though I am not sure if we should\nuse _() or N_() here...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"167267","messageId":"7vei4b20we.fsf@alter.siamese.dyndns.org","threadId":"27277","inReplyTo":"1304667535-4787-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-06T17:29:21Z","receivedAt":"2011-05-06T17:29:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> \t$ git status\n> \t# in the middle of a git rebase -i of master (detached head)\n> ...\n> \t#       qkv/A/\n> \tno changes added to commit (use \"git add\" and/or \"git commit -a\")\n>\n> If we have an ongoing operation then:\n> - if we are on a branch it displays:\n>   # On branch $branch ($what_is_ongoing)\n>   #   ($ongoing_hint)\n> - if we are on a detached head it displays:\n>   # $what_is_ongoing (detached head)\n>   #   ($ongoing_hint)\n\nI'll reindent the above to align these example output the earlier output sample\nwhen I apply them.\n\n> +\tconst char * const rebase_advice =\n> +\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n> +\tconst char * const am_advice =\n> +\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n\nIf the reader does not even know that the \"--abort\" option is used to\nabort, \" or proceed\" needs to be followed by \"by doing $this\", if it wants\nto have any practical value.  I would suggest dropping it.\n\n> +\tconst char * const merge_advice =\n> +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n\nThis codepath being in wt-status.c, I wonder if any of these advices could\ntrigger to appear in the log message editor when the user tries to run\n\"git commit\".  If so, I suspect any of the above is too late to help the\nuser, no?\n\nAlso, should we make these conditional upon advice.status or something?\n"},{"id":"167268","messageId":"20110506173656.GA2872@madism.org","threadId":"27277","inReplyTo":"7vei4b20we.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-06T17:36:56Z","receivedAt":"2011-05-06T17:36:56Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 10:29:21AM -0700, Junio C Hamano wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > \t$ git status\n> > \t# in the middle of a git rebase -i of master (detached head)\n> > ...\n> > \t#       qkv/A/\n> > \tno changes added to commit (use \"git add\" and/or \"git commit -a\")\n> >\n> > If we have an ongoing operation then:\n> > - if we are on a branch it displays:\n> >   # On branch $branch ($what_is_ongoing)\n> >   #   ($ongoing_hint)\n> > - if we are on a detached head it displays:\n> >   # $what_is_ongoing (detached head)\n> >   #   ($ongoing_hint)\n> \n> I'll reindent the above to align these example output the earlier output sample\n> when I apply them.\n\nSure.\n\n> > +\tconst char * const rebase_advice =\n> > +\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n> > +\tconst char * const am_advice =\n> > +\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n> \n> If the reader does not even know that the \"--abort\" option is used to\n> abort, \" or proceed\" needs to be followed by \"by doing $this\", if it wants\n> to have any practical value.  I would suggest dropping it.\n> \n> > +\tconst char * const merge_advice =\n> > +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n> This codepath being in wt-status.c, I wonder if any of these advices could\n> trigger to appear in the log message editor when the user tries to run\n> \"git commit\".  If so, I suspect any of the above is too late to help the\n> user, no?\n\nWell I'm not very happy with the advices, feel free to reword them in a better\nway.\n\n> Also, should we make these conditional upon advice.status or something?\nthey are\n                          vvvvvvvvvvvvvvvvvvv\n    +       if (advice && advice_status_hints) {\n    +               status_printf(s, color(WT_STATUS_HEADER, s), \"\");\n    +               status_printf_more(s, status_nobranch, \"  (%s)\\n\", advice);\n    +       }\n\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167269","messageId":"20110506174053.GB2872@madism.org","threadId":"27277","inReplyTo":"m3oc3guogs.fsf@localhost.localdomain","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-06T17:40:53Z","receivedAt":"2011-05-06T17:40:53Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 03:13:55AM -0700, Jakub Narebski wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> > If we have an ongoing operation then:\n> > - if we are on a branch it displays:\n> >   # On branch $branch ($what_is_ongoing)\n> >   #   ($ongoing_hint)\n> > - if we are on a detached head it displays:\n> >   # $what_is_ongoing (detached head)\n> >   #   ($ongoing_hint)\n> >\n> > If we have no ongoing operation the git status does as before:\n> > - if we are on a branch it displays:\n> >   # On branch $branch\n> > - if we are on a detached head it displays:\n> >   # Not currently on any branch.\n>\n> Very nice to have such example in commit message.\n>\n> > Since the ongoing operation is usually something to be done with before\n> > continuing with further git operations, the hint and ongoing operations\n> > are displayed with the \"WT_STATUS_NOBRANCH\" color to be easy to spot.\n> >\n> > Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n> > ---\n> >  wt-status.c |  138 ++++++++++++++++++++++++++++++++++++++++++++++++++++------\n> >  1 files changed, 123 insertions(+), 15 deletions(-)\n> \n> Could you please add some *tests* for this new feature?  \n> \n> Don't forget to mark it with C_LOCALE_OUTPUT or use test_i18ncmp /\n> / test_i18ngrep in tests.\n\nFrankly I sadly don't have the time to write them, which is a very bad\nexcuse, this is a feature I wrote for $work and that I use and I thought\nit would be nice to share.\n\nGenerating all the possible cases is just very long, and the test\nframework changed too much since the last time I used it a few years ago\nand I abandoned after 10minutes not being able to make it work properly.\n\n> > +static void wt_status_print_doingwhat(struct wt_status *s)\n> > +{\n> > +\tconst char *status_nobranch = color(WT_STATUS_NOBRANCH, s);\n> > +\tconst char *branch_name = s->branch;\n> > +\tconst char *advice = NULL;\n> > +\n> > +\tconst char * const rebase_advice =\n> > +\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n> > +\tconst char * const am_advice =\n> > +\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n> > +\tconst char * const merge_advice =\n> > +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n> \n> Thanks for marking it up for i18n... though I am not sure if we should\n> use _() or N_() here...\n\nIt's _() you want to translate those. They are used through a\nprintf(\"  (%s)\", ...) later that doesn't need i18n.\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167270","messageId":"7vaaez1yd8.fsf@alter.siamese.dyndns.org","threadId":"27277","inReplyTo":"20110506173656.GA2872@madism.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-06T18:24:03Z","receivedAt":"2011-05-06T18:24:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n>> > +\tconst char * const rebase_advice =\n>> > +\t\t_(\"use \\\"git rebase --abort\\\" to abort current rebase or proceed\");\n>> > +\tconst char * const am_advice =\n>> > +\t\t_(\"use \\\"git am --abort\\\" to abort current mailbox apply or proceed\");\n>> \n>> If the reader does not even know that the \"--abort\" option is used to\n>> abort, \" or proceed\" needs to be followed by \"by doing $this\", if it wants\n>> to have any practical value.  I would suggest dropping it.\n>> \n>> > +\tconst char * const merge_advice =\n>> > +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n>> This codepath being in wt-status.c, I wonder if any of these advices could\n>> trigger to appear in the log message editor when the user tries to run\n>> \"git commit\".  If so, I suspect any of the above is too late to help the\n>> user, no?\n>\n> Well I'm not very happy with the advices, feel free to reword them in a better\n> way.\n\nI already suggested dropping it ;-)  Rewording to emptiness would be the\nsimplest and cleanest.\n\n>> Also, should we make these conditional upon advice.status or something?\n> they are\n>                           vvvvvvvvvvvvvvvvvvv\n>     +       if (advice && advice_status_hints) {\n>     +               status_printf(s, color(WT_STATUS_HEADER, s), \"\");\n>     +               status_printf_more(s, status_nobranch, \"  (%s)\\n\", advice);\n>     +       }\n\nBy the way, this change also breaks t7060, at least.\n"},{"id":"167272","messageId":"vpqei4bwu4b.fsf@bauges.imag.fr","threadId":"27277","inReplyTo":"1304667535-4787-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-05-06T18:40:04Z","receivedAt":"2011-05-06T18:40:04Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> +\tconst char * const merge_advice =\n> +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n\nI think that should be \"git reset --merge\" (which preserves files not\ntouched by the merge, and makes sure \"git merge; git reset\" doesn't\npermanently loose data).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"167273","messageId":"20110506184403.GC2872@madism.org","threadId":"27277","inReplyTo":"vpqei4bwu4b.fsf@bauges.imag.fr","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2011-05-06T18:44:03Z","receivedAt":"2011-05-06T18:44:03Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, May 06, 2011 at 08:40:04PM +0200, Matthieu Moy wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > +\tconst char * const merge_advice =\n> > +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n> \n> I think that should be \"git reset --merge\" (which preserves files not\n> touched by the merge, and makes sure \"git merge; git reset\" doesn't\n> permanently loose data).\n\nWow, I didn't know about that one, so /maybe/ the hint isn't that\nuseless after all :)\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"167275","messageId":"vpqei4bvdwx.fsf@bauges.imag.fr","threadId":"27277","inReplyTo":"20110506184403.GC2872@madism.org","subject":"Re: [PATCH v2] status: display \"doing what\" information in git status","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-05-06T19:15:26Z","receivedAt":"2011-05-06T19:15:26Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> On Fri, May 06, 2011 at 08:40:04PM +0200, Matthieu Moy wrote:\n>> Pierre Habouzit <madcoder@debian.org> writes:\n>> \n>> > +\tconst char * const merge_advice =\n>> > +\t\t_(\"use \\\"git reset --hard\\\" to abort, or resolve conflicts and commit\");\n>> \n>> I think that should be \"git reset --merge\" (which preserves files not\n>> touched by the merge, and makes sure \"git merge; git reset\" doesn't\n>> permanently loose data).\n>\n> Wow, I didn't know about that one, so /maybe/ the hint isn't that\n> useless after all :)\n\nActually, there's very few reason to run \"git reset --hard\" these days,\nand we should really consider it as a very dangerous command that should\nnot be advertized to beginners. There's almost always a safer\nalternative:\n\n* You want to cancel a merge => git reset --merge\n  (doesn't touch files not impacted by merges)\n\n* You want to change the commit your HEAD points to => git reset --keep\n  (in case you have local changes, they won't be overridden)\n\n* You want to discard local changes => git stash\n  (you may not think these changes are important, but you may be wrong)\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}