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

Re: [PATCH] show-branch: show all local heads when only giving one rev along --topics

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2015, 22:24 UTC
Message-ID
<xmqqd23qw2cl.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1427753543-19680-1-git-send-email-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
> (Maybe --topics should always require one rev on the command
> line?)
That sounds line a good thing to do.
Show 9 quoted lines
> -	else if (all_heads + all_remotes)
> -		snarf_refs(all_heads, all_remotes);
>  	else {
>  		while (0 < ac) {
>  			append_one_rev(*av);
>  			ac--; av++;
>  		}
> +		if (all_heads + all_remotes)
> +			snarf_refs(all_heads, all_remotes);

Hmmmmmm. Is this safe and will not cause problems by possibly duplicated refnames that came from the command line and the ones that came from for-each-ref iteration? I am not saying the change is problematic; it is just I haven't looked at this code for a long time that the existing machinery is already designed to tolerate duplicated input.

Thanks.
Previous: Mike HommeyNext: Junio C Hamano
Message 2 of 4 in “show-branch: show all local heads when only giving one rev along --topics”
  1. show-branch: show all local heads when only giving one rev along --topicsMike Hommey, Mar 30, 2015
  2. Junio C HamanoMar 30, 2015
  3. Junio C HamanoMar 30, 2015
  4. Mike HommeyMar 30, 2015

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.