Git development
 help / color / mirror / Atom feed
* Re: Hacks for AIX
From: Brandon Casey @ 2008-07-22 21:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Chris Cowan, git
In-Reply-To: <hT7kYDX9f_eBxi8JC0s7jG9oqm8sZ1QCTlEg1n8Dqus7U98hWLWnBA@cipher.nrlssc.navy.mil>

Brandon Casey wrote:
> Junio C Hamano wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>>>     * /usr/bin/patch - really old version, doesn't do well with some
>>>> diff formats.   I avoid using it.
>>> t4109 seems to use patch to produce expected output for the tests; we
>>> should ship a precomputed expected results.  Do you know of any other
>>> places "patch" is used?
>> As usual, I won't commit this patch unless I hear from people who
>> potentially would benefit from it.  I do not need such a patch myself and
>> I really shouldn't be spending too much of my time on these.
> 
> 
> Unless I'm doing something wrong, this doesn't apply cleanly to master.

I figured out that your patch was against maint.

I see it is now applied to master and it helps out on solaris with old patch.

Now I need to get rid of 'diff -U0' in t1002-read-tree-m-u-2way.sh.

-brandon

^ permalink raw reply

* [PATCH] Ignore dirty submodule states in "git pull --rebase"
From: Johannes Schindelin @ 2008-07-22 21:41 UTC (permalink / raw)
  To: git, gitster


This is a companion patch to 6848d58c(Ignore dirty submodule states
during rebase and stash).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-pull.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index 6afd4e2..75c3610 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -107,9 +107,9 @@ error_on_no_merge_candidates () {
 }
 
 test true = "$rebase" && {
-	git update-index --refresh &&
-	git diff-files --quiet &&
-	git diff-index --cached --quiet HEAD -- ||
+	git update-index --ignore-submodules --refresh &&
+	git diff-files --ignore-submodules --quiet &&
+	git diff-index --ignore-submodules --cached --quiet HEAD -- ||
 	die "refusing to pull with rebase: your working tree is not up-to-date"
 
 	. git-parse-remote &&
-- 
1.6.0.rc0.22.gf2096d.dirty

^ permalink raw reply related

* [PATCH] rebase -i: only automatically amend commit if HEAD did not change
From: Johannes Schindelin @ 2008-07-22 21:36 UTC (permalink / raw)
  To: git, gitster


If the user called "rebase -i", marked a commit as "edit", "rebase
--continue" would automatically amend the commit when there were
staged changes.

However, this is actively wrong when the current commit is not the
one marked with "edit".  So guard against this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-rebase--interactive.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index e63a864..444f393 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -276,7 +276,7 @@ do_next () {
 		pick_one $sha1 ||
 			die_with_patch $sha1 "Could not apply $sha1... $rest"
 		make_patch $sha1
-		: > "$DOTEST"/amend
+		git rev-parse HEAD > "$DOTEST"/amend
 		warn
 		warn "You can amend the commit now, with"
 		warn
@@ -419,7 +419,9 @@ do
 		else
 			. "$DOTEST"/author-script ||
 				die "Cannot find the author identity"
-			if test -f "$DOTEST"/amend
+			if test -f "$DOTEST"/amend &&
+				test $(git rev-parse HEAD) = \
+					$(cat "$DOTEST"/amend)
 			then
 				git reset --soft HEAD^ ||
 				die "Cannot rewind the HEAD"
-- 
1.6.0.rc0.22.gf2096d.dirty

^ permalink raw reply related

* Re: [PATCH/RFC] git add: do not add files from a submodule
From: Johannes Schindelin @ 2008-07-22 21:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807210256510.3305@eeepc-johanness>

Hi Junio,

On Mon, 21 Jul 2008, Johannes Schindelin wrote:

> It comes quite as a surprise to an unsuspecting Git user that calling
> "git add submodule/file" (which is a mistake, alright) _removes_
> the submodule in the index, and adds the file.  Instead, complain loudly.
> 
> While at it, be nice when the user said "git add submodule/" which is
> most likely the consequence of tab-completion, and stage the submodule,
> instead of trying to add the contents of that directory.

Do you plan to apply the split-up builtin-add enhancments you did a few 
nights ago, so that this patch can be elegant?  I think this fix should go 
into 1.6.0.

Ciao,
Dscho

^ permalink raw reply

* Re: Patches for test suite on sunos
From: Brandon Casey @ 2008-07-22 21:30 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <xBk5x6Gn4j_BxeOlNdnKZYx9EVCDUf3daWtIO2qp-b8jRKgjlQ8spQ@cipher.nrlssc.navy.mil>

Brandon Casey wrote:
> The following set of patches is a subset of patches

Well, those patches were all supposed to be sent as a
reply to this message, but I can't use git-send-email
and it turns out thunderbird replaces the message-id
for messages when you 'Edit As New...' (which is how
I have been submitting my patches).

-brandon

^ permalink raw reply

* [PATCH] Add help.autocorrect to enable/disable autocorrecting
From: Alex Riesen @ 2008-07-22 21:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807222207110.8986@racer>

It is off by default, to avoid scaring people unless they asked to.
---
Johannes Schindelin, Tue, Jul 22, 2008 23:08:19 +0200:
> On Tue, 22 Jul 2008, Alex Riesen wrote:
> 
> > +	if (autocorrect && (main_cmds.cnt < 2 ||
> > +		best_similarity < similarity(main_cmds.names[1]->name))) {
> >  		if (!*cwd)
> >  			exit(1);
> >  		if (chdir(cwd))
> 
> In that case, you need to put in the "one of these" / "this" conditional 
> again, which I ripped out because I do not need it any more.
> 

Of course, missed it. Like this, then.

 help.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/help.c b/help.c
index 480befe..cf6b459 100644
--- a/help.c
+++ b/help.c
@@ -28,6 +28,7 @@ enum help_format {
 	HELP_FORMAT_WEB,
 };
 
+static int autocorrect;
 static int show_all = 0;
 static enum help_format help_format = HELP_FORMAT_MAN;
 static struct option builtin_help_options[] = {
@@ -269,6 +270,8 @@ static int git_help_config(const char *var, const char *value, void *cb)
 	}
 	if (!prefixcmp(var, "man."))
 		return add_man_viewer_info(var, value);
+	if (!strcmp(var, "help.autocorrect"))
+		autocorrect = git_config_bool(var,value);
 
 	return git_default_config(var, value, cb);
 }
@@ -704,9 +707,10 @@ const char *help_unknown_cmd(const char *cmd)
 
 	if (!main_cmds.cnt)
 		die ("Uh oh.  Your system reports no Git commands at all.");
+	git_config(git_help_config, NULL);
 	best_similarity = similarity(main_cmds.names[0]->name);
-	if (main_cmds.cnt < 2 || best_similarity <
-			similarity(main_cmds.names[1]->name)) {
+	if (autocorrect && (main_cmds.cnt < 2 ||
+		best_similarity < similarity(main_cmds.names[1]->name))) {
 		if (!*cwd)
 			exit(1);
 		if (chdir(cwd))
@@ -721,10 +725,14 @@ const char *help_unknown_cmd(const char *cmd)
 	fprintf(stderr, "git: '%s' is not a git-command. See 'git --help'.\n", cmd);
 
 	if (best_similarity < 6) {
-		fprintf(stderr, "\nDid you mean one of these?\n");
-
-		for (i = 0; i < main_cmds.cnt && best_similarity ==
-				similarity(main_cmds.names[i]->name); i++)
+		int n = 0;
+		while (n < main_cmds.cnt &&
+			best_similarity == similarity(main_cmds.names[n]->name))
+			++n;
+		fprintf(stderr, "\nDid you mean %s?\n",
+			n < 2 ? "this": "one of these");
+
+		for (i = 0; i < n; i++)
 			fprintf(stderr, "\t%s\n", main_cmds.names[i]->name);
 	}
 
-- 
1.6.0.rc0.48.ga184

^ permalink raw reply related

* [PATCH] t/t4202-log.sh: add newline at end of file
From: Brandon Casey @ 2008-07-22 21:23 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

Some shells hang when parsing the script if the last statement is not
followed by a newline. So add one.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


I expect this is a bug in ksh. The ksh installed on my solaris box went
into some infinite loop on this script, continually allocating memory.
Adding the newline fixed it.

-brandon


 t/t4202-log.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index b536454..4c8af45 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -71,4 +71,5 @@ test_expect_success 'diff-filter=D' '
 
 
 
-test_done
\ No newline at end of file
+test_done
+
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* [PATCH] t7502-commit.sh: rearrange test to make more portable
From: Brandon Casey @ 2008-07-22 21:21 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>


Some shells have problems with one-shot variable assignment notation
and function calls. The sequence is rearranged to avoid the one-shot
and to allow the test script to be linked together with '&&'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t7502-commit.sh |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index c25eff9..ad84c3d 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -228,10 +228,12 @@ EOF
 
 test_expect_success 'a SIGTERM should break locks' '
 	echo >>negative &&
-	"$SHELL_PATH" -c '\''
+	! "$SHELL_PATH" -c '\''
 	  echo kill -TERM $$ >> .git/FAKE_EDITOR
-	  GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1  # should fail
-	! test -f .git/index.lock
+	  GIT_EDITOR=.git/FAKE_EDITOR 
+	  export GIT_EDITOR
+	  exec git commit -a'\'' &&
+	test ! -f .git/index.lock
 '
 
 rm -f .git/MERGE_MSG .git/COMMIT_EDITMSG
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* Re: [PATCH] bring description of git diff --cc up to date
From: Junio C Hamano @ 2008-07-22 21:21 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, David Greaves
In-Reply-To: <7v63qxn8w2.fsf@gitster.siamese.dyndns.org>

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

> Jonathan Nieder <jrnieder@uchicago.edu> writes:
>
>> Just to make sure I understand, here is what I think --cc does:
>>
>>   - In a two-parent merge, it is exactly as Linus has been
>>     ...
>>   - In a many-parent merge, the criterion is more stringent.
>>     ...
>>
>> Is that correct?
>
> The logic in the code does not have separate criteria for two-parent and
> Octopus cases.  Actually Linus talks about "when you have two versions to
> choose from, and if the result matches one of them, then it is not
> interesting".  In a two-parent merge, you cannot have three or more
> possible versions to choose from by definition, can you?

To put it another way, I think what you wrote is correct, but two-parent
case is just a degenerated case of a more general rule, that is:

    A hunk is not interesting if the person who merged had only two
    choices offered by the parents to pick from, and the merge result
    exactly matched one of the choices.

You can come up with examples that do not match the above criteria; they
are all interesting.

For example, if all the parent of a tripus disagreed, the person had more
than two choices to pick from, so no matter what the resolution is, the
hunk is interesting.

On the other hand, if 4 parents in a dodecapus lack a line that all other
8 parents have (see the first example in [*1*]), then the choice for the
person who merges these 12 parents is either to include or not include
that line.  If the line was included, it is not interesting.  If the line
was deleted (which is different from what happened in *1*), it is not
interesting, either.

One thing to note is "have only two choices to pick from" does not have a
direct connection to two-parent-ness.  In a two-parent merge (di-pus?), by
definition you cannot have more than two choices, but that is not any
different from a Dodecapus that has only two groups of parents.  Most
octopus merges have only two groups of parents like the "merge from hell"
does when we talk about individual paths (otherwise it would be very
painful to resolve so it is not done in practice).

[Reference]

*1* http://article.gmane.org/gmane.comp.version-control.git/15487

^ permalink raw reply

* [PATCH] t/: Replace diff [-u|-U0] with test_cmp to allow compilation with old diff
From: Brandon Casey @ 2008-07-22 21:17 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t0002-gitfile.sh               |    2 +-
 t/t1002-read-tree-m-u-2way.sh    |   12 ++++++------
 t/t2201-add-update-typechange.sh |   10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index c5dbc72..4db4ac4 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -66,7 +66,7 @@ test_expect_success 'check hash-object' '
 
 test_expect_success 'check cat-file' '
 	git cat-file blob $SHA >actual &&
-	diff -u bar actual
+	test_cmp bar actual
 '
 
 test_expect_success 'check update-index' '
diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index e04990e..aa9dd58 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -112,7 +112,7 @@ test_expect_success \
      git update-index --add frotz &&
      git read-tree -m -u $treeH $treeM &&
      git ls-files --stage >6.out &&
-     diff -U0 M.out 6.out &&
+     test_cmp M.out 6.out &&
      check_cache_at frotz clean &&
      sum bozbar frotz nitfol >actual3.sum &&
      cmp M.sum actual3.sum &&
@@ -129,7 +129,7 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git read-tree -m -u $treeH $treeM &&
      git ls-files --stage >7.out &&
-     diff -U0 M.out 7.out &&
+     test_cmp M.out 7.out &&
      check_cache_at frotz dirty &&
      sum bozbar frotz nitfol >actual7.sum &&
      if cmp M.sum actual7.sum; then false; else :; fi &&
@@ -264,7 +264,7 @@ test_expect_success \
      git update-index --add bozbar &&
      git read-tree -m -u $treeH $treeM &&
      git ls-files --stage >18.out &&
-     diff -U0 M.out 18.out &&
+     test_cmp M.out 18.out &&
      check_cache_at bozbar clean &&
      sum bozbar frotz nitfol >actual18.sum &&
      cmp M.sum actual18.sum'
@@ -278,7 +278,7 @@ test_expect_success \
      echo gnusto gnusto >bozbar &&
      git read-tree -m -u $treeH $treeM &&
      git ls-files --stage >19.out &&
-     diff -U0 M.out 19.out &&
+     test_cmp M.out 19.out &&
      check_cache_at bozbar dirty &&
      sum frotz nitfol >actual19.sum &&
      grep -v bozbar  M.sum > expected19.sum &&
@@ -297,7 +297,7 @@ test_expect_success \
      git update-index --add bozbar &&
      git read-tree -m -u $treeH $treeM &&
      git ls-files --stage >20.out &&
-     diff -U0 M.out 20.out &&
+     test_cmp M.out 20.out &&
      check_cache_at bozbar clean &&
      sum bozbar frotz nitfol >actual20.sum &&
      cmp M.sum actual20.sum'
@@ -338,7 +338,7 @@ test_expect_success \
      git update-index --add DF &&
      git read-tree -m -u $treeDF $treeDFDF &&
      git ls-files --stage >DFDFcheck.out &&
-     diff -U0 DFDF.out DFDFcheck.out &&
+     test_cmp DFDF.out DFDFcheck.out &&
      check_cache_at DF/DF clean'
 
 test_done
diff --git a/t/t2201-add-update-typechange.sh b/t/t2201-add-update-typechange.sh
index e15e3eb..d24c7d9 100755
--- a/t/t2201-add-update-typechange.sh
+++ b/t/t2201-add-update-typechange.sh
@@ -106,12 +106,12 @@ test_expect_success modify '
 
 test_expect_success diff-files '
 	git diff-files --raw >actual &&
-	diff -u expect-files actual
+	test_cmp expect-files actual
 '
 
 test_expect_success diff-index '
 	git diff-index --raw HEAD -- >actual &&
-	diff -u expect-index actual
+	test_cmp expect-index actual
 '
 
 test_expect_success 'add -u' '
@@ -119,7 +119,7 @@ test_expect_success 'add -u' '
 	cp -p ".git/index" ".git/saved-index" &&
 	git add -u &&
 	git ls-files -s >actual &&
-	diff -u expect-final actual
+	test_cmp expect-final actual
 '
 
 test_expect_success 'commit -a' '
@@ -130,11 +130,11 @@ test_expect_success 'commit -a' '
 	fi &&
 	git commit -m "second" -a &&
 	git ls-files -s >actual &&
-	diff -u expect-final actual &&
+	test_cmp expect-final actual &&
 	rm -f .git/index &&
 	git read-tree HEAD &&
 	git ls-files -s >actual &&
-	diff -u expect-final actual
+	test_cmp expect-final actual
 '
 
 test_done
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* [PATCH] t3200,t7201: replace '!' with test_must_fail
From: Brandon Casey @ 2008-07-22 21:16 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t3200-branch.sh |    2 +-
 t/t7201-co.sh     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 7c583c8..7a83fbf 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -200,7 +200,7 @@ test_expect_success \
 
 test_expect_success \
     'branch from non-branch HEAD w/--track causes failure' \
-    '!(git branch --track my10 HEAD^)'
+    'test_must_fail git branch --track my10 HEAD^'
 
 # Keep this test last, as it changes the current branch
 cat >expect <<EOF
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 3111baa..9ad5d63 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -335,6 +335,6 @@ test_expect_success \
     git checkout -b delete-me master &&
     rm .git/refs/heads/delete-me &&
     test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
-    !(git checkout --track -b track)'
+    test_must_fail git checkout --track -b track'
 
 test_done
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* [PATCH] t4116-apply-reverse.sh: use $TAR rather than tar
From: Brandon Casey @ 2008-07-22 21:16 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t4116-apply-reverse.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh
index 1459a90..2298ece 100755
--- a/t/t4116-apply-reverse.sh
+++ b/t/t4116-apply-reverse.sh
@@ -48,12 +48,12 @@ test_expect_success 'apply in reverse' '
 
 test_expect_success 'setup separate repository lacking postimage' '
 
-	git tar-tree initial initial | tar xf - &&
+	git tar-tree initial initial | $TAR xf - &&
 	(
 		cd initial && git init && git add .
 	) &&
 
-	git tar-tree second second | tar xf - &&
+	git tar-tree second second | $TAR xf - &&
 	(
 		cd second && git init && git add .
 	)
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* [PATCH] t9700/test.pl: backwards compatibility improvements
From: Brandon Casey @ 2008-07-22 21:16 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

Some versions of perl complain when 'STDERR' is used as the third argument
in the 3-argument form of open(). Convert to the 2-argument form which is
described for duping STDERR in my second edition camel book.

The object oriented version of File::Temp is a rather new incarnation it
seems. The File::Temp man page for v5.8.0 says "(NOT YET IMPLEMENTED)" in
the 'Objects' section. These can be converted to use File::Temp::tempfile().

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t9700/test.pl |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 4d23125..70f9836 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -38,7 +38,7 @@ is($r->get_color("color.test.slot1", "red"), $ansi_green, "get_color");
 # Failure cases for config:
 # Save and restore STDERR; we will probably extract this into a
 # "dies_ok" method and possibly move the STDERR handling to Git.pm.
-open our $tmpstderr, ">&", STDERR or die "cannot save STDERR"; close STDERR;
+open our $tmpstderr, ">&STDERR" or die "cannot save STDERR"; close STDERR;
 eval { $r->config("test.dupstring") };
 ok($@, "config: duplicate entry in scalar context fails");
 eval { $r->config_bool("test.boolother") };
@@ -69,18 +69,18 @@ is($r->ident_person("Name", "email", "123 +0000"), "Name <email>",
 
 # objects and hashes
 ok(our $file1hash = $r->command_oneline('rev-parse', "HEAD:file1"), "(get file hash)");
-our $tmpfile = File::Temp->new;
+our ($tmpfile, $tmpnam) = File::Temp::tempfile();
 is($r->cat_blob($file1hash, $tmpfile), 15, "cat_blob: size");
 our $blobcontents;
 { local $/; seek $tmpfile, 0, 0; $blobcontents = <$tmpfile>; }
 is($blobcontents, "changed file 1\n", "cat_blob: data");
 seek $tmpfile, 0, 0;
-is(Git::hash_object("blob", $tmpfile), $file1hash, "hash_object: roundtrip");
-$tmpfile = File::Temp->new();
+is(Git::hash_object("blob", $tmpnam), $file1hash, "hash_object: roundtrip");
+($tmpfile, $tmpnam) = File::Temp::tempfile();
 print $tmpfile my $test_text = "test blob, to be inserted\n";
-like(our $newhash = $r->hash_and_insert_object($tmpfile), qr/[0-9a-fA-F]{40}/,
+like(our $newhash = $r->hash_and_insert_object($tmpnam), qr/[0-9a-fA-F]{40}/,
      "hash_and_insert_object: returns hash");
-$tmpfile = File::Temp->new;
+$tmpfile = File::Temp::tempfile();
 is($r->cat_blob($newhash, $tmpfile), length $test_text, "cat_blob: roundtrip size");
 { local $/; seek $tmpfile, 0, 0; $blobcontents = <$tmpfile>; }
 is($blobcontents, $test_text, "cat_blob: roundtrip data");
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* [PATCH] perl/Makefile: update NO_PERL_MAKEMAKER section
From: Brandon Casey @ 2008-07-22 21:15 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <0GfECozN3g0ZvAESKMi76RyOVHEb2OhhwET9GWmEm7pbzYQJub50UlWpZtBa7MGn1UGb-7mzbzE@cipher.nrlssc.navy.mil>

The perl modules must be copied to blib/lib so they are available for
testing.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 perl/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/perl/Makefile b/perl/Makefile
index 5e079ad..2b0d3d5 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -22,8 +22,11 @@ clean:
 ifdef NO_PERL_MAKEMAKER
 instdir_SQ = $(subst ','\'',$(prefix)/lib)
 $(makfile): ../GIT-CFLAGS Makefile
-	echo all: > $@
-	echo '	:' >> $@
+	echo all: private-Error.pm Git.pm > $@
+	echo '	mkdir -p blib/lib' >> $@
+	echo '	$(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@
+	echo '	$(RM) blib/lib/Error.pm; \
+	cp private-Error.pm blib/lib/Error.pm' >> $@
 	echo install: >> $@
 	echo '	mkdir -p $(instdir_SQ)' >> $@
 	echo '	$(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@
-- 
1.6.0.rc0.38.g8b8fb7

^ permalink raw reply related

* Patches for test suite on sunos
From: Brandon Casey @ 2008-07-22 21:15 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano


The following set of patches is a subset of patches I created
while trying to compile on solaris and get the test suite running.
Except for the patches to the perl modules section, the rest all
deal with the test suite. I think these are general improvements
(or benign changes) and so I am submitting them.

With these patches and the others which I will maintain privately,
I can compile git on solaris using the native c compiler and pass
nearly all of the test suite with the native shell in /usr/xpg4/bin/sh
(i.e. ksh). The remaining bits of the test suite that do not pass are
related to a broken iconv or an ancient build environment.

Here are the tests I am skipping:

GIT_SKIP_TESTS='
   t3900.1[0-289] t3900.2[023]
   t3901.*
   t5000.1[0-24-689] t5000.2[01]
   t5100.[56] t5100.10
   t6030.1[2-9] t6030.2[0-9]
   t9301.4
'

-brandon

^ permalink raw reply

* Re: Difficulty with getting an accurate changelog after cherry-picking and merging.
From: Johannes Schindelin @ 2008-07-22 21:14 UTC (permalink / raw)
  To: Luuk Paulussen; +Cc: git
In-Reply-To: <7dc909980807221338g707d6104ob8b1534cdf02a77a@mail.gmail.com>

Hi,

On Wed, 23 Jul 2008, Luuk Paulussen wrote:

> I'm trying to generate an accurate changelog of changes between 2 tags 
> on a branch.  There is a merge between these 2 points which includes 
> changes that were cherry-picked before the start point.  This causes the 
> changelog to show these changes, despite them already existing before 
> the start point of the log.
>
> [...]
> 
> I have tried git-cherry and git-log with --cherry-pick and various 
> things with git-rev-list and git-merge-base.

cherry and --cherry-pick will only skip patches that are on the 
uninteresting side of a "..." range.

I guess that

	$ git log --cherry-pick master...HEAD^

should filter the commits out, but I haven't tried.

> git cherry-pick :/test1

Heh, that is the first time I see :/ in the wild.  I do not use it 
anymore, and in your case, I would have written "git cherry-pick master^4" 
to be more precise (and not accidentally pick up a wrong one).

Ciao,
Dscho

^ permalink raw reply

* Re: Difficulty with getting an accurate changelog after cherry-picking and merging.
From: Alex Riesen @ 2008-07-22 21:09 UTC (permalink / raw)
  To: luuk; +Cc: git
In-Reply-To: <7dc909980807221338g707d6104ob8b1534cdf02a77a@mail.gmail.com>

Luuk Paulussen, Tue, Jul 22, 2008 22:38:19 +0200:
> I'm trying to generate an accurate changelog of changes between 2 tags
> on a branch.  There is a merge between these 2 points which includes
> changes that were cherry-picked before the start point.  This causes
> the changelog to show these changes, despite them already existing
> before the start point of the log.

Cherry-picked commits are completely new commits and have no relation
to the original commits whatsoever. Of course, they will be shown.
It is literally a change made again, as if you typed it all in and
committed.

^ permalink raw reply

* Re: [PATCH] Add help.autocorrect to enable/disable autocorrecting
From: Johannes Schindelin @ 2008-07-22 21:08 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <20080722210354.GD5113@blimp.local>

Hi,

On Tue, 22 Jul 2008, Alex Riesen wrote:

> +	if (autocorrect && (main_cmds.cnt < 2 ||
> +		best_similarity < similarity(main_cmds.names[1]->name))) {
>  		if (!*cwd)
>  			exit(1);
>  		if (chdir(cwd))

In that case, you need to put in the "one of these" / "this" conditional 
again, which I ripped out because I do not need it any more.

Ciao,
Dscho

^ permalink raw reply

* [PATCH] Add help.autocorrect to enable/disable autocorrecting
From: Alex Riesen @ 2008-07-22 21:03 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <20080722203730.GC5113@blimp.local>

It is off by default, to avoid scaring people unless they asked to.

---

Alex Riesen, Tue, Jul 22, 2008 22:37:30 +0200:
> Johannes Schindelin, Tue, Jul 22, 2008 22:01:29 +0200:
> > As a convenience, if there is only one candidate, Git continues under
> > the assumption that the user mistyped it.  Example:
> > 
> > 	$ git reabse
> > 	WARNING: You called a Git program named 'reabse', which does
> > 	not exist.
> > 	Continuing under the assumption that you meant 'rebase'
> > 	[...]
> 
> Oh, that would make me suspicios (and I hit Ctrl-C fast when I get
> suspicios about what happens to my precious data). Could it be
> configurable? For example, BASH's cdspell is configurable and even off
> by default.
> 

Like this, perhaps?

 help.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/help.c b/help.c
index 480befe..f08eb9d 100644
--- a/help.c
+++ b/help.c
@@ -28,6 +28,7 @@ enum help_format {
 	HELP_FORMAT_WEB,
 };
 
+static int autocorrect;
 static int show_all = 0;
 static enum help_format help_format = HELP_FORMAT_MAN;
 static struct option builtin_help_options[] = {
@@ -269,6 +270,8 @@ static int git_help_config(const char *var, const char *value, void *cb)
 	}
 	if (!prefixcmp(var, "man."))
 		return add_man_viewer_info(var, value);
+	if (!strcmp(var, "help.autocorrect"))
+		autocorrect = git_config_bool(var,value);
 
 	return git_default_config(var, value, cb);
 }
@@ -704,9 +707,10 @@ const char *help_unknown_cmd(const char *cmd)
 
 	if (!main_cmds.cnt)
 		die ("Uh oh.  Your system reports no Git commands at all.");
+	git_config(git_help_config, NULL);
 	best_similarity = similarity(main_cmds.names[0]->name);
-	if (main_cmds.cnt < 2 || best_similarity <
-			similarity(main_cmds.names[1]->name)) {
+	if (autocorrect && (main_cmds.cnt < 2 ||
+		best_similarity < similarity(main_cmds.names[1]->name))) {
 		if (!*cwd)
 			exit(1);
 		if (chdir(cwd))
-- 
1.6.0.rc0.48.g6dda.dirty

^ permalink raw reply related

* [PATCH] builtin-commit: Two trivial style-cleanups
From: Johannes Schindelin @ 2008-07-22 20:40 UTC (permalink / raw)
  To: git, gitster


Pierre Habouzit noticed that two variables were not static which should
have been, and that adding "\n\n" is better than adding '\n' twice.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	This was in my queue for half an eternity.

	Oh, and it _is_ meant for inclusion.  On top of master.

 builtin-commit.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 97e64de..7434797 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -68,8 +68,8 @@ static enum {
 static char *cleanup_arg;
 
 static int use_editor = 1, initial_commit, in_merge;
-const char *only_include_assumed;
-struct strbuf message;
+static const char *only_include_assumed;
+static struct strbuf message;
 
 static int opt_parse_m(const struct option *opt, const char *arg, int unset)
 {
@@ -78,8 +78,7 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)
 		strbuf_setlen(buf, 0);
 	else {
 		strbuf_addstr(buf, arg);
-		strbuf_addch(buf, '\n');
-		strbuf_addch(buf, '\n');
+		strbuf_addstr(buf, "\n\n");
 	}
 	return 0;
 }
-- 
1.6.0.rc0.22.gf2096d.dirty

^ permalink raw reply related

* Difficulty with getting an accurate changelog after cherry-picking and merging.
From: Luuk Paulussen @ 2008-07-22 20:38 UTC (permalink / raw)
  To: git

Hi,

I'm trying to generate an accurate changelog of changes between 2 tags
on a branch.  There is a merge between these 2 points which includes
changes that were cherry-picked before the start point.  This causes
the changelog to show these changes, despite them already existing
before the start point of the log.

I've included a test script below that creates a repository that shows
a simplified version of the issue.  Basically, I want the changelog to
only show the changes between the start and end tags, which are test4
and test5, but I get a list that also includes other commits.  I have
tried git-cherry and git-log with --cherry-pick and various things
with git-rev-list and git-merge-base.

#!/bin/sh
mkdir testrepo
cd testrepo
git init
echo initial > testfile
git add testfile
git commit -m initial
git branch stable
for f in $(seq 1 5)
do
    echo test$f >> testfile
    git commit -a -m test$f
done
#without this sleep the cherry-picks end up with the same hash as
their original commit...
sleep 1
git checkout stable
git cherry-pick :/test1
git cherry-pick :/test2
git cherry-pick :/test3
git tag start
git cherry-pick :/test4
git merge master
#Clean up the merge error.
if [ ! $? -eq 0 ]
then
    sed -i "/[:=]/ d" testfile
    git commit -a -m "Merge branch 'master' into stable"
fi
git tag end
##########################

Thanks,
Luuk

^ permalink raw reply

* Re: [FYI PATCH] git wrapper: DWIM mistyped commands
From: Alex Riesen @ 2008-07-22 20:37 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807222100150.8986@racer>

Johannes Schindelin, Tue, Jul 22, 2008 22:01:29 +0200:
> As a convenience, if there is only one candidate, Git continues under
> the assumption that the user mistyped it.  Example:
> 
> 	$ git reabse
> 	WARNING: You called a Git program named 'reabse', which does
> 	not exist.
> 	Continuing under the assumption that you meant 'rebase'
> 	[...]

Oh, that would make me suspicios (and I hit Ctrl-C fast when I get
suspicios about what happens to my precious data). Could it be
configurable? For example, BASH's cdspell is configurable and even off
by default.

P.S. I'm still using your first patch and am forced to like it every day :)

^ permalink raw reply

* Re: [SCNR] Re: [FYI PATCH] git wrapper: DWIM mistyped commands
From: Pierre Habouzit @ 2008-07-22 20:34 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807222118030.8986@racer>

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

On Tue, Jul 22, 2008 at 08:19:13PM +0000, Johannes Schindelin wrote:
> Hi,
> 
> On Tue, 22 Jul 2008, Pierre Habouzit wrote:
> 
> > <SCNR>
> >     Or use a decent shell:
> 
> I tried that:
> 
> 	git reab<tab><tab><TAB><TTAAABBB!>

It yields the following here:

    $ git read-tree
    ---- corrections (errors 1)
    read-tree  -- read tree information into the directory index
    rebase     -- rebase local commits to new upstream head
    ---- original
    reab

and indeed, it should really suggest rebase first, I suppose I should reorder
my zsh completion error weights. but oh well...

> > Despite that, I really like your idea. **hint hint**
> 
> I said that _I_ did not mean it for inclusion.  **hint hint**

Damn...

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: [PATCH] Build configuration to skip ctime for modification test
From: Alex Riesen @ 2008-07-22 20:31 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Johannes Sixt, git
In-Reply-To: <alpine.DEB.1.00.0807222115440.8986@racer>

Johannes Schindelin, Tue, Jul 22, 2008 22:17:21 +0200:
> Hi,
> 
> On Tue, 22 Jul 2008, Alex Riesen wrote:
> 
> > +#ifndef NO_TRUSTABLE_FILEMODE
> >  	if (ce->ce_ctime != (unsigned int) st->st_ctime)
> >  		changed |= CTIME_CHANGED;
> > +#endif
> 
> Surely you meant trust_executable_bit instead, right?

No. Just what I said: we don't have filemode (like "at all") - so no
ctime as well. But maybe you're right, and trust_executable_bit is
more flexible. Or maybe both (the #ifdef _and_ trust_executable_bit)
and must be used...

> Otherwise, if you really want to tell at compile time,I think for clarity 
> you have to introduce another #define, since NO_TRUSTABLE_FILEMODE 
> definitely says something different than CTIME_IS_USELESS.

I had that at first (NO_DEPENDABLE_CTIME, than IGNORE_CTIME), than
deemed it excessive.

^ permalink raw reply

* Re: [SCNR] Re: [FYI PATCH] git wrapper: DWIM mistyped commands
From: Johannes Schindelin @ 2008-07-22 20:19 UTC (permalink / raw)
  To: Pierre Habouzit; +Cc: git
In-Reply-To: <20080722201648.GB11831@artemis.madism.org>

Hi,

On Tue, 22 Jul 2008, Pierre Habouzit wrote:

> <SCNR>
>     Or use a decent shell:

I tried that:

	git reab<tab><tab><TAB><TTAAABBB!>

> Despite that, I really like your idea. **hint hint**

I said that _I_ did not mean it for inclusion.  **hint hint**

Ciao,
Dscho

^ permalink raw reply


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