git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] status: display "doing what" information in git status

From
Pierre Habouzit <madcoder@debian.org>
Date
May 6, 2011, 17:40 UTC
Message-ID
<20110506174053.GB2872@madism.org>
In-Reply-To
<m3oc3guogs.fsf@localhost.localdomain>
On Fri, May 06, 2011 at 03:13:55AM -0700, Jakub Narebski wrote:
Show 30 quoted lines
> Pierre Habouzit <madcoder@debian.org> writes:
> > If we have an ongoing operation then:
> > - if we are on a branch it displays:
> >   # On branch $branch ($what_is_ongoing)
> >   #   ($ongoing_hint)
> > - if we are on a detached head it displays:
> >   # $what_is_ongoing (detached head)
> >   #   ($ongoing_hint)
> >
> > If we have no ongoing operation the git status does as before:
> > - if we are on a branch it displays:
> >   # On branch $branch
> > - if we are on a detached head it displays:
> >   # Not currently on any branch.
>
> Very nice to have such example in commit message.
>
> > Since the ongoing operation is usually something to be done with before
> > continuing with further git operations, the hint and ongoing operations
> > are displayed with the "WT_STATUS_NOBRANCH" color to be easy to spot.
> >
> > Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> > ---
> >  wt-status.c |  138 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
> >  1 files changed, 123 insertions(+), 15 deletions(-)
> 
> Could you please add some *tests* for this new feature?  
> 
> Don't forget to mark it with C_LOCALE_OUTPUT or use test_i18ncmp /
> / test_i18ngrep in tests.

Frankly I sadly don't have the time to write them, which is a very bad excuse, this is a feature I wrote for $work and that I use and I thought it would be nice to share.

Generating all the possible cases is just very long, and the test framework changed too much since the last time I used it a few years ago and I abandoned after 10minutes not being able to make it work properly.

Show 15 quoted lines
> > +static void wt_status_print_doingwhat(struct wt_status *s)
> > +{
> > +	const char *status_nobranch = color(WT_STATUS_NOBRANCH, s);
> > +	const char *branch_name = s->branch;
> > +	const char *advice = NULL;
> > +
> > +	const char * const rebase_advice =
> > +		_("use \"git rebase --abort\" to abort current rebase or proceed");
> > +	const char * const am_advice =
> > +		_("use \"git am --abort\" to abort current mailbox apply or proceed");
> > +	const char * const merge_advice =
> > +		_("use \"git reset --hard\" to abort, or resolve conflicts and commit");
> 
> Thanks for marking it up for i18n... though I am not sure if we should
> use _() or N_() here...

It's _() you want to translate those. They are used through a printf(" (%s)", ...) later that doesn't need i18n.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Jakub NarebskiNext: Junio C Hamano
Message 13 of 19 in “status: display "doing what" information in git status”
  1. 1/1 status: display "doing what" information in git statusPierre Habouzit, May 5, 2011
  2. Sverre RabbelierMay 5, 2011
  3. Pierre HabouzitMay 5, 2011
  4. Michael J GruberMay 6, 2011
  5. Pierre HabouzitMay 6, 2011
  6. Junio C HamanoMay 5, 2011
  7. Pierre HabouzitMay 5, 2011
  8. Pierre HabouzitMay 5, 2011
  9. Junio C HamanoMay 5, 2011
  10. Pierre HabouzitMay 5, 2011
  11. status: display "doing what" information in git statusPierre Habouzit, May 6, 2011
  12. Jakub NarebskiMay 6, 2011
  13. Pierre HabouzitMay 6, 2011
  14. Junio C HamanoMay 6, 2011
  15. Pierre HabouzitMay 6, 2011
  16. Junio C HamanoMay 6, 2011
  17. Matthieu MoyMay 6, 2011
  18. Pierre HabouzitMay 6, 2011
  19. Matthieu MoyMay 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.