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

Re: [PATCH 09/13] Allow helpers to report in "list" command that the ref is unchanged

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 5, 2009, 21:03 UTC
Message-ID
<alpine.DEB.1.00.0908052258440.8306@pacific.mpi-cbg.de>
In-Reply-To
<alpine.LNX.2.00.0908050056000.2147@iabervon.org>
Hi,
On Wed, 5 Aug 2009, Daniel Barkalow wrote:
> +			if (strstr(eon + 1, "unchanged")) {
I guess we'll want to have a helper like this already:
	static int has_attribute(const char *tail, const char *attr) {
		int len;
		if (!tail)
			return 0;
		len = strlen(attr);
		for (;;) {
			const char *space = strchrnul(tail, ' ');
			if (len == space - tail && !strncmp(tail, attr, len))
				return 1;
			if (!*space)
				return 0;
			tail = space + 1;
		}
	}

This guards against attributes that are substrings of other attributes. (You want to future-proof the attributes system, after all, i.e. handle helpers returning attributes unknown to the current Git.)

Ciao, Dscho

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 3 in “Allow helpers to report in "list" command that the ref is unchanged”
  1. 09/13 Allow helpers to report in "list" command that the ref is unchangedDaniel Barkalow, Aug 5, 2009
  2. Johannes SchindelinAug 5, 2009
  3. Daniel BarkalowAug 5, 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.