git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 075/104] tests: chmod +x t5150
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 076/104] t7604-merge-custom-message: shift expected output creation Sam Vilain
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Jeff King, Junio C Hamano

From: Jeff King <peff@peff.net>

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 0 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 t/t5150-request-pull.sh

diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
old mode 100644
new mode 100755
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 076/104] t7604-merge-custom-message: shift expected output creation
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
  2010-05-26  6:00 ` [PATCH 075/104] tests: chmod +x t5150 Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 082/104] fmt-merge-msg: add function to append shortlog only Sam Vilain
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Tay Ray Chuan, Junio C Hamano

From: Tay Ray Chuan <rctay89@gmail.com>

Squash in a minor rename too.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t7604-merge-custom-message.sh |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/t/t7604-merge-custom-message.sh b/t/t7604-merge-custom-message.sh
index 269cfdf..d79542d 100755
--- a/t/t7604-merge-custom-message.sh
+++ b/t/t7604-merge-custom-message.sh
@@ -6,6 +6,10 @@ Testing merge when using a custom message for the merge commit.'
 
 . ./test-lib.sh
 
+create_merge_msgs() {
+	echo >exp.subject "custom message"
+}
+
 test_expect_success 'setup' '
 	echo c0 > c0.c &&
 	git add c0.c &&
@@ -19,16 +23,16 @@ test_expect_success 'setup' '
 	echo c2 > c2.c &&
 	git add c2.c &&
 	git commit -m c2 &&
-	git tag c2
+	git tag c2 &&
+	create_merge_msgs
 '
 
 
 test_expect_success 'merge c2 with a custom message' '
 	git reset --hard c1 &&
-	echo >expected "custom message" &&
-	git merge -m "custom message" c2 &&
+	git merge -m "$(cat exp.subject)" c2 &&
 	git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
-	test_cmp expected actual
+	test_cmp exp.subject actual
 '
 
 test_done
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 082/104] fmt-merge-msg: add function to append shortlog only
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
  2010-05-26  6:00 ` [PATCH 075/104] tests: chmod +x t5150 Sam Vilain
  2010-05-26  6:00 ` [PATCH 076/104] t7604-merge-custom-message: shift expected output creation Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 084/104] autocrlf: Make it work also for un-normalized repositories Sam Vilain
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Tay Ray Chuan, Junio C Hamano

From: Tay Ray Chuan <rctay89@gmail.com>

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin.h               |    1 +
 builtin/fmt-merge-msg.c |   13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/builtin.h b/builtin.h
index 464588b..322901f 100644
--- a/builtin.h
+++ b/builtin.h
@@ -16,6 +16,7 @@ extern const char *help_unknown_cmd(const char *cmd);
 extern void prune_packed_objects(int);
 extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
 	struct strbuf *out);
+extern int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out);
 extern int commit_tree(const char *msg, unsigned char *tree,
 		struct commit_list *parents, unsigned char *ret,
 		const char *author);
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index d0160cb..48548cf 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -255,8 +255,8 @@ static void do_fmt_merge_msg_title(struct strbuf *out,
 		strbuf_addf(out, " into %s\n", current_branch);
 }
 
-static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
-	struct strbuf *out) {
+static int do_fmt_merge_msg(int merge_title, int merge_summary,
+	struct strbuf *in, struct strbuf *out) {
 	int limit = 20, i = 0, pos = 0;
 	unsigned char head_sha1[20];
 	const char *current_branch;
@@ -285,7 +285,8 @@ static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
 	if (!srcs.nr)
 		return 0;
 
-	do_fmt_merge_msg_title(out, current_branch);
+	if (merge_title)
+		do_fmt_merge_msg_title(out, current_branch);
 
 	if (merge_summary) {
 		struct commit *head;
@@ -305,7 +306,11 @@ static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
 }
 
 int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
-	return do_fmt_merge_msg(merge_summary, in, out);
+	return do_fmt_merge_msg(1, merge_summary, in, out);
+}
+
+int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out) {
+	return do_fmt_merge_msg(0, 1, in, out);
 }
 
 int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 084/104] autocrlf: Make it work also for un-normalized repositories
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (2 preceding siblings ...)
  2010-05-26  6:00 ` [PATCH 082/104] fmt-merge-msg: add function to append shortlog only Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 086/104] gitweb: Use @diff_opts while using format-patch Sam Vilain
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Finn Arne Gangstad, Finn Arne Gangstad, Junio C Hamano

From: Finn Arne Gangstad <finnag@pvv.org>

Previously, autocrlf would only work well for normalized
repositories. Any text files that contained CRLF in the repository
would cause problems, and would be modified when handled with
core.autocrlf set.

Change autocrlf to not do any conversions to files that in the
repository already contain a CR. git with autocrlf set will never
create such a file, or change a LF only file to contain CRs, so the
(new) assumption is that if a file contains a CR, it is intentional,
and autocrlf should not change that.

The following sequence should now always be a NOP even with autocrlf
set (assuming a clean working directory):

git checkout <something>
touch *
git add -A .    (will add nothing)
git commit      (nothing to commit)

Previously this would break for any text file containing a CR.

Some of you may have been folowing Eyvind's excellent thread about
trying to make end-of-line translation in git a bit smoother.

I decided to attack the problem from a different angle: Is it possible
to make autocrlf behave non-destructively for all the previous problem cases?

Stealing the problem from Eyvind's initial mail (paraphrased and
summarized a bit):

1. Setting autocrlf globally is a pain since autocrlf does not work well
   with CRLF in the repo
2. Setting it in individual repos is hard since you do it "too late"
   (the clone will get it wrong)
3. If someone checks in a file with CRLF later, you get into problems again
4. If a repository once has contained CRLF, you can't tell autocrlf
   at which commit everything is sane again
5. autocrlf does needless work if you know that all your users want
   the same EOL style.

I belive that this patch makes autocrlf a safe (and good) default
setting for Windows, and this solves problems 1-4 (it solves 2 by being
set by default, which is early enough for clone).

I implemented it by looking for CR charactes in the index, and
aborting any conversion attempt if this is found.

Signed-off-by: Finn Arne Gangstad <finag@pvv.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 convert.c       |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 t/t0020-crlf.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/convert.c b/convert.c
index 27acce5..a54c5fc 100644
--- a/convert.c
+++ b/convert.c
@@ -120,6 +120,43 @@ static void check_safe_crlf(const char *path, int action,
 	}
 }
 
+static int has_cr_in_index(const char *path)
+{
+	int pos, len;
+	unsigned long sz;
+	enum object_type type;
+	void *data;
+	int has_cr;
+	struct index_state *istate = &the_index;
+
+	len = strlen(path);
+	pos = index_name_pos(istate, path, len);
+	if (pos < 0) {
+		/*
+		 * We might be in the middle of a merge, in which
+		 * case we would read stage #2 (ours).
+		 */
+		int i;
+		for (i = -pos - 1;
+		     (pos < 0 && i < istate->cache_nr &&
+		      !strcmp(istate->cache[i]->name, path));
+		     i++)
+			if (ce_stage(istate->cache[i]) == 2)
+				pos = i;
+	}
+	if (pos < 0)
+		return 0;
+	data = read_sha1_file(istate->cache[pos]->sha1, &type, &sz);
+	if (!data || type != OBJ_BLOB) {
+		free(data);
+		return 0;
+	}
+
+	has_cr = memchr(data, '\r', sz) != NULL;
+	free(data);
+	return has_cr;
+}
+
 static int crlf_to_git(const char *path, const char *src, size_t len,
                        struct strbuf *buf, int action, enum safe_crlf checksafe)
 {
@@ -145,6 +182,13 @@ static int crlf_to_git(const char *path, const char *src, size_t len,
 		 */
 		if (is_binary(len, &stats))
 			return 0;
+
+		/*
+		 * If the file in the index has any CR in it, do not convert.
+		 * This is the new safer autocrlf handling.
+		 */
+		if (has_cr_in_index(path))
+			return 0;
 	}
 
 	check_safe_crlf(path, action, &stats, checksafe);
@@ -203,6 +247,11 @@ static int crlf_to_worktree(const char *path, const char *src, size_t len,
 		return 0;
 
 	if (action == CRLF_GUESS) {
+		/* If we have any CR or CRLF line endings, we do not touch it */
+		/* This is the new safer autocrlf-handling */
+		if (stats.cr > 0 || stats.crlf > 0)
+			return 0;
+
 		/* If we have any bare CR characters, we're not going to touch it */
 		if (stats.cr != stats.crlf)
 			return 0;
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index c3e7e32..234a94f 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -453,5 +453,57 @@ test_expect_success 'invalid .gitattributes (must not crash)' '
 	git diff
 
 '
+# Some more tests here to add new autocrlf functionality.
+# We want to have a known state here, so start a bit from scratch
+
+test_expect_success 'setting up for new autocrlf tests' '
+	git config core.autocrlf false &&
+	git config core.safecrlf false &&
+	rm -rf .????* * &&
+	for w in I am all LF; do echo $w; done >alllf &&
+	for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
+	for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
+	git add -A . &&
+	git commit -m "alllf, allcrlf and mixed only" &&
+	git tag -a -m "message" autocrlf-checkpoint
+'
+
+test_expect_success 'report no change after setting autocrlf' '
+	git config core.autocrlf true &&
+	touch * &&
+	git diff --exit-code
+'
+
+test_expect_success 'files are clean after checkout' '
+	rm * &&
+	git checkout -f &&
+	git diff --exit-code
+'
+
+cr_to_Q_no_NL () {
+    tr '\015' Q | tr -d '\012'
+}
+
+test_expect_success 'LF only file gets CRLF with autocrlf' '
+	test "$(cr_to_Q_no_NL < alllf)" = "IQamQallQLFQ"
+'
+
+test_expect_success 'Mixed file is still mixed with autocrlf' '
+	test "$(cr_to_Q_no_NL < mixed)" = "OhhereisCRLFQintext"
+'
+
+test_expect_success 'CRLF only file has CRLF with autocrlf' '
+	test "$(cr_to_Q_no_NL < allcrlf)" = "IQamQallQCRLFQ"
+'
+
+test_expect_success 'New CRLF file gets LF in repo' '
+	tr -d "\015" < alllf | append_cr > alllf2 &&
+	git add alllf2 &&
+	git commit -m "alllf2 added" &&
+	git config core.autocrlf false &&
+	rm * &&
+	git checkout -f &&
+	test_cmp alllf alllf2
+'
 
 test_done
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 086/104] gitweb: Use @diff_opts while using format-patch
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (3 preceding siblings ...)
  2010-05-26  6:00 ` [PATCH 084/104] autocrlf: Make it work also for un-normalized repositories Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 087/104] hash_object: correction for zero length file Sam Vilain
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Pavan Kumar Sunkara, Junio C Hamano

From: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>

Make git-format-patch (used by 'patch' and 'patches' views) use the
same rename detection options that git-diff and git-diff-tree (used
by 'commitdiff', 'blobdiff', etc.) use.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c356e95..77e5f79 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6117,8 +6117,8 @@ sub git_commitdiff {
 			}
 			push @commit_spec, '--root', $hash;
 		}
-		open $fd, "-|", git_cmd(), "format-patch", '--encoding=utf8',
-			'--stdout', @commit_spec
+		open $fd, "-|", git_cmd(), "format-patch", @diff_opts,
+			'--encoding=utf8', '--stdout', @commit_spec
 			or die_error(500, "Open git-format-patch failed");
 	} else {
 		die_error(400, "Unknown commitdiff format");
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 087/104] hash_object: correction for zero length file
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (4 preceding siblings ...)
  2010-05-26  6:00 ` [PATCH 086/104] gitweb: Use @diff_opts while using format-patch Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:00 ` [PATCH 088/104] for-each-ref: Field with abbreviated objectname Sam Vilain
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Dmitry Potapov, Junio C Hamano

From: Dmitry Potapov <dpotapov@gmail.com>

The check whether size is zero was done after if size <= SMALL_FILE_SIZE,
as result, zero size case was never triggered. Instead zero length file
was treated as any other small file. This did not caused any problem, but
if we have a special case for size equal to zero, it is better to make it
work and avoid redundant malloc().

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 sha1_file.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sha1_file.c b/sha1_file.c
index ff65328..1b551e4 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2448,6 +2448,8 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
 		else
 			ret = -1;
 		strbuf_release(&sbuf);
+	} else if (!size) {
+		ret = index_mem(sha1, NULL, size, write_object, type, path);
 	} else if (size <= SMALL_FILE_SIZE) {
 		char *buf = xmalloc(size);
 		if (size == read_in_full(fd, buf, size))
@@ -2456,12 +2458,11 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
 		else
 			ret = error("short read %s", strerror(errno));
 		free(buf);
-	} else if (size) {
+	} else {
 		void *buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
 		ret = index_mem(sha1, buf, size, write_object, type, path);
 		munmap(buf, size);
-	} else
-		ret = index_mem(sha1, NULL, size, write_object, type, path);
+	}
 	close(fd);
 	return ret;
 }
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 088/104] for-each-ref: Field with abbreviated objectname
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (5 preceding siblings ...)
  2010-05-26  6:00 ` [PATCH 087/104] hash_object: correction for zero length file Sam Vilain
@ 2010-05-26  6:00 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 090/104] Documentation: rebase -i ignores options passed to "git am" Sam Vilain
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:00 UTC (permalink / raw
  To: git; +Cc: Michael J Gruber, Junio C Hamano

From: Michael J Gruber <git@drmicha.warpmail.net>

Introduce a :short modifier to objectname which outputs the abbreviated
object name.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-for-each-ref.txt |    1 +
 builtin/for-each-ref.c             |    3 +++
 t/t6300-for-each-ref.sh            |    9 +++++++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 7e83288..390d85c 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -86,6 +86,7 @@ objectsize::
 
 objectname::
 	The object name (aka SHA-1).
+	For a non-ambiguous abbreviation of the object name append `:short`.
 
 upstream::
 	The name of a local ref which can be considered ``upstream''
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 62be1bb..3a97953 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -227,6 +227,9 @@ static void grab_common_values(struct atom_value *val, int deref, struct object
 			strcpy(s, sha1_to_hex(obj->sha1));
 			v->s = s;
 		}
+		else if (!strcmp(name, "objectname:short")) {
+			v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV);
+		}
 	}
 }
 
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 8052c86..7dc8a51 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -295,6 +295,15 @@ test_expect_success 'Check short upstream format' '
 	test_cmp expected actual
 '
 
+cat >expected <<EOF
+67a36f1
+EOF
+
+test_expect_success 'Check short objectname format' '
+	git for-each-ref --format="%(objectname:short)" refs/heads >actual &&
+	test_cmp expected actual
+'
+
 test_expect_success 'Check for invalid refname format' '
 	test_must_fail git for-each-ref --format="%(refname:INVALID)"
 '
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 090/104] Documentation: rebase -i ignores options passed to "git am"
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (6 preceding siblings ...)
  2010-05-26  6:00 ` [PATCH 088/104] for-each-ref: Field with abbreviated objectname Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 091/104] Documentation: fix minor inconsistency Sam Vilain
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Markus Heidelberg, Junio C Hamano

From: Markus Heidelberg <markus.heidelberg@web.de>

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-rebase.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 0d07b1b..5863dec 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -295,6 +295,7 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
 --ignore-date::
 	These flags are passed to 'git am' to easily change the dates
 	of the rebased commits (see linkgit:git-am[1]).
+	Incompatible with the --interactive option.
 
 -i::
 --interactive::
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 091/104] Documentation: fix minor inconsistency
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (7 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 090/104] Documentation: rebase -i ignores options passed to "git am" Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 092/104] Documentation/gitdiffcore: fix order in pickaxe description Sam Vilain
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Michael J Gruber, Junio C Hamano

From: Michael J Gruber <git@drmicha.warpmail.net>

While we don't always write out commands in full (`git command`) we
should do it consistently in adjacent paragraphs.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/config.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 8f86050..c3ebd4d 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1516,7 +1516,7 @@ receive.denyDeletes::
 	the ref. Use this to prevent such a ref deletion via a push.
 
 receive.denyCurrentBranch::
-	If set to true or "refuse", receive-pack will deny a ref update
+	If set to true or "refuse", git-receive-pack will deny a ref update
 	to the currently checked out branch of a non-bare repository.
 	Such a push is potentially dangerous because it brings the HEAD
 	out of sync with the index and working tree. If set to "warn",
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 092/104] Documentation/gitdiffcore: fix order in pickaxe description
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (8 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 091/104] Documentation: fix minor inconsistency Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 093/104] post-receive-email: document command-line mode Sam Vilain
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Michael J Gruber, Junio C Hamano

From: Michael J Gruber <git@drmicha.warpmail.net>

Reverse the order of "origin" and "result" so that the sentence
really describes an addition rather than a removal.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/gitdiffcore.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt
index 9de8caf..5d91a7e 100644
--- a/Documentation/gitdiffcore.txt
+++ b/Documentation/gitdiffcore.txt
@@ -227,8 +227,8 @@ changes that touch a specified string, and is controlled by the
 commands.
 
 When diffcore-pickaxe is in use, it checks if there are
-filepairs whose "original" side has the specified string and
-whose "result" side does not.  Such a filepair represents "the
+filepairs whose "result" side has the specified string and
+whose "origin" side does not.  Such a filepair represents "the
 string appeared in this changeset".  It also checks for the
 opposite case that loses the specified string.
 
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 093/104] post-receive-email: document command-line mode
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (9 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 092/104] Documentation/gitdiffcore: fix order in pickaxe description Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 094/104] diff: fix coloring of extended diff headers Sam Vilain
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Jonathan Nieder, Andy Parkins, Junio C Hamano

From: Jonathan Nieder <jrnieder@gmail.com>

According to the default hooks/post-receive file, the hook is called
with three arguments on stdin:

  <oldrev> <newrev> <refname>

In command-line mode, the arguments come in a different order, because
the email hook instead calls:

  generate_email $2 $3 $1

Add a comment to explain why, based on comments from the mailing list
and the commit message to v1.5.1~9.  Thanks to Andy for the
explanation.

Requested-by: martin f. krafft <madduck@debian.org>
Cc: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/hooks/post-receive-email |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 58a35c8..30ae63d 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -23,6 +23,13 @@
 # possible for the email to be from someone other than the person doing the
 # push.
 #
+# To help with debugging and use on pre-v1.5.1 git servers, this script will
+# also obey the interface of hooks/update, taking its arguments on the
+# command line.  Unfortunately, hooks/update is called once for each ref.
+# To avoid firing one email per ref, this script just prints its output to
+# the screen when used in this mode.  The output can then be redirected if
+# wanted.
+#
 # Config
 # ------
 # hooks.mailinglist
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 094/104] diff: fix coloring of extended diff headers
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (10 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 093/104] post-receive-email: document command-line mode Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 095/104] Fix "Out of memory? mmap failed" for files larger than 4GB on Windows Sam Vilain
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Bert Wesarg, Junio C Hamano

From: Bert Wesarg <bert.wesarg@googlemail.com>

Coloring the extended headers where done as a whole not per line. less with
option -R (which is the default from git) does not support this coloring
mode because of performance reasons. The -r option would be an alternative
but has problems with lines that are longer than the screen. Therefore
stick to the idiom to color each line separately. The problem is, that the
result of ill_metainfo() will also be used as an parameter to an external
diff driver, so we need to disable coloring in this case.

Because coloring is now done inside fill_metainfo() we can simply add this
string to the diff header and therefore keep the last newline in the
extended header. This results also into the fact that the external diff
driver now gets this last newline too. Which is a change in behavior
but a good one.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff.c |   61 +++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/diff.c b/diff.c
index d0ecbc3..7e508dd 100644
--- a/diff.c
+++ b/diff.c
@@ -1650,21 +1650,21 @@ static void builtin_diff(const char *name_a,
 	if (lbl[0][0] == '/') {
 		/* /dev/null */
 		strbuf_addf(&header, "%snew file mode %06o%s\n", set, two->mode, reset);
-		if (xfrm_msg && xfrm_msg[0])
-			strbuf_addf(&header, "%s%s%s\n", set, xfrm_msg, reset);
+		if (xfrm_msg)
+			strbuf_addstr(&header, xfrm_msg);
 	}
 	else if (lbl[1][0] == '/') {
 		strbuf_addf(&header, "%sdeleted file mode %06o%s\n", set, one->mode, reset);
-		if (xfrm_msg && xfrm_msg[0])
-			strbuf_addf(&header, "%s%s%s\n", set, xfrm_msg, reset);
+		if (xfrm_msg)
+			strbuf_addstr(&header, xfrm_msg);
 	}
 	else {
 		if (one->mode != two->mode) {
 			strbuf_addf(&header, "%sold mode %06o%s\n", set, one->mode, reset);
 			strbuf_addf(&header, "%snew mode %06o%s\n", set, two->mode, reset);
 		}
-		if (xfrm_msg && xfrm_msg[0])
-			strbuf_addf(&header, "%s%s%s\n", set, xfrm_msg, reset);
+		if (xfrm_msg)
+			strbuf_addstr(&header, xfrm_msg);
 
 		/*
 		 * we do not run diff between different kind
@@ -2323,30 +2323,36 @@ static void fill_metainfo(struct strbuf *msg,
 			  struct diff_filespec *one,
 			  struct diff_filespec *two,
 			  struct diff_options *o,
-			  struct diff_filepair *p)
+			  struct diff_filepair *p,
+			  int use_color)
 {
+	const char *set = diff_get_color(use_color, DIFF_METAINFO);
+	const char *reset = diff_get_color(use_color, DIFF_RESET);
+
 	strbuf_init(msg, PATH_MAX * 2 + 300);
 	switch (p->status) {
 	case DIFF_STATUS_COPIED:
-		strbuf_addf(msg, "similarity index %d%%", similarity_index(p));
-		strbuf_addstr(msg, "\ncopy from ");
+		strbuf_addf(msg, "%ssimilarity index %d%%",
+			    set, similarity_index(p));
+		strbuf_addf(msg, "%s\n%scopy from ", reset, set);
 		quote_c_style(name, msg, NULL, 0);
-		strbuf_addstr(msg, "\ncopy to ");
+		strbuf_addf(msg, "%s\n%scopy to ", reset, set);
 		quote_c_style(other, msg, NULL, 0);
-		strbuf_addch(msg, '\n');
+		strbuf_addf(msg, "%s\n", reset);
 		break;
 	case DIFF_STATUS_RENAMED:
-		strbuf_addf(msg, "similarity index %d%%", similarity_index(p));
-		strbuf_addstr(msg, "\nrename from ");
+		strbuf_addf(msg, "%ssimilarity index %d%%",
+			    set, similarity_index(p));
+		strbuf_addf(msg, "%s\n%srename from ", reset, set);
 		quote_c_style(name, msg, NULL, 0);
-		strbuf_addstr(msg, "\nrename to ");
+		strbuf_addf(msg, "%s\n%srename to ", reset, set);
 		quote_c_style(other, msg, NULL, 0);
-		strbuf_addch(msg, '\n');
+		strbuf_addf(msg, "%s\n", reset);
 		break;
 	case DIFF_STATUS_MODIFIED:
 		if (p->score) {
-			strbuf_addf(msg, "dissimilarity index %d%%\n",
-				    similarity_index(p));
+			strbuf_addf(msg, "%sdissimilarity index %d%%%s\n",
+				    set, similarity_index(p), reset);
 			break;
 		}
 		/* fallthru */
@@ -2363,15 +2369,13 @@ static void fill_metainfo(struct strbuf *msg,
 			    (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two)))
 				abbrev = 40;
 		}
-		strbuf_addf(msg, "index %.*s..%.*s",
+		strbuf_addf(msg, "%sindex %.*s..%.*s", set,
 			    abbrev, sha1_to_hex(one->sha1),
 			    abbrev, sha1_to_hex(two->sha1));
 		if (one->mode == two->mode)
 			strbuf_addf(msg, " %06o", one->mode);
-		strbuf_addch(msg, '\n');
+		strbuf_addf(msg, "%s\n", reset);
 	}
-	if (msg->len)
-		strbuf_setlen(msg, msg->len - 1);
 }
 
 static void run_diff_cmd(const char *pgm,
@@ -2387,11 +2391,6 @@ static void run_diff_cmd(const char *pgm,
 	const char *xfrm_msg = NULL;
 	int complete_rewrite = (p->status == DIFF_STATUS_MODIFIED) && p->score;
 
-	if (msg) {
-		fill_metainfo(msg, name, other, one, two, o, p);
-		xfrm_msg = msg->len ? msg->buf : NULL;
-	}
-
 	if (!DIFF_OPT_TST(o, ALLOW_EXTERNAL))
 		pgm = NULL;
 	else {
@@ -2400,6 +2399,16 @@ static void run_diff_cmd(const char *pgm,
 			pgm = drv->external;
 	}
 
+	if (msg) {
+		/*
+		 * don't use colors when the header is intended for an
+		 * external diff driver
+		 */
+		fill_metainfo(msg, name, other, one, two, o, p,
+			      DIFF_OPT_TST(o, COLOR_DIFF) && !pgm);
+		xfrm_msg = msg->len ? msg->buf : NULL;
+	}
+
 	if (pgm) {
 		run_external_diff(pgm, name, other, one, two, xfrm_msg,
 				  complete_rewrite);
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 095/104] Fix "Out of memory? mmap failed" for files larger than 4GB on Windows
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (11 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 094/104] diff: fix coloring of extended diff headers Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 096/104] start_command: close cmd->err descriptor when fork/spawn fails Sam Vilain
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Ian McLean, Johannes Sixt, Junio C Hamano

From: Ian McLean <ian.mclean@gmail.com>

The git_mmap implementation was broken for file sizes that wouldn't fit
into a size_t (32 bits).  This was caused by intermediate variables that
were only 32 bits wide when they should be 64 bits.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 compat/win32mmap.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat/win32mmap.c b/compat/win32mmap.c
index 1c5a149..b58aa69 100644
--- a/compat/win32mmap.c
+++ b/compat/win32mmap.c
@@ -4,19 +4,19 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
 {
 	HANDLE hmap;
 	void *temp;
-	size_t len;
+	off_t len;
 	struct stat st;
 	uint64_t o = offset;
 	uint32_t l = o & 0xFFFFFFFF;
 	uint32_t h = (o >> 32) & 0xFFFFFFFF;
 
 	if (!fstat(fd, &st))
-		len = xsize_t(st.st_size);
+		len = st.st_size;
 	else
 		die("mmap: could not determine filesize");
 
 	if ((length + offset) > len)
-		length = len - offset;
+		length = xsize_t(len - offset);
 
 	if (!(flags & MAP_PRIVATE))
 		die("Invalid usage of mmap when built with USE_WIN32_MMAP");
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 096/104] start_command: close cmd->err descriptor when fork/spawn fails
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (12 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 095/104] Fix "Out of memory? mmap failed" for files larger than 4GB on Windows Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 097/104] Fix checkout of large files to network shares on Windows XP Sam Vilain
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: bert Dvornik, Johannes Sixt, Junio C Hamano

From: bert Dvornik <dvornik+git@gmail.com>

Fix the problem where the cmd->err passed into start_command wasn't
being properly closed when certain types of errors occurr.  (Compare
the affected code with the clean shutdown code later in the function.)

On Windows, this problem would be triggered if mingw_spawnvpe()
failed, which would happen if the command to be executed was malformed
(e.g. a text file that didn't start with a #! line).  If cmd->err was
a pipe, the failure to close it could result in a hang while the other
side was waiting (forever) for either input or pipe close, e.g. while
trying to shove the output into the side band.  On msysGit, this
problem was causing a hang in t5516-fetch-push.

[J6t: With a slight adjustment of the test case, the hang is also
observed on Linux.]

Signed-off-by: bert Dvornik <dvornik+git@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 run-command.c         |    2 ++
 t/t5516-fetch-push.sh |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/run-command.c b/run-command.c
index eb5c575..c7793f5 100644
--- a/run-command.c
+++ b/run-command.c
@@ -383,6 +383,8 @@ fail_pipe:
 			close(cmd->out);
 		if (need_err)
 			close_pair(fderr);
+		else if (cmd->err)
+			close(cmd->err);
 		errno = failed_errno;
 		return -1;
 	}
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 2de98e6..6a37a4d 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -528,7 +528,7 @@ test_expect_success 'push does not update local refs on failure' '
 	mk_test heads/master &&
 	mk_child child &&
 	mkdir testrepo/.git/hooks &&
-	echo exit 1 >testrepo/.git/hooks/pre-receive &&
+	echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
 	chmod +x testrepo/.git/hooks/pre-receive &&
 	(cd child &&
 		git pull .. master
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 097/104] Fix checkout of large files to network shares on Windows XP
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (13 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 096/104] start_command: close cmd->err descriptor when fork/spawn fails Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 098/104] mingw: use _commit to implement fsync Sam Vilain
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: René Scharfe, Johannes Sixt, Junio C Hamano

From: René Scharfe <rene.scharfe@lsrfire.ath.cx>

Bigger writes to network drives on Windows XP fail.  Cap them at 31MB to
allow them to succeed.  Callers need to be prepared for write() calls
that do less work than requested anyway.

On local drives, write() calls are translated to WriteFile() calls with
a cap of 64KB on Windows XP and 256KB on Vista.  Thus a cap of 31MB won't
affect the number of WriteFile() calls which do the actual work.  There's
still room for some other version of Windows to use a chunk size of 1MB
without increasing the number of system calls.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 compat/mingw.c       |   17 +++++++++++++++++
 compat/mingw.h       |    3 +++
 t/t5705-clone-2gb.sh |   12 +++++++++---
 3 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index f90a114..9a8e336 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -140,6 +140,23 @@ int mingw_open (const char *filename, int oflags, ...)
 	return fd;
 }
 
+#undef write
+ssize_t mingw_write(int fd, const void *buf, size_t count)
+{
+	/*
+	 * While write() calls to a file on a local disk are translated
+	 * into WriteFile() calls with a maximum size of 64KB on Windows
+	 * XP and 256KB on Vista, no such cap is placed on writes to
+	 * files over the network on Windows XP.  Unfortunately, there
+	 * seems to be a limit of 32MB-28KB on X64 and 64MB-32KB on x86;
+	 * bigger writes fail on Windows XP.
+	 * So we cap to a nice 31MB here to avoid write failures over
+	 * the net without changing the number of WriteFile() calls in
+	 * the local case.
+	 */
+	return write(fd, buf, min(count, 31 * 1024 * 1024));
+}
+
 #undef fopen
 FILE *mingw_fopen (const char *filename, const char *otype)
 {
diff --git a/compat/mingw.h b/compat/mingw.h
index 7c2ab64..0e3e743 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -170,6 +170,9 @@ int link(const char *oldpath, const char *newpath);
 int mingw_open (const char *filename, int oflags, ...);
 #define open mingw_open
 
+ssize_t mingw_write(int fd, const void *buf, size_t count);
+#define write mingw_write
+
 FILE *mingw_fopen (const char *filename, const char *otype);
 #define fopen mingw_fopen
 
diff --git a/t/t5705-clone-2gb.sh b/t/t5705-clone-2gb.sh
index adfaae8..8afbdd4 100755
--- a/t/t5705-clone-2gb.sh
+++ b/t/t5705-clone-2gb.sh
@@ -12,7 +12,7 @@ test_expect_success 'setup' '
 
 	git config pack.compression 0 &&
 	git config pack.depth 0 &&
-	blobsize=$((20*1024*1024)) &&
+	blobsize=$((100*1024*1024)) &&
 	blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
 	i=1 &&
 	(while test $i -le $blobcount
@@ -36,9 +36,15 @@ test_expect_success 'setup' '
 
 '
 
-test_expect_success 'clone' '
+test_expect_success 'clone - bare' '
 
-	git clone --bare --no-hardlinks . clone
+	git clone --bare --no-hardlinks . clone-bare
+
+'
+
+test_expect_success 'clone - with worktree, file:// protocol' '
+
+	git clone file://. clone-wt
 
 '
 
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 098/104] mingw: use _commit to implement fsync
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (14 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 097/104] Fix checkout of large files to network shares on Windows XP Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 099/104] Recent MinGW has a C99 implementation of snprintf functions Sam Vilain
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Erik Faye-Lund, Erik Faye-Lund, Johannes Sixt, Junio C Hamano

From: Erik Faye-Lund <kusmabite@googlemail.com>

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 compat/mingw.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 0e3e743..f465566 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -80,7 +80,7 @@ static inline int fork(void)
 static inline unsigned int alarm(unsigned int seconds)
 { return 0; }
 static inline int fsync(int fd)
-{ return 0; }
+{ return _commit(fd); }
 static inline int getppid(void)
 { return 1; }
 static inline void sync(void)
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 099/104] Recent MinGW has a C99 implementation of snprintf functions
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (15 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 098/104] mingw: use _commit to implement fsync Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 100/104] Complete prototype of git_config_from_parameters() Sam Vilain
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Johannes Sixt, Junio C Hamano

From: Johannes Sixt <j6t@kdbg.org>

Starting with MinGW 3.14, released end of 2007, a working snprintf
is available. This means we do not need our own replacement that works
around the broken implementation in Microsoft's C runtime.

People who build git in an old MinGW environment are expected to set
SNPRINTF_RETURNS_BOGUS in their config.mak. msysgit is sufficiently
recent, of course.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index eb1d162..7a014b1 100644
--- a/Makefile
+++ b/Makefile
@@ -1026,7 +1026,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_STRTOUMAX = YesPlease
 	NO_MKDTEMP = YesPlease
 	NO_MKSTEMPS = YesPlease
-	SNPRINTF_RETURNS_BOGUS = YesPlease
 	NO_SVN_TESTS = YesPlease
 	NO_PERL_MAKEMAKER = YesPlease
 	RUNTIME_PREFIX = YesPlease
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 100/104] Complete prototype of git_config_from_parameters()
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (16 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 099/104] Recent MinGW has a C99 implementation of snprintf functions Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 101/104] test get_git_work_tree() return value for NULL Sam Vilain
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Thomas Rast, Junio C Hamano

From: Thomas Rast <trast@student.ethz.ch>

Add the missing argument list.  (Its lack triggered a compiler warning
for me.)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 cache.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cache.h b/cache.h
index 4a0c75d..73f0f7b 100644
--- a/cache.h
+++ b/cache.h
@@ -933,7 +933,7 @@ typedef int (*config_fn_t)(const char *, const char *, void *);
 extern int git_default_config(const char *, const char *, void *);
 extern int git_config_from_file(config_fn_t fn, const char *, void *);
 extern int git_config_parse_parameter(const char *text);
-extern int git_config_from_parameters();
+extern int git_config_from_parameters(config_fn_t fn, void *data);
 extern int git_config(config_fn_t fn, void *);
 extern int git_parse_ulong(const char *, unsigned long *);
 extern int git_config_int(const char *, const char *);
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 101/104] test get_git_work_tree() return value for NULL
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (17 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 100/104] Complete prototype of git_config_from_parameters() Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 102/104] t7502-commit: fix spelling Sam Vilain
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Clemens Buchacher, Junio C Hamano

From: Clemens Buchacher <drizzd@aon.at>

If we are in a git directory, get_git_work_tree() can return NULL.
While trying to determine whether or not the given paths are outside
the work tree, the following command would read from it anyways and
trigger a segmentation fault.

 git diff / /

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff-no-index.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/diff-no-index.c b/diff-no-index.c
index aae8e7a..4cd9dac 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -150,16 +150,14 @@ static int queue_diff(struct diff_options *o,
 
 static int path_outside_repo(const char *path)
 {
-	/*
-	 * We have already done setup_git_directory_gently() so we
-	 * know we are inside a git work tree already.
-	 */
 	const char *work_tree;
 	size_t len;
 
 	if (!is_absolute_path(path))
 		return 0;
 	work_tree = get_git_work_tree();
+	if (!work_tree)
+		return 1;
 	len = strlen(work_tree);
 	if (strncmp(path, work_tree, len) ||
 	    (path[len] != '\0' && path[len] != '/'))
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 102/104] t7502-commit: fix spelling
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (18 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 101/104] test get_git_work_tree() return value for NULL Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 103/104] show-branch: use DEFAULT_ABBREV instead of 7 Sam Vilain
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Tay Ray Chuan, Junio C Hamano

From: Tay Ray Chuan <rctay89@gmail.com>

s/subdirecotry/subdirectory/

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t7502-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 844fb43..9504466 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -35,7 +35,7 @@ test_expect_success 'partial' '
 
 '
 
-test_expect_success 'partial modification in a subdirecotry' '
+test_expect_success 'partial modification in a subdirectory' '
 
 	test_tick &&
 	git commit -m "partial commit to subdirectory" not &&
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 103/104] show-branch: use DEFAULT_ABBREV instead of 7
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (19 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 102/104] t7502-commit: fix spelling Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
  2010-05-26  6:01 ` [PATCH 104/104] Documentation/SubmittingPatches: clarify GMail section and SMTP Sam Vilain
       [not found] ` <1274853674-18521-22-git-send-email-sam.vilain@catalyst.net.nz>
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Tay Ray Chuan, Junio C Hamano

From: Tay Ray Chuan <rctay89@gmail.com>

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/show-branch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index e20fcf3..e8719aa 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -313,7 +313,8 @@ static void show_one_commit(struct commit *commit, int no_name)
 		}
 		else
 			printf("[%s] ",
-			       find_unique_abbrev(commit->object.sha1, 7));
+			       find_unique_abbrev(commit->object.sha1,
+						  DEFAULT_ABBREV));
 	}
 	puts(pretty_str);
 	strbuf_release(&pretty);
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 104/104] Documentation/SubmittingPatches: clarify GMail section and SMTP
       [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
                   ` (20 preceding siblings ...)
  2010-05-26  6:01 ` [PATCH 103/104] show-branch: use DEFAULT_ABBREV instead of 7 Sam Vilain
@ 2010-05-26  6:01 ` Sam Vilain
       [not found] ` <1274853674-18521-22-git-send-email-sam.vilain@catalyst.net.nz>
  22 siblings, 0 replies; 23+ messages in thread
From: Sam Vilain @ 2010-05-26  6:01 UTC (permalink / raw
  To: git; +Cc: Michael J Gruber, Junio C Hamano

From: Michael J Gruber <git@drmicha.warpmail.net>

We keep getting mangled submissions from GMail's web interface. Try to
be more proactive in SubmittingPatches by

- pointing to MUA specific instructions early on,
- structuring the GMail section more clearly,
- putting send-email/SMTP before imap-send/IMAP.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/SubmittingPatches |   40 ++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index abc65de..22e3808 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -41,6 +41,7 @@ Checklist (and a short version for the impatient):
 	  maintainer (gitster@pobox.com) if (and only if) the patch
 	  is ready for inclusion. If you use git-send-email(1),
 	  please test it first by sending email to yourself.
+	- see below for instructions specific to your mailer
 
 Long version:
 
@@ -519,9 +520,27 @@ Gmail
 
 GMail does not appear to have any way to turn off line wrapping in the web
 interface, so this will mangle any emails that you send.  You can however
-use any IMAP email client to connect to the google imap server, and forward
+use "git send e-mail" and send your patches through the GMail SMTP server, or
+use any IMAP email client to connect to the google IMAP server and forward
 the emails through that.
 
+To use "git send-email" and send your patches through the GMail SMTP server,
+edit ~/.gitconfig to specify your account settings:
+
+[sendemail]
+	smtpencryption = tls
+	smtpserver = smtp.gmail.com
+	smtpuser = user@gmail.com
+	smtppass = p4ssw0rd
+	smtpserverport = 587
+
+Once your commits are ready to be sent to the mailing list, run the
+following commands:
+
+  $ git format-patch --cover-letter -M origin/master -o outgoing/
+  $ edit outgoing/0000-*
+  $ git send-email outgoing/*
+
 To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your
 account settings:
 
@@ -537,8 +556,7 @@ You might need to instead use: folder = "[Google Mail]/Drafts" if you get an err
 that the "Folder doesn't exist".
 
 Once your commits are ready to be sent to the mailing list, run the
-following command to send the patch emails to your Gmail Drafts
-folder.
+following commands:
 
   $ git format-patch --cover-letter -M --stdout origin/master | git imap-send
 
@@ -546,19 +564,3 @@ Just make sure to disable line wrapping in the email client (GMail web
 interface will line wrap no matter what, so you need to use a real
 IMAP client).
 
-Alternatively, you can use "git send-email" and send your patches
-through the GMail SMTP server.  edit ~/.gitconfig to specify your
-account settings:
-
-[sendemail]
-	smtpencryption = tls
-	smtpserver = smtp.gmail.com
-	smtpuser = user@gmail.com
-	smtppass = p4ssw0rd
-	smtpserverport = 587
-
-Once your commits are ready to be sent to the mailing list, run the
-following commands:
-
-  $ git format-patch --cover-letter -M origin/master -o outgoing/
-  $ git send-email outgoing/*
-- 
1.7.1.rc2.333.gb2668

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 022/104] Gitweb: ignore built file
       [not found] ` <1274853674-18521-22-git-send-email-sam.vilain@catalyst.net.nz>
@ 2010-05-26  7:46   ` Sverre Rabbelier
  0 siblings, 0 replies; 23+ messages in thread
From: Sverre Rabbelier @ 2010-05-26  7:46 UTC (permalink / raw
  To: Sam Vilain; +Cc: git, Junio C Hamano

Heya,

On Wed, May 26, 2010 at 07:59, Sam Vilain <sam.vilain@catalyst.net.nz> wrote:
> From: Sverre Rabbelier <srabbelier@gmail.com>

I think this is in git.git already, somewhere? Also, what's up with
the 022/104? ;)

http://repo.or.cz/w/git.git/commit/493429b89600daf43a818701ba7011b8e538f7b0

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2010-05-26  7:47 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1274853674-18521-1-git-send-email-sam.vilain@catalyst.net.nz>
2010-05-26  6:00 ` [PATCH 075/104] tests: chmod +x t5150 Sam Vilain
2010-05-26  6:00 ` [PATCH 076/104] t7604-merge-custom-message: shift expected output creation Sam Vilain
2010-05-26  6:00 ` [PATCH 082/104] fmt-merge-msg: add function to append shortlog only Sam Vilain
2010-05-26  6:00 ` [PATCH 084/104] autocrlf: Make it work also for un-normalized repositories Sam Vilain
2010-05-26  6:00 ` [PATCH 086/104] gitweb: Use @diff_opts while using format-patch Sam Vilain
2010-05-26  6:00 ` [PATCH 087/104] hash_object: correction for zero length file Sam Vilain
2010-05-26  6:00 ` [PATCH 088/104] for-each-ref: Field with abbreviated objectname Sam Vilain
2010-05-26  6:01 ` [PATCH 090/104] Documentation: rebase -i ignores options passed to "git am" Sam Vilain
2010-05-26  6:01 ` [PATCH 091/104] Documentation: fix minor inconsistency Sam Vilain
2010-05-26  6:01 ` [PATCH 092/104] Documentation/gitdiffcore: fix order in pickaxe description Sam Vilain
2010-05-26  6:01 ` [PATCH 093/104] post-receive-email: document command-line mode Sam Vilain
2010-05-26  6:01 ` [PATCH 094/104] diff: fix coloring of extended diff headers Sam Vilain
2010-05-26  6:01 ` [PATCH 095/104] Fix "Out of memory? mmap failed" for files larger than 4GB on Windows Sam Vilain
2010-05-26  6:01 ` [PATCH 096/104] start_command: close cmd->err descriptor when fork/spawn fails Sam Vilain
2010-05-26  6:01 ` [PATCH 097/104] Fix checkout of large files to network shares on Windows XP Sam Vilain
2010-05-26  6:01 ` [PATCH 098/104] mingw: use _commit to implement fsync Sam Vilain
2010-05-26  6:01 ` [PATCH 099/104] Recent MinGW has a C99 implementation of snprintf functions Sam Vilain
2010-05-26  6:01 ` [PATCH 100/104] Complete prototype of git_config_from_parameters() Sam Vilain
2010-05-26  6:01 ` [PATCH 101/104] test get_git_work_tree() return value for NULL Sam Vilain
2010-05-26  6:01 ` [PATCH 102/104] t7502-commit: fix spelling Sam Vilain
2010-05-26  6:01 ` [PATCH 103/104] show-branch: use DEFAULT_ABBREV instead of 7 Sam Vilain
2010-05-26  6:01 ` [PATCH 104/104] Documentation/SubmittingPatches: clarify GMail section and SMTP Sam Vilain
     [not found] ` <1274853674-18521-22-git-send-email-sam.vilain@catalyst.net.nz>
2010-05-26  7:46   ` [PATCH 022/104] Gitweb: ignore built file Sverre Rabbelier

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).