From: Johannes Schindelin Date: Wed, 05 Aug 2009 21:03:42 GMT Subject: Re: [PATCH 09/13] Allow helpers to report in "list" command that the ref is unchanged Message-ID: In-Reply-To: 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