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

Re: [2/4] Sorting commits by date

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 19, 2005, 02:13 UTC
Message-ID
<20050419021338.GX5554@pasky.ji.cz>
In-Reply-To
<Pine.LNX.4.21.0504182152000.30848-100000@iabervon.org>

Dear diary, on Tue, Apr 19, 2005 at 03:54:56AM CEST, I got a letter where Daniel Barkalow <barkalow@iabervon.org> told me that...

Show 24 quoted lines
> Index: commit.c
> ===================================================================
> --- b3cf8daf9b619ae9f06a28f42a4ae01b69729206/commit.c  (mode:100644 sha1:0099baa63971d86ee30ef2a7da25057f0f45a964)
> +++ 7e5a0d93117ecadfb15de3a6bebdb1aa94234fde/commit.c  (mode:100644 sha1:ef9af397471817837e1799d72f6707e0ccc949b9)
> @@ -83,3 +83,47 @@
>  		free(temp);
>  	}
>  }
> +
> +static void insert_by_date(struct commit_list **list, struct commit *item)
> +{
> +	struct commit_list **pp = list;
> +	struct commit_list *p;
> +	while ((p = *pp) != NULL) {
> +		if (p->item->date < item->date) {
> +			break;
> +		}
> +		pp = &p->next;
> +	}
> +	struct commit_list *insert = malloc(sizeof(struct commit_list));
> +	insert->next = *pp;
> +	*pp = insert;
> +	insert->item = item;
> +}

Note that you are breaking gcc-2.95 compatibility when using declarator in the middle of a block. Not that it might be a necessarily bad thing ;-) (although I still use gcc-2.95 a lot), just to ring a bell so that it doesn't slip through unnoticed and we can decide on a policy regarding this.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Daniel BarkalowNext: David A. Wheeler
Message 6 of 12 in “More patches”
  1. Daniel BarkalowApr 19, 2005
  2. 1/4 Report info from treesDaniel Barkalow, Apr 19, 2005
  3. Junio C HamanoApr 19, 2005
  4. Daniel BarkalowApr 19, 2005
  5. 2/4 Sorting commits by dateDaniel Barkalow, Apr 19, 2005
  6. Petr BaudisApr 19, 2005
  7. David A. WheelerApr 19, 2005
  8. Daniel BarkalowApr 19, 2005
  9. Petr BaudisApr 19, 2005
  10. Daniel BarkalowApr 19, 2005
  11. 3/4 Add http-pullDaniel Barkalow, Apr 19, 2005
  12. 4/4 Make merge-base use dates to find answerDaniel Barkalow, Apr 19, 2005

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.