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

Re: [PATCH v6 05/17] ref-filter: move get_head_description() from branch.c

From
Junio C Hamano <gitster@pobox.com>
Date
May 17, 2016, 19:59 UTC
Message-ID
<xmqqtwhwv4kd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1463309133-14503-6-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 33 quoted lines
> diff --git a/builtin/branch.c b/builtin/branch.c
> index 2ecde53..141168d 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -361,39 +361,6 @@ static void add_verbose_info(struct strbuf *out, struct ref_array_item *item,
>  	strbuf_release(&subject);
>  }
>  
> -static char *get_head_description(void)
> -{
> -	struct strbuf desc = STRBUF_INIT;
> -	struct wt_status_state state;
> -	memset(&state, 0, sizeof(state));
> -	wt_status_get_state(&state, 1);
> -	if (state.rebase_in_progress ||
> -	    state.rebase_interactive_in_progress)
> -		strbuf_addf(&desc, _("(no branch, rebasing %s)"),
> -			    state.branch);
> -	else if (state.bisect_in_progress)
> -		strbuf_addf(&desc, _("(no branch, bisect started on %s)"),
> -			    state.branch);
> -	else if (state.detached_from) {
> -		if (state.detached_at)
> -			/* TRANSLATORS: make sure this matches
> -			   "HEAD detached at " in wt-status.c */
> -			strbuf_addf(&desc, _("(HEAD detached at %s)"),
> -				state.detached_from);
> -		else
> -			/* TRANSLATORS: make sure this matches
> -			   "HEAD detached from " in wt-status.c */
> -			strbuf_addf(&desc, _("(HEAD detached from %s)"),
> -				state.detached_from);
> -	}

Note that this expects that va/i18n-misc-updates topic, which corrects the translator instruction around here, is already applied.

Show 26 quoted lines
> diff --git a/ref-filter.c b/ref-filter.c
> index 7d3af1c..fcb3353 100644
> ...
> +char *get_head_description(void)
> +{
> +	struct strbuf desc = STRBUF_INIT;
> +	struct wt_status_state state;
> +	memset(&state, 0, sizeof(state));
> +	wt_status_get_state(&state, 1);
> +	if (state.rebase_in_progress ||
> +	    state.rebase_interactive_in_progress)
> +		strbuf_addf(&desc, _("(no branch, rebasing %s)"),
> +			    state.branch);
> +	else if (state.bisect_in_progress)
> +		strbuf_addf(&desc, _("(no branch, bisect started on %s)"),
> +			    state.branch);
> +	else if (state.detached_from) {
> +		/* TRANSLATORS: make sure these match _("HEAD detached at ")
> +		   and _("HEAD detached from ") in wt-status.c */
> +		if (state.detached_at)
> +			strbuf_addf(&desc, _("(HEAD detached at %s)"),
> +				state.detached_from);
> +		else
> +			strbuf_addf(&desc, _("(HEAD detached from %s)"),
> +				state.detached_from);
> +	}
... but the change is apparently lost.

It is a good lesson not to blindly rebase things on 'next', which would have unrelated changes. If you needed es/test-gpg-tags topic for the test script change, check out 'master', merge that single topic, and then rebase the series on top of the result.

Previous: Karthik NayakNext: Karthik Nayak
Message 7 of 26 in “Port branch.c to use ref-filter's printing options”
  1. 00/17 Port branch.c to use ref-filter's printing optionsKarthik Nayak, May 15, 2016
  2. 01/17 ref-filter: implement %(if), %(then), and %(else) atomsKarthik Nayak, May 15, 2016
  3. 02/17 ref-filter: include reference to 'used_atom' within 'atom_value'Karthik Nayak, May 15, 2016
  4. 03/17 ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)Karthik Nayak, May 15, 2016
  5. 04/17 ref-filter: modify "%(objectname:short)" to take lengthKarthik Nayak, May 15, 2016
  6. 05/17 ref-filter: move get_head_description() from branch.cKarthik Nayak, May 15, 2016
  7. Junio C HamanoMay 17, 2016
  8. Karthik NayakMay 20, 2016
  9. 06/17 ref-filter: introduce format_ref_array_item()Karthik Nayak, May 15, 2016
  10. 07/17 ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreamsKarthik Nayak, May 15, 2016
  11. 08/17 ref-filter: add support for %(upstream:track,nobracket)Karthik Nayak, May 15, 2016
  12. 09/17 ref-filter: make "%(symref)" atom work with the ':short' modifierKarthik Nayak, May 15, 2016
  13. 10/17 ref-filter: introduce refname_atom_parser_internal()Karthik Nayak, May 15, 2016
  14. 11/17 ref-filter: introduce symref_atom_parser() and refname_atom_parser()Karthik Nayak, May 15, 2016
  15. 12/17 ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()Karthik Nayak, May 15, 2016
  16. 13/17 ref-filter: add `:dir` and `:base` options for ref printing atomsKarthik Nayak, May 15, 2016
  17. 14/17 ref-filter: allow porcelain to translate messages in the outputKarthik Nayak, May 15, 2016
  18. 15/17 branch, tag: use porcelain outputKarthik Nayak, May 15, 2016
  19. 16/17 branch: use ref-filter printing APIsKarthik Nayak, May 15, 2016
  20. 17/17 branch: implement '--format' optionKarthik Nayak, May 15, 2016
  21. Junio C HamanoMay 16, 2016
  22. Karthik NayakMay 17, 2016
  23. Junio C HamanoMay 17, 2016
  24. Karthik NayakMay 17, 2016
  25. Junio C HamanoMay 17, 2016
  26. Karthik NayakMay 18, 2016

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.