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

Re: [PATCH v3] object-name: fix reversed ordering with ":/<PATTERN>" revisions

From
René Scharfe <l.s.r@web.de>
Date
Dec 9, 2024, 11:47 UTC
Message-ID
<4c8604c2-4287-48dd-b1ec-78ba9c1401f0@web.de>
In-Reply-To
<20241206-pks-rev-parse-fix-reversed-list-v3-1-d934c17db168@pks.im>
Am 06.12.24 um 16:45 schrieb Patrick Steinhardt:
Show 6 quoted lines
> @@ -1423,7 +1423,7 @@ static int get_oid_oneline(struct repository *r,
>
>  	for (l = list; l; l = l->next) {
>  		l->item->object.flags |= ONELINE_SEEN;
> -		commit_list_insert(l->item, &copy);
> +		copy_tail = &commit_list_insert(l->item, copy_tail)->next;
OK.  The following does the same while being clearer:
		copy_tail = commit_list_append(l->item, copy_tail);

You could get the idea to do that replacement across the whole source tree. That would be nice, but must not be done blindly (e.g. with Coccinelle), as the result will be different if the second argument can point to somewhere in the middle of the list. Here it's OK because we indeed are appending (invariant *copy_tail == NULL holds).

René
Previous: Junio C Hamano
Message 16 of 16 in “object-name: fix reversed ordering with magic pathspecs”
  1. object-name: fix reversed ordering with magic pathspecsPatrick Steinhardt, Dec 6, 2024
  2. Kristoffer HaugsbakkDec 6, 2024
  3. Junio C HamanoDec 6, 2024
  4. Patrick SteinhardtDec 6, 2024
  5. Kristoffer HaugsbakkDec 6, 2024
  6. Junio C HamanoDec 6, 2024
  7. Patrick SteinhardtDec 6, 2024
  8. object-name: fix reversed ordering with ":/<PATTERN>" revisionsPatrick Steinhardt, Dec 6, 2024
  9. Kristoffer HaugsbakkDec 6, 2024
  10. Patrick SteinhardtDec 6, 2024
  11. Junio C HamanoDec 6, 2024
  12. Justin ToblerDec 7, 2024
  13. object-name: fix reversed ordering with ":/<PATTERN>" revisionsPatrick Steinhardt, Dec 6, 2024
  14. Kristoffer HaugsbakkDec 7, 2024
  15. Junio C HamanoDec 7, 2024
  16. René ScharfeDec 9, 2024

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.