Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Remove misleading date form api-index-skel.txt
From: Andreas Schwab @ 2012-12-16  8:47 UTC (permalink / raw)
  To: Thomas Ackermann; +Cc: git
In-Reply-To: <38388978.118261.1355647369577.JavaMail.ngmail@webmail21.arcor-online.net>

s/form/from/

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* [PATCH] Remove misleading date form api-index-skel.txt
From: Thomas Ackermann @ 2012-12-16  8:42 UTC (permalink / raw)
  To: git
In-Reply-To: <1582223824.296627.1355560147565.JavaMail.ngmail@webmail08.arcor-online.net>


Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
---
 Documentation/technical/api-index-skel.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Documentation/technical/api-index-skel.txt b/Documentation/technical/api-index-skel.txt
index af7cc2e..730cfac 100644
--- a/Documentation/technical/api-index-skel.txt
+++ b/Documentation/technical/api-index-skel.txt
@@ -11,5 +11,3 @@ documents them.
 ////////////////////////////////////////////////////////////////
 // table of contents end
 ////////////////////////////////////////////////////////////////
-
-2007-11-24
-- 
1.8.0.msysgit.0


---
Thomas

^ permalink raw reply related

* Re: [PATCH 2/2] Port to QNX
From: Joachim Schmitz @ 2012-12-16  8:27 UTC (permalink / raw)
  To: git
In-Reply-To: <1355510300-31541-3-git-send-email-kraai@ftbfs.org>

Matt Kraai wrote:
> From: Matt Kraai <matt.kraai@amo.abbott.com>
>
> Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
> ---
> Makefile          | 19 +++++++++++++++++++
> git-compat-util.h |  8 ++++++--
> 2 files changed, 25 insertions(+), 2 deletions(-)
>

snip

> diff --git a/git-compat-util.h b/git-compat-util.h
> index 2e79b8a..6c588ca 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -75,7 +75,7 @@
> # endif
> #elif !defined(__APPLE__) && !defined(__FreeBSD__) &&
>       !defined(__USLC__) && \ !defined(_M_UNIX) && !defined(__sgi) &&
> !defined(__DragonFly__) && \ -      !defined(__TANDEM)
> +      !defined(__TANDEM) && !defined(__QNX__)
> #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD
> needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX
> 5.3L needs this */ #endif
> @@ -99,7 +99,7 @@
> #include <stdlib.h>
> #include <stdarg.h>
> #include <string.h>
> -#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */
> +#if defined(__TANDEM) || defined(__QNX__) /* or HAVE_STRINGS_H or
> !NO_STRINGS_H? */ #include <strings.h> /* for strcasecmp() */

There's another recent thread, discussing to change this to "#ifdef 
HAVE_STRING_H" plus the infrastructure in Makefile and configure.ac.

Bye, Jojo 

^ permalink raw reply

* Re: [PATCH] git.c: add --index-file command-line option.
From: Manlio Perillo @ 2012-12-16  8:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vvcc2r0z8.fsf@alter.siamese.dyndns.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 16/12/2012 06:59, Junio C Hamano ha scritto:
> I
> Manlio Perillo <manlio.perillo@gmail.com> writes:
> 
>> This works with a shell.
>> I'm using Python to write a custom git command.
> 
> I would be very surprised if Python lacked a way to spawn a
> subprocess with an environment modified from the current process.

Of course it is possible, but a command-line option is more convenient,
IMHO.



Regards  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDNhGsACgkQscQJ24LbaUQ0dQCglUAw8zwRKNeDUGznfrm1xFKf
GQsAnA/ucztku4v9LnIr0Lv/gyl5ULiT
=j/1w
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: [PATCH v4 3/4] cache-tree: fix writing cache-tree when CE_REMOVE is present
From: Junio C Hamano @ 2012-12-16  7:20 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <1355631328-26678-4-git-send-email-pclouds@gmail.com>

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> entry_count is used in update_one() for two purposes:
>
> 1. to skip through the number of processed entries in in-memory index
> 2. to record the number of entries this cache-tree covers on disk
>
> Unfortunately when CE_REMOVE is present these numbers are not the same
> because CE_REMOVE entries are automatically removed before writing to
> disk but entry_count is not adjusted and still counts CE_REMOVE
> entries.

Nicely explained.  I wonder if we can also add a piece of test to
the patch 4/4 to demonstrate the issue with CE_REMOVE entries,
though.

Thanks.

^ permalink raw reply

* Re: [PATCH 1/1] tests: Allow customization of how say_color() prints
From: Junio C Hamano @ 2012-12-16  6:34 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <50CCCB86.5080701@ramsay1.demon.co.uk>

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index f50f834..9dcf3c1 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -202,6 +202,15 @@ do
>  	esac
>  done
>  
> +if test -z "$GIT_TEST_PRINT"
> +then
> +	GIT_TEST_PRINT="printf %s"
> +fi
> +if test -z "$GIT_TEST_PRINT_LN"
> +then
> +	GIT_TEST_PRINT_LN="printf %s\n"
> +fi
> +
>  if test -n "$color"
>  then
>  	say_color () {
> @@ -221,7 +230,7 @@ then
>  			test -n "$quiet" && return;;
>  		esac
>  		shift
> -		printf "%s" "$*"
> +		$GIT_TEST_PRINT "$*"
>  		tput sgr0
>  		echo
>  		)
> @@ -230,7 +239,7 @@ else
>  	say_color() {
>  		test -z "$1" && test -n "$quiet" && return
>  		shift
> -		printf "%s\n" "$*"
> +		$GIT_TEST_PRINT_LN "$*"
>  	}
>  fi

As you said, this is ugly and also unwieldy in that I do not see an
easy way for a platform/builder to define something that needs to
pass a parameter with $IFS in it in these two variables.

Why does your printf die in the first place???

^ permalink raw reply

* Re: [PATCH] git.c: add --index-file command-line option.
From: Junio C Hamano @ 2012-12-16  5:59 UTC (permalink / raw)
  To: Manlio Perillo; +Cc: git
In-Reply-To: <50CCF324.5060802@gmail.com>

I
Manlio Perillo <manlio.perillo@gmail.com> writes:

> This works with a shell.
> I'm using Python to write a custom git command.

I would be very surprised if Python lacked a way to spawn a
subprocess with an environment modified from the current process.

^ permalink raw reply

* Re: [PATCH] t3070: Disable some failing fnmatch tests
From: Nguyen Thai Ngoc Duy @ 2012-12-16  4:31 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list
In-Reply-To: <50CCCD36.9020001@ramsay1.demon.co.uk>

On Sun, Dec 16, 2012 at 2:19 AM, Ramsay Jones
<ramsay@ramsay1.demon.co.uk> wrote:
>
> The failing tests make use of a POSIX character class, '[:xdigit:]'
> in this case, which some versions of the fnmatch() library function
> do not support. In the spirit of commit f1cf7b79 ("t3070: disable
> unreliable fnmatch tests", 15-10-2012), we disable the fnmatch() half
> of these tests.

I have no problem with this. You're on cygwin, right?
-- 
Duy

^ permalink raw reply

* [PATCH v4 4/4] cache-tree: invalidate i-t-a paths after generating trees
From: Nguyễn Thái Ngọc Duy @ 2012-12-16  4:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1355631328-26678-1-git-send-email-pclouds@gmail.com>

Intent-to-add entries used to forbid writing trees so it was not a
problem. After commit 3f6d56d (commit: ignore intent-to-add entries
instead of refusing - 2012-02-07), we can generate trees from an index
with i-t-a entries.

However, the commit forgets to invalidate all paths leading to i-t-a
entries. With fully valid cache-tree (e.g. after commit or
write-tree), diff operations may prefer cache-tree to index and not
see i-t-a entries in the index, because cache-tree does not have them.

Reported-by: Jonathon Mah <me@JonathonMah.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 cache-tree.c          | 14 ++++++++++++--
 t/t2203-add-intent.sh | 20 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index 2c10b2e..37e4d00 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -244,6 +244,7 @@ static int update_one(struct cache_tree *it,
 	struct strbuf buffer;
 	int missing_ok = flags & WRITE_TREE_MISSING_OK;
 	int dryrun = flags & WRITE_TREE_DRY_RUN;
+	int to_invalidate = 0;
 	int i;
 
 	*skip_count = 0;
@@ -333,6 +334,8 @@ static int update_one(struct cache_tree *it,
 			i += sub->count;
 			sha1 = sub->cache_tree->sha1;
 			mode = S_IFDIR;
+			if (sub->cache_tree->entry_count < 0)
+				to_invalidate = 1;
 		}
 		else {
 			sha1 = ce->sha1;
@@ -356,8 +359,15 @@ static int update_one(struct cache_tree *it,
 			continue;
 		}
 
-		if (ce->ce_flags & CE_INTENT_TO_ADD)
+		/*
+		 * CE_INTENT_TO_ADD entries exist on on-disk index but
+		 * they are not part of generated trees. Invalidate up
+		 * to root to force cache-tree users to read elsewhere.
+		 */
+		if (ce->ce_flags & CE_INTENT_TO_ADD) {
+			to_invalidate = 1;
 			continue;
+		}
 
 		strbuf_grow(&buffer, entlen + 100);
 		strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
@@ -377,7 +387,7 @@ static int update_one(struct cache_tree *it,
 	}
 
 	strbuf_release(&buffer);
-	it->entry_count = i - *skip_count;
+	it->entry_count = to_invalidate ? -1 : i - *skip_count;
 #if DEBUG
 	fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
 		it->entry_count, it->subtree_nr,
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index ec35409..2a4a749 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -62,5 +62,25 @@ test_expect_success 'can "commit -a" with an i-t-a entry' '
 	git commit -a -m all
 '
 
+test_expect_success 'cache-tree invalidates i-t-a paths' '
+	git reset --hard &&
+	mkdir dir &&
+	: >dir/foo &&
+	git add dir/foo &&
+	git commit -m foo &&
+
+	: >dir/bar &&
+	git add -N dir/bar &&
+	git diff --cached --name-only >actual &&
+	echo dir/bar >expect &&
+	test_cmp expect actual &&
+
+	git write-tree >/dev/null &&
+
+	git diff --cached --name-only >actual &&
+	echo dir/bar >expect &&
+	test_cmp expect actual
+'
+
 test_done
 
-- 
1.8.0.rc2.23.g1fb49df

^ permalink raw reply related

* [PATCH v4 3/4] cache-tree: fix writing cache-tree when CE_REMOVE is present
From: Nguyễn Thái Ngọc Duy @ 2012-12-16  4:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1355631328-26678-1-git-send-email-pclouds@gmail.com>

entry_count is used in update_one() for two purposes:

1. to skip through the number of processed entries in in-memory index
2. to record the number of entries this cache-tree covers on disk

Unfortunately when CE_REMOVE is present these numbers are not the same
because CE_REMOVE entries are automatically removed before writing to
disk but entry_count is not adjusted and still counts CE_REMOVE
entries.

Separate the two use cases into two different variables. #1 is taken
care by the new field count in struct cache_tree_sub and entry_count
is prepared for #2.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 cache-tree.c | 30 +++++++++++++++++++++++-------
 cache-tree.h |  1 +
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index 44eed28..2c10b2e 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -238,6 +238,7 @@ static int update_one(struct cache_tree *it,
 		      int entries,
 		      const char *base,
 		      int baselen,
+		      int *skip_count,
 		      int flags)
 {
 	struct strbuf buffer;
@@ -245,6 +246,8 @@ static int update_one(struct cache_tree *it,
 	int dryrun = flags & WRITE_TREE_DRY_RUN;
 	int i;
 
+	*skip_count = 0;
+
 	if (0 <= it->entry_count && has_sha1_file(it->sha1))
 		return it->entry_count;
 
@@ -264,7 +267,7 @@ static int update_one(struct cache_tree *it,
 		struct cache_entry *ce = cache[i];
 		struct cache_tree_sub *sub;
 		const char *path, *slash;
-		int pathlen, sublen, subcnt;
+		int pathlen, sublen, subcnt, subskip;
 
 		path = ce->name;
 		pathlen = ce_namelen(ce);
@@ -289,10 +292,13 @@ static int update_one(struct cache_tree *it,
 				    cache + i, entries - i,
 				    path,
 				    baselen + sublen + 1,
+				    &subskip,
 				    flags);
 		if (subcnt < 0)
 			return subcnt;
 		i += subcnt;
+		sub->count = subcnt; /* to be used in the next loop */
+		*skip_count += subskip;
 		sub->used = 1;
 	}
 
@@ -324,7 +330,7 @@ static int update_one(struct cache_tree *it,
 			if (!sub)
 				die("cache-tree.c: '%.*s' in '%s' not found",
 				    entlen, path + baselen, path);
-			i += sub->cache_tree->entry_count;
+			i += sub->count;
 			sha1 = sub->cache_tree->sha1;
 			mode = S_IFDIR;
 		}
@@ -340,8 +346,18 @@ static int update_one(struct cache_tree *it,
 				mode, sha1_to_hex(sha1), entlen+baselen, path);
 		}
 
-		if (ce->ce_flags & (CE_REMOVE | CE_INTENT_TO_ADD))
-			continue; /* entry being removed or placeholder */
+		/*
+		 * CE_REMOVE entries are removed before the index is
+		 * written to disk. Skip them to remain consistent
+		 * with the future on-disk index.
+		 */
+		if (ce->ce_flags & CE_REMOVE) {
+			*skip_count = *skip_count + 1;
+			continue;
+		}
+
+		if (ce->ce_flags & CE_INTENT_TO_ADD)
+			continue;
 
 		strbuf_grow(&buffer, entlen + 100);
 		strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
@@ -361,7 +377,7 @@ static int update_one(struct cache_tree *it,
 	}
 
 	strbuf_release(&buffer);
-	it->entry_count = i;
+	it->entry_count = i - *skip_count;
 #if DEBUG
 	fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
 		it->entry_count, it->subtree_nr,
@@ -375,11 +391,11 @@ int cache_tree_update(struct cache_tree *it,
 		      int entries,
 		      int flags)
 {
-	int i;
+	int i, skip;
 	i = verify_cache(cache, entries, flags);
 	if (i)
 		return i;
-	i = update_one(it, cache, entries, "", 0, flags);
+	i = update_one(it, cache, entries, "", 0, &skip, flags);
 	if (i < 0)
 		return i;
 	return 0;
diff --git a/cache-tree.h b/cache-tree.h
index d8cb2e9..55d0f59 100644
--- a/cache-tree.h
+++ b/cache-tree.h
@@ -7,6 +7,7 @@
 struct cache_tree;
 struct cache_tree_sub {
 	struct cache_tree *cache_tree;
+	int count;		/* internally used by update_one() */
 	int namelen;
 	int used;
 	char name[FLEX_ARRAY];
-- 
1.8.0.rc2.23.g1fb49df

^ permalink raw reply related

* [PATCH v4 2/4] cache-tree: replace "for" loops in update_one with "while" loops
From: Nguyễn Thái Ngọc Duy @ 2012-12-16  4:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1355631328-26678-1-git-send-email-pclouds@gmail.com>

The loops in update_one can be increased in two different ways: step
by one for files and by <n> for directories. "for" loop is not
suitable for this as it always steps by one and special handling is
required for directories. Replace them with "while" loops for clarity.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 cache-tree.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index e2beab5..44eed28 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -259,7 +259,8 @@ static int update_one(struct cache_tree *it,
 	/*
 	 * Find the subtrees and update them.
 	 */
-	for (i = 0; i < entries; i++) {
+	i = 0;
+	while (i < entries) {
 		struct cache_entry *ce = cache[i];
 		struct cache_tree_sub *sub;
 		const char *path, *slash;
@@ -271,8 +272,10 @@ static int update_one(struct cache_tree *it,
 			break; /* at the end of this level */
 
 		slash = strchr(path + baselen, '/');
-		if (!slash)
+		if (!slash) {
+			i++;
 			continue;
+		}
 		/*
 		 * a/bbb/c (base = a/, slash = /c)
 		 * ==>
@@ -289,7 +292,7 @@ static int update_one(struct cache_tree *it,
 				    flags);
 		if (subcnt < 0)
 			return subcnt;
-		i += subcnt - 1;
+		i += subcnt;
 		sub->used = 1;
 	}
 
@@ -300,7 +303,8 @@ static int update_one(struct cache_tree *it,
 	 */
 	strbuf_init(&buffer, 8192);
 
-	for (i = 0; i < entries; i++) {
+	i = 0;
+	while (i < entries) {
 		struct cache_entry *ce = cache[i];
 		struct cache_tree_sub *sub;
 		const char *path, *slash;
@@ -320,7 +324,7 @@ static int update_one(struct cache_tree *it,
 			if (!sub)
 				die("cache-tree.c: '%.*s' in '%s' not found",
 				    entlen, path + baselen, path);
-			i += sub->cache_tree->entry_count - 1;
+			i += sub->cache_tree->entry_count;
 			sha1 = sub->cache_tree->sha1;
 			mode = S_IFDIR;
 		}
@@ -328,6 +332,7 @@ static int update_one(struct cache_tree *it,
 			sha1 = ce->sha1;
 			mode = ce->ce_mode;
 			entlen = pathlen - baselen;
+			i++;
 		}
 		if (mode != S_IFGITLINK && !missing_ok && !has_sha1_file(sha1)) {
 			strbuf_release(&buffer);
-- 
1.8.0.rc2.23.g1fb49df

^ permalink raw reply related

* [PATCH v4 0/4] nd/invalidate-i-t-a-cache-tree
From: Nguyễn Thái Ngọc Duy @ 2012-12-16  4:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

This version also fixes the CE_REMOVE bug I mentioned. As a side
effect, the bug fix makes the i-t-a fix cleaner.

Nguyễn Thái Ngọc Duy (4):
  cache-tree: remove dead i-t-a code in verify_cache()
  cache-tree: replace "for" loops in update_one with "while" loops
  cache-tree: fix writing cache-tree when CE_REMOVE is present
  cache-tree: invalidate i-t-a paths after generating trees

 cache-tree.c          | 61 +++++++++++++++++++++++++++++++++++++--------------
 cache-tree.h          |  1 +
 t/t2203-add-intent.sh | 20 +++++++++++++++++
 3 files changed, 65 insertions(+), 17 deletions(-)

-- 
1.8.0.rc2.23.g1fb49df

^ permalink raw reply

* [PATCH v4 1/4] cache-tree: remove dead i-t-a code in verify_cache()
From: Nguyễn Thái Ngọc Duy @ 2012-12-16  4:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1355631328-26678-1-git-send-email-pclouds@gmail.com>

This code is added in 331fcb5 (git add --intent-to-add: do not let an
empty blob be committed by accident - 2008-11-28) to forbid committing
when i-t-a entries are present. When we allow that, we forgot to
remove this.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 cache-tree.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index 28ed657..e2beab5 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -166,12 +166,8 @@ static int verify_cache(struct cache_entry **cache,
 				fprintf(stderr, "...\n");
 				break;
 			}
-			if (ce_stage(ce))
-				fprintf(stderr, "%s: unmerged (%s)\n",
-					ce->name, sha1_to_hex(ce->sha1));
-			else
-				fprintf(stderr, "%s: not added yet\n",
-					ce->name);
+			fprintf(stderr, "%s: unmerged (%s)\n",
+				ce->name, sha1_to_hex(ce->sha1));
 		}
 	}
 	if (funny)
-- 
1.8.0.rc2.23.g1fb49df

^ permalink raw reply related

* Re: [PATCH 0/2] Port to QNX
From: Matt Kraai @ 2012-12-15 21:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy5gzrwih.fsf@alter.siamese.dyndns.org>

On Sat, Dec 15, 2012 at 10:38:30AM -0800, Junio C Hamano wrote:
> I do not mind queuing this on 'pu' but do you want to see your
> ftbfs.org address in the commit objects, or the other one that you
> are not using to interact with us?

Great!  I'd prefer to use the amo.abbott.com address in the commit
objects, since that's where I did the work.  I'm using this email
address because it doesn't require figuring out how to send proper
emails via Outlook and/or Exchange.

-- 
Matt

^ permalink raw reply

* Re: [PATCH] git.c: add --index-file command-line option.
From: Manlio Perillo @ 2012-12-15 22:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vliczrttq.fsf@alter.siamese.dyndns.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 15/12/2012 20:36, Junio C Hamano ha scritto:
> [...]
>>>> Unlike other environment variables (e.g. GIT_WORK_TREE,
>>>> GIT_NAMESPACE), it was not possible to set the GIT_INDEX_FILE
>>>> environment variable using the command line.
>>>
>>> Is this necessary?  I'd prefer to see a better reason than "just
>>> because others have it".
>>
>> A long running program will be able to tell git to use an alternate
>> index file, without having to modify its own environment,...
> 
> Hrm, isn't that the single-shot environment export syntax
> 
> 	GIT_INDEX_FILE=foo git blah
> 
> is for?  Is there a real-world need for this?
> 

This works with a shell.
I'm using Python to write a custom git command.




Regards  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDM8yQACgkQscQJ24LbaUTftQCbBC7D9P7Sqlr9GzWuCIcIHPf2
aQcAn13+d4trLZS4izGvZtoaopMav4nV
=vfb6
-----END PGP SIGNATURE-----

^ permalink raw reply

* [ANNOUNCE] Git v1.8.1-rc2
From: Junio C Hamano @ 2012-12-15 20:54 UTC (permalink / raw)
  To: git; +Cc: Linux Kernel

A release candidate Git v1.8.1-rc2 is now available for testing
at the usual places.

The release tarballs are found at:

    http://code.google.com/p/git-core/downloads/list

and their SHA-1 checksums are:

0a65a3d203b8d6e320f15abb040e1137e333c967  git-1.8.1.rc2.tar.gz
e6bc111686e6864cc3f078b9523ef1057a7fff8f  git-htmldocs-1.8.1.rc2.tar.gz
2c97472ae861454ff445868c40b49db66fa09f50  git-manpages-1.8.1.rc2.tar.gz

Also the following public repositories all have a copy of the v1.8.1-rc2
tag and the master branch that the tag points at:

  url = git://repo.or.cz/alt-git.git
  url = https://code.google.com/p/git-core/
  url = git://git.sourceforge.jp/gitroot/git-core/git.git
  url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
  url = https://github.com/gitster/git

Git v1.8.1 Release Notes (draft)
========================

Backward compatibility notes
----------------------------

In the next major release (not *this* one), we will change the
behavior of the "git push" command.

When "git push [$there]" does not say what to push, we have used the
traditional "matching" semantics so far (all your branches were sent
to the remote as long as there already are branches of the same name
over there).  We will use the "simple" semantics that pushes the
current branch to the branch with the same name, only when the current
branch is set to integrate with that remote branch.  There is a user
preference configuration variable "push.default" to change this, and
"git push" will warn about the upcoming change until you set this
variable in this release.

"git branch --set-upstream" is deprecated and may be removed in a
relatively distant future.  "git branch [-u|--set-upstream-to]" has
been introduced with a saner order of arguments to replace it.


Updates since v1.8.0
--------------------

UI, Workflows & Features

 * Command-line completion scripts for tcsh and zsh have been added.

 * A new remote-helper interface for Mercurial has been added to
   contrib/remote-helpers.

 * We used to have a workaround for a bug in ancient "less" that
   causes it to exit without any output when the terminal is resized.
   The bug has been fixed in "less" version 406 (June 2007), and the
   workaround has been removed in this release.

 * Some documentation pages that used to ship only in the plain text
   format are now formatted in HTML as well.

 * "git-prompt" scriptlet (in contrib/completion) can be told to paint
   pieces of the hints in the prompt string in colors.

 * A new configuration variable "diff.context" can be used to
   give the default number of context lines in the patch output, to
   override the hardcoded default of 3 lines.

 * When "git checkout" checks out a branch, it tells the user how far
   behind (or ahead) the new branch is relative to the remote tracking
   branch it builds upon.  The message now also advises how to sync
   them up by pushing or pulling.  This can be disabled with the
   advice.statusHints configuration variable.

 * "git config --get" used to diagnose presence of multiple
   definitions of the same variable in the same configuration file as
   an error, but it now applies the "last one wins" rule used by the
   internal configuration logic.  Strictly speaking, this may be an
   API regression but it is expected that nobody will notice it in
   practice.

 * "git log -p -S<string>" now looks for the <string> after applying
   the textconv filter (if defined); earlier it inspected the contents
   of the blobs without filtering.

 * "git format-patch" learned the "--notes=<ref>" option to give
   notes for the commit after the three-dash lines in its output.

 * "git log --grep=<pcre>" learned to honor the "grep.patterntype"
   configuration set to "perl".

 * "git replace -d <object>" now interprets <object> as an extended
   SHA-1 (e.g. HEAD~4 is allowed), instead of only accepting full hex
   object name.

 * "git rm $submodule" used to punt on removing a submodule working
   tree to avoid losing the repository embedded in it.  Because
   recent git uses a mechanism to separate the submodule repository
   from the submodule working tree, "git rm" learned to detect this
   case and removes the submodule working tree when it is safe to do so.

 * "git send-email" used to prompt for the sender address, even when
   the committer identity is well specified (e.g. via user.name and
   user.email configuration variables).  The command no longer gives
   this prompt when not necessary.

 * "git send-email" did not allow non-address garbage strings to
   appear after addresses on Cc: lines in the patch files (and when
   told to pick them up to find more recipients), e.g.

     Cc: Stable Kernel <stable@k.org> # for v3.2 and up

   The command now strips " # for v3.2 and up" part before adding the
   remainder of this line to the list of recipients.

 * "git submodule add" learned to add a new submodule at the same
   path as the path where an unrelated submodule was bound to in an
   existing revision via the "--name" option.

 * "git submodule sync" learned the "--recursive" option.

 * "diff.submodule" configuration variable can be used to give custom
   default value to the "git diff --submodule" option.

 * "git symbolic-ref" learned the "-d $symref" option to delete the
   named symbolic ref, which is more intuitive way to spell it than
   "update-ref -d --no-deref $symref".


Foreign Interface

 * "git cvsimport" can be told to record timezones (other than GMT)
   per-author via its author info file.

 * The remote helper interface to interact with subversion
   repositories (one of the GSoC 2012 projects) has been merged.

 * The documentation for git(1) was pointing at a page at an external
   site for the list of authors that no longer existed.  The link has
   been updated to point at an alternative site.


Performance, Internal Implementation, etc.

 * Compilation on Cygwin with newer header files are supported now.

 * A couple of low-level implementation updates on MinGW.

 * The logic to generate the initial advertisement from "upload-pack"
   (i.e. what is invoked by "git fetch" on the other side of the
   connection) to list what refs are available in the repository has
   been optimized.

 * The logic to find set of attributes that match a given path has
   been optimized.

 * Use preloadindex in "git diff-index" and "git update-index", which
   has a nice speedup on systems with slow stat calls (and even on
   Linux).


Also contains minor documentation updates and code clean-ups.


Fixes since v1.8.0
------------------

Unless otherwise noted, all the fixes since v1.8.0 in the maintenance
track are contained in this release (see release notes to them for
details).

 * The configuration parser had an unnecessary hardcoded limit on
   variable names that was not checked consistently.

 * The "say" function in the test scaffolding incorrectly allowed
   "echo" to interpret "\a" as if it were a C-string asking for a
   BEL output.

 * "git mergetool" feeds /dev/null as a common ancestor when dealing
   with an add/add conflict, but p4merge backend cannot handle
   it. Work it around by passing a temporary empty file.

 * "git log -F -E --grep='<ere>'" failed to use the given <ere>
   pattern as extended regular expression, and instead looked for the
   string literally.

 * "git grep -e pattern <tree>" asked the attribute system to read
   "<tree>:.gitattributes" file in the working tree, which was
   nonsense.

 * A symbolic ref refs/heads/SYM was not correctly removed with "git
   branch -d SYM"; the command removed the ref pointed by SYM
   instead.

 * Update "remote tracking branch" in the documentation to
   "remote-tracking branch".

 * "git pull --rebase" run while the HEAD is detached tried to find
   the upstream branch of the detached HEAD (which by definition
   does not exist) and emitted unnecessary error messages.

 * The refs/replace hierarchy was not mentioned in the
   repository-layout docs.

 * Various rfc2047 quoting issues around a non-ASCII name on the
   From: line in the output from format-patch have been corrected.

 * Sometimes curl_multi_timeout() function suggested a wrong timeout
   value when there is no file descriptor to wait on and the http
   transport ended up sleeping for minutes in select(2) system call.
   A workaround has been added for this.

 * For a fetch refspec (or the result of applying wildcard on one),
   we always want the RHS to map to something inside "refs/"
   hierarchy, but the logic to check it was not exactly right.
   (merge 5c08c1f jc/maint-fetch-tighten-refname-check later to maint).

 * "git diff -G<pattern>" did not honor textconv filter when looking
   for changes.

 * Some HTTP servers ask for auth only during the actual packing phase
   (not in ls-remote phase); this is not really a recommended
   configuration, but the clients used to fail to authenticate with
   such servers.
   (merge 2e736fd jk/maint-http-half-auth-fetch later to maint).

 * "git p4" used to try expanding malformed "$keyword$" that spans
   across multiple lines.

 * Syntax highlighting in "gitweb" was not quite working.

 * RSS feed from "gitweb" had a xss hole in its title output.

 * "git config --path $key" segfaulted on "[section] key" (a boolean
   "true" spelled without "=", not "[section] key = true").

 * "git checkout -b foo" while on an unborn branch did not say
   "Switched to a new branch 'foo'" like other cases.

 * Various codepaths have workaround for a common misconfiguration to
   spell "UTF-8" as "utf8", but it was not used uniformly.  Most
   notably, mailinfo (which is used by "git am") lacked this support.

 * We failed to mention a file without any content change but whose
   permission bit was modified, or (worse yet) a new file without any
   content in the "git diff --stat" output.

 * When "--stat-count" hides a diffstat for binary contents, the total
   number of added and removed lines at the bottom was computed
   incorrectly.

 * When "--stat-count" hides a diffstat for unmerged paths, the total
   number of affected files at the bottom of the "diff --stat" output
   was computed incorrectly.

 * "diff --shortstat" miscounted the total number of affected files
   when there were unmerged paths.

 * "update-ref -d --deref SYM" to delete a ref through a symbolic ref
   that points to it did not remove it correctly.

----------------------------------------------------------------

Changes since v1.8.1-rc1 are as follows:

Anders Kaseorg (1):
      git-prompt: Document GIT_PS1_DESCRIBE_STYLE

Erik Faye-Lund (7):
      mingw: correct exit-code for SIGALRM's SIG_DFL
      mingw: make fgetc raise SIGINT if apropriate
      compat/terminal: factor out echo-disabling
      compat/terminal: separate input and output handles
      mingw: reuse tty-version of git_terminal_prompt
      mingw: get rid of getpass implementation
      mingw_rmdir: do not prompt for retry when non-empty

Jeff King (1):
      remote-testsvn: fix unitialized variable

Junio C Hamano (5):
      git(1): remove a defunct link to "list of authors"
      Git 1.8.0.2
      git-prompt.sh: update PROMPT_COMMAND documentation
      git(1): show link to contributor summary page
      Git 1.8.1-rc2

Manlio Perillo (1):
      git.txt: add missing info about --git-dir command-line option

Marc Khouzam (1):
      Add file completion to tcsh git completion.

Matthew Daley (1):
      Fix sizeof usage in get_permutations

Max Horn (6):
      git-remote-helpers.txt: document invocation before input format
      git-remote-helpers.txt: document missing capabilities
      git-remote-helpers.txt: minor grammar fix
      git-remote-helpers.txt: rearrange description of capabilities
      git-remote-helpers.txt: clarify command <-> capability correspondences
      git-remote-helpers.txt: clarify options & ref list attributes

Stefano Lattarini (1):
      Makefile: whitespace style fixes in macro definitions

Sébastien Loriot (1):
      Documentation/git-stash.txt: add a missing verb

Thomas Ackermann (1):
      Renumber list in api-command.txt

^ permalink raw reply

* Re: [PATCH v2 0/7] Allow git log to use mailmap file
From: Junio C Hamano @ 2012-12-15 20:18 UTC (permalink / raw)
  To: Antoine Pelisse; +Cc: git
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>

Antoine Pelisse <apelisse@gmail.com> writes:

> Implement the feature suggested by Rich Mindwinter and Junio C Hamano
> (and following his advices)
>
>
>
> Allows git show/log commands to map author and committer
> names and emails using the mailmap file.
>
> Updates related to this second series:
>   - All tests are successful after each patch
>   - Use split_ident_line in shortlog.c
>   - Documentation has been added to git-log.txt
>   - Test has been added to check that we use the file
>   - Lots of improvements in the way strbufs are used
>   - New interface to map_user()
>   - Bunch of other fixes

The updated map_user() and its users look much nicer now.  Applying
your patches with "git am --whitespace=error" spots a few style
violations, though.

> git glog --committer/--author is still not looking for mailmap user
> names.

I think we should stop using the header grep mechanism for these and
instead keep two separate grep expressions in struct rev_info and
use them in revision.c::commit_match().  The unification of header
filter and message grep filter done in 2d10c55 (git log: Unify
header_filter and message_filter into one., 2006-09-20) may not have
been a good idea.

Thanks.

^ permalink raw reply

* Re: [PATCH] Makefile: detect when PYTHON_PATH changes
From: Christian Couder @ 2012-12-15 20:09 UTC (permalink / raw)
  To: gitster; +Cc: git
In-Reply-To: <7vehirustv.fsf@alter.siamese.dyndns.org>

From: Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Makefile: detect when PYTHON_PATH changes
Date: Sat, 15 Dec 2012 09:29:48 -0800

> Christian Couder <chriscool@tuxfamily.org> writes:
> 
>> @@ -2636,6 +2636,18 @@ GIT-GUI-VARS: FORCE
>>              fi
>>  endif
>>  
>> +### Detect Python interpreter path changes
>> +ifndef NO_PYTHON
>> +TRACK_VARS = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')
>> +
>> +GIT-PYTHON-VARS: FORCE
>> +	@VARS='$(TRACK_VARS)'; \
>> +	    if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
>> +		echo 1>&2 "    * new Python interpreter location"; \
>> +		echo "$$VARS" >$@; \
>> +            fi
>> +endif
> 
> Do we have the same issue when you decide to use /usr/local/bin/sh
> after building with /bin/sh set to SHELL_PATH?
> 
>  - If yes, I presume that there will be follow-up patches to this
>    one, for SHELL_PATH, PERL_PATH, and TCLTK_PATH (there may be
>    other languages but I didn't bother to check).  How would the use
>    of language agnostic looking TRACK_VARS variable in this patch
>    affect such follow-up patches?

Actually, just above the above hunk, there is:

### Detect Tck/Tk interpreter path changes
ifndef NO_TCLTK
TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')

GIT-GUI-VARS: FORCE
        @VARS='$(TRACK_VARS)'; \
            if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
                echo 1>&2 "    * new Tcl/Tk interpreter location"; \
                echo "$$VARS" >$@; \
            fi
endif

But you are right, TRACK_VARS should probably be something like
TRACK_TCLTK when used for TCLTK and TRACK_PYTHON when used for Python.

By the way it looks like GIT-GUI-VARS is not used, so perhaps the
detection of Tck/Tk interpreter path changes above could be removed.

(The detection is done in git-gui/Makefile too.)

About shell, there is the following:

SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
        $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
        $(gitwebdir_SQ):$(PERL_PATH_SQ)

and then

GIT-SCRIPT-DEFINES: FORCE
        @FLAGS='$(SCRIPT_DEFINES)'; \
            if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
                echo 1>&2 "    * new script parameters"; \
                echo "$$FLAGS" >$@; \
            fi


$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@

$(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        mv $@+ $@

So it looks to me that at least for SHELL_PATH, things are done
properly. 

>  - If no (in other words, if we rebuild shell-scripted porcelains
>    when SHELL_PATH changes), wouldn't it be better to see how it is
>    done and hook into the same mechanism?

You would like me to just add $(PYTHON_PATH_SQ) in SCRIPT_DEFINES and
then use GIT-SCRIPT-DEFINES instead of GIT-PYTHON-VARS to decide if
python scripts should be rebuilt?

>  - If no, and if the approach taken in this patch is better than the
>    one used to rebuild shell scripts (it may limit the scope of
>    rebuilding when path changes, or something, but again, I didn't
>    bother to check), 

Yeah, I think it is better because it limits the scope of rebuilding,
and because nothing is done for Python, while there are some
mechanisms in place for other languages.

> then again follow-up patches to this one to
>    describe dependencies to build scripts in other languages in a
>    similar way to this patch would come in the future.  The same
>    question regarding TRACK_VARS applies in this case.

I agree about TRACK_VARS. About other languages, I will have another
look, but it seems that they already have what they need.

> By the way, "1>&2" is easier to read if written as just ">&2", I
> think.

Ok I will change this.

Thanks,
Christian.

^ permalink raw reply

* Re: [PATCH] README: Git is released under the GPLv2, not just "the GPL"
From: Stefano Lattarini @ 2012-12-15 19:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vhannrtot.fsf@alter.siamese.dyndns.org>

On 12/15/2012 08:39 PM, Junio C Hamano wrote:
> Stefano Lattarini <stefano.lattarini@gmail.com> writes:
> 
>> On 12/15/2012 07:35 PM, Junio C Hamano wrote:
>>> ...
>>> -Git is an Open Source project covered by the GNU General Public License.
>>> +Git is an Open Source project covered by the GNU General Public
>>> +License version 2 (some parts of it are under different licenses).
>>>
>> Maybe you could be even more explicit ans state "some parts of it are
>> under different licenses, compatible with the GPLv2".  But maybe this
>> is just overkill?
> 
> I personally do not think it is an overkill; because this "clarify
> that we are version 2", followed by "not everything is, but as a
> whole it is still GPLv2" is in the end about covering our ass, it is
> better to be as clear as possible without making it into a novel.
> 
Well, if you put it this way :-)  I agree that it's better be safe
than be sorry.

Thanks,
  Stefano

^ permalink raw reply

* Re: [PATCH] README: Git is released under the GPLv2, not just "the GPL"
From: Junio C Hamano @ 2012-12-15 19:39 UTC (permalink / raw)
  To: Stefano Lattarini; +Cc: git
In-Reply-To: <50CCCE0A.40305@gmail.com>

Stefano Lattarini <stefano.lattarini@gmail.com> writes:

> On 12/15/2012 07:35 PM, Junio C Hamano wrote:
>> ...
>> -Git is an Open Source project covered by the GNU General Public License.
>> +Git is an Open Source project covered by the GNU General Public
>> +License version 2 (some parts of it are under different licenses).
>>
> Maybe you could be even more explicit ans state "some parts of it are
> under different licenses, compatible with the GPLv2".  But maybe this
> is just overkill?

I personally do not think it is an overkill; because this "clarify
that we are version 2", followed by "not everything is, but as a
whole it is still GPLv2" is in the end about covering our ass, it is
better to be as clear as possible without making it into a novel.

^ permalink raw reply

* Re: [PATCH] git.c: add --index-file command-line option.
From: Junio C Hamano @ 2012-12-15 19:36 UTC (permalink / raw)
  To: Manlio Perillo; +Cc: git
In-Reply-To: <50CCC73B.3070802@gmail.com>

Manlio Perillo <manlio.perillo@gmail.com> writes:

> Il 15/12/2012 19:02, Junio C Hamano ha scritto:
>> Manlio Perillo <manlio.perillo@gmail.com> writes:
>> 
>>> Unlike other environment variables (e.g. GIT_WORK_TREE,
>>> GIT_NAMESPACE), it was not possible to set the GIT_INDEX_FILE
>>> environment variable using the command line.
>> 
>> Is this necessary?  I'd prefer to see a better reason than "just
>> because others have it".
>
> A long running program will be able to tell git to use an alternate
> index file, without having to modify its own environment,...

Hrm, isn't that the single-shot environment export syntax

	GIT_INDEX_FILE=foo git blah

is for?  Is there a real-world need for this?

^ permalink raw reply

* Re: [PATCH 1/2] Make lock local to fetch_pack
From: Junio C Hamano @ 2012-12-15 19:31 UTC (permalink / raw)
  To: Matt Kraai; +Cc: git, Matt Kraai
In-Reply-To: <7vtxrnrwer.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> Matt Kraai <kraai@ftbfs.org> writes:
>
>> From: Matt Kraai <matt.kraai@amo.abbott.com>
>>
>> lock is only used by fetch_pack, so move it into that function.
>>
>> Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
>> ---
>>  fetch-pack.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> Eh, did you base your patch on something older than 2d4177c (Make
> fetch-pack a builtin with an internal API, 2007-09-10)???

Ah, nevermind.  I see we refactored this out recently but that is
still in flight.

^ permalink raw reply

* [PATCH] mailmap.c: Fix a sparse warning
From: Ramsay Jones @ 2012-12-15 19:25 UTC (permalink / raw)
  To: apelisse; +Cc: Junio C Hamano, GIT Mailing-list


In particular, sparse issues an "Using plain integer as NULL pointer"
warning (line 214), since an integer zero is passed as the second
actual argument in a strbuf_detach() call. The expected type for
this parameter is 'size_t *'. In order to suppress the warning, we
simply pass a NULL pointer constant instead.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Antoine,

When you re-roll your mailmap patches (branch 'ap/log-mailmap') could
you please squash this into commit a09b6cd9 ("mailmap: Remove buffer
length limit in map_user", 11-12-2012).

Thanks!

ATB,
Ramsay Jones

 mailmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mailmap.c b/mailmap.c
index e636278..0608eb3 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -211,7 +211,7 @@ int map_user(struct string_list *map,
 	for (i = 0; i < end_of_email - email; i++)
 		strbuf_addch(&buf, tolower(email[i]));
 	strbuf_addch(&buf, 0);
-	mailbuf = strbuf_detach(&buf, 0);
+	mailbuf = strbuf_detach(&buf, NULL);
 
 	debug_mm("map_user: map '%s' <%s>\n", name, mailbuf);
 	item = string_list_lookup(map, mailbuf);
-- 
1.8.0

^ permalink raw reply related

* [PATCH 1/1] tests: Allow customization of how say_color() prints
From: Ramsay Jones @ 2012-12-15 19:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list


Since commit 7bc0911d ("test-lib: Fix say_color () not to interpret
\a\b\c in the message", 11-10-2012), the "--no-color" version of
say_color() has been using the (bash builtin) printf function, rather
than echo, to print the testsuite output. Due to an intermittent (and
rare) failure of the printf builtin function on some older versions
of cygwin, this leads to several (currently 7) test failures.

In order the fix the test failures, we provide a means to customize
the function used by say_color() to print the output. The function
is customized using GIT_TEST_PRINT[_LN] variables, which are set by
default to keep the current behaviour unchanged, but may used from
(say) the config.mak file to re-instate the use of echo. This could
be done by adding the following to config.mak:

    GIT_TEST_PRINT=echo -nE
    GIT_TEST_PRINT_LN=echo -E
    export GIT_TEST_PRINT GIT_TEST_PRINT_LN

Note that the GIT_TEST_PRINT variable is used in the "--color" version
of say_color(), and does not provide the line termination character.
In contrast, the GIT_TEST_PRINT_LN variable is used by the "--no-color"
version of say_color() and does provide the line termination.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 Makefile      |  6 ++++++
 t/test-lib.sh | 13 +++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 736ecd4..4f7803e 100644
--- a/Makefile
+++ b/Makefile
@@ -2603,6 +2603,12 @@ GIT-BUILD-OPTIONS: FORCE
 ifdef GIT_TEST_OPTS
 	@echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@
 endif
+ifdef GIT_TEST_PRINT
+	@echo GIT_TEST_PRINT=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PRINT)))'\' >>$@
+endif
+ifdef GIT_TEST_PRINT_LN
+	@echo GIT_TEST_PRINT_LN=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PRINT_LN)))'\' >>$@
+endif
 ifdef GIT_TEST_CMP
 	@echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@
 endif
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f50f834..9dcf3c1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -202,6 +202,15 @@ do
 	esac
 done
 
+if test -z "$GIT_TEST_PRINT"
+then
+	GIT_TEST_PRINT="printf %s"
+fi
+if test -z "$GIT_TEST_PRINT_LN"
+then
+	GIT_TEST_PRINT_LN="printf %s\n"
+fi
+
 if test -n "$color"
 then
 	say_color () {
@@ -221,7 +230,7 @@ then
 			test -n "$quiet" && return;;
 		esac
 		shift
-		printf "%s" "$*"
+		$GIT_TEST_PRINT "$*"
 		tput sgr0
 		echo
 		)
@@ -230,7 +239,7 @@ else
 	say_color() {
 		test -z "$1" && test -n "$quiet" && return
 		shift
-		printf "%s\n" "$*"
+		$GIT_TEST_PRINT_LN "$*"
 	}
 fi
 
-- 
1.8.0

^ permalink raw reply related

* [PATCH] t3070: Disable some failing fnmatch tests
From: Ramsay Jones @ 2012-12-15 19:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nguyen Thai Ngoc Duy, GIT Mailing-list


The failing tests make use of a POSIX character class, '[:xdigit:]'
in this case, which some versions of the fnmatch() library function
do not support. In the spirit of commit f1cf7b79 ("t3070: disable
unreliable fnmatch tests", 15-10-2012), we disable the fnmatch() half
of these tests.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Junio,

This is against next (branch 'nd/wildmatch'). As an alternative solution,
I could build with NO_FNMATCH, since the compat version does support the
POSIX charater classes.

ATB,
Ramsay Jones

 t/t3070-wildmatch.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index 3155eab..d5bafef 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -120,9 +120,9 @@ match 0 x '1' '[[:digit:][:upper:][:spaci:]]'
 match 1 x ' ' '[[:digit:][:upper:][:space:]]'
 match 0 x '.' '[[:digit:][:upper:][:space:]]'
 match 1 x '.' '[[:digit:][:punct:][:space:]]'
-match 1 1 '5' '[[:xdigit:]]'
-match 1 1 'f' '[[:xdigit:]]'
-match 1 1 'D' '[[:xdigit:]]'
+match 1 x '5' '[[:xdigit:]]'
+match 1 x 'f' '[[:xdigit:]]'
+match 1 x 'D' '[[:xdigit:]]'
 match 1 x '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'
 match 1 x '_' '[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]'
 match 1 x '.' '[^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]]'
-- 
1.8.0

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox