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

Re: [PATCH 1/4] remote: minor code cleanups in preparation for changing "show" output

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 20, 2009, 07:19 UTC
Message-ID
<7vbpsxh8xa.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1235020471-59982-2-git-send-email-jaysoffian@gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
Show 17 quoted lines
> * Rename char *remote to remote_name to distinguish it clearly from the
>   struct remote pointer, also named remote.
>
> * There is no need to call sort_string_list() on branch_list, as its
>   items are added to it via string_list_insert() which maintains its
>   order.
>
> * Sort states->new and states->tracked so that we can use binary search
>   string_list_has_string() on them instead of less efficient linear
>   unsorted_string_list_has_string. This alters the output of "remote
>   show" slightly, so update the tests to match.
>
> * Simplify get_ref_states(); nothing is using the pointer to states that
>   is being copied into util.
>
> * Have get_remote_ref_states() populate states->tracked even when it is
>   not querying the remote so that this need not be done by the caller.
This does too many things in a single patch.
Ideally this would have been four patches for reviewability:
 - one "trivial and obviously correct bits" (s/remote/remote_name/ and
   removal of sort_string_list(&branch_list)) patch;
 - the change for states->{new,tracked}, should stand on its own; I think
   the reordering of the output should be described much better and
   defended independently.  "Earlier it was sorted by this order, which
   did not make sense for such and such reasons; this fixes the logic to
   sort the list by the name of the tracked branch, which makes it easier
   to read", or something like that.
 - change to the states->tracked population rule; and
 - get_ref_states() to lose the util bit.
It probably is Ok to squash the last two, though.
Previous: Jay SoffianNext: Jay Soffian
Message 18 of 19 in “Improve "remote show" output”
  1. 0/4 Improve "remote show" outputJay Soffian, Feb 19, 2009
  2. 1/4 remote: minor code cleanups in preparation for changing "show" outputJay Soffian, Feb 19, 2009
  3. 2/4 remote: move append_ref_to_tracked_list to get rid of prototypeJay Soffian, Feb 19, 2009
  4. 3/4 string-list: add for_each_string_list()Jay Soffian, Feb 19, 2009
  5. 4/4 remote: new show output styleJay Soffian, Feb 19, 2009
  6. Marc BranchaudFeb 19, 2009
  7. Sverre RabbelierFeb 19, 2009
  8. Marc BranchaudFeb 19, 2009
  9. Sverre RabbelierFeb 19, 2009
  10. Rostislav SvobodaFeb 19, 2009
  11. Jay SoffianFeb 19, 2009
  12. Jay SoffianFeb 19, 2009
  13. Julian PhillipsFeb 19, 2009
  14. Marc BranchaudFeb 20, 2009
  15. Jay SoffianFeb 20, 2009
  16. Johannes SixtFeb 19, 2009
  17. Jay SoffianFeb 19, 2009
  18. Junio C HamanoFeb 20, 2009
  19. Jay SoffianFeb 20, 2009

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.