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

Re: [RFC PATCH 4/4] name-rev: avoid naming from a ref if it’s not a descendant of any commit

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 1, 2019, 18:07 UTC
Message-ID
<CAPig+cRCSauOKjkEVmyBYdSjXW2215muvC1DqpGAS2hU9x-04w@mail.gmail.com>
In-Reply-To
<20190301175024.17337-5-alban.gruin@gmail.com>
On Fri, Mar 1, 2019 at 12:50 PM Alban Gruin <alban.gruin@gmail.com> wrote:
> A ref may not be the descendant of all of the commits mentionned in
> stdin.  In this case, we want to avoid naming its parents.
s/mentionned/mentioned/
Show 15 quoted lines
>
> To do this, find_commits_in_strbuf() is created.  It returns a raw list
> of all the commits that have been found in the input buffer.  ishex() is
> converted to an inlined function.  Then, we add a raw list of commits in
> the name_ref_data structure, and call find_commits_in_strbuf() before
> for_each_ref() if the user wants name-ref to process stdin.  Then, for
> each ref, we check if the reachable subset of this commit list is empty
> or not.  If it is, we do not call name_rev(), so we don’t name its
> parents.
>
> The code dealing with stdin after calling for_each_ref() is no longer
> needed as we already read it.  name_rev_line() is renamed name_rev_buf()
> to reflect its new role better.
>
> Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Previous: Alban GruinNext: Christian Couder
Message 12 of 18 in “name-rev: improve memory usage”
  1. 0/4 name-rev: improve memory usageAlban Gruin, Mar 1, 2019
  2. 1/4 name-rev: improve name_rev() memory usageAlban Gruin, Mar 1, 2019
  3. Eric SunshineMar 1, 2019
  4. Jeff KingMar 1, 2019
  5. Johannes SchindelinMar 2, 2019
  6. 3/4 name-rev: check if a commit should be named before naming itAlban Gruin, Mar 1, 2019
  7. Eric SunshineMar 1, 2019
  8. Alban GruinMar 1, 2019
  9. Jeff KingMar 1, 2019
  10. 2/4 commit-list: add a function to check if a commit is in a listAlban Gruin, Mar 1, 2019
  11. 4/4 name-rev: avoid naming from a ref if it’s not a descendant of any commitAlban Gruin, Mar 1, 2019
  12. Eric SunshineMar 1, 2019
  13. Christian CouderMar 3, 2019
  14. Christian CouderMar 3, 2019
  15. Alban GruinMar 3, 2019
  16. Jeff KingMar 1, 2019
  17. Alban GruinMar 1, 2019
  18. Jeff KingMar 1, 2019

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.