Git development
 help / color / mirror / Atom feed
* [ANNOUNCE] GIT 1.5.4-rc2
From: Junio C Hamano @ 2007-12-27  3:36 UTC (permalink / raw)
  To: git

GIT 1.5.4-rc2 is available at the usual places:

  http://www.kernel.org/pub/software/scm/git/

  git-1.5.4.rc2.tar.{gz,bz2}			(tarball)
  git-htmldocs-1.5.4.rc2.tar.{gz,bz2}		(preformatted docs)
  git-manpages-1.5.4.rc2.tar.{gz,bz2}		(preformatted docs)
  testing/*-1.5.4.rc2-1.*.rpm			(RPM)

This round we still did not manage to keep non-fixes out, and
you can now tell "git commit" to keep the "# comment" lines in
the message, but otherwise the changes are all fixes, fixes and
fixes.

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

Changes since v1.5.4-rc1 are as follows:

Alex Riesen (1):
      Allow selection of different cleanup modes for commit messages

Arjen Laarhoven (1):
      Fix "git log --diff-filter" bug

Charles Bailey (1):
      Remove old generated files from .gitignore.

Gustaf Hendeby (2):
      Make git send-email accept $EDITOR with arguments
      shortlog manpage documentation: work around asciidoc markup issues

Jakub Narebski (1):
      gitweb: fix whitespace in config_to_multi (indent with tab)

Jeff King (2):
      clean up 1.5.4 release notes
      cvsimport: die on cvsps errors

Jim Meyering (1):
      Don't dereference NULL upon lookup failure.

Johannes Schindelin (2):
      Teach diff machinery to display other prefixes than "a/" and "b/"
      Mention git-shell's "cvs" substitution in the RelNotes

Junio C Hamano (14):
      t4024: fix test script to use simpler sed pattern
      fix git commit --amend -m "new message"
      shell-scripts usage(): consistently exit with non-zero
      Documentation: ls-files -v is about "assume unchanged".
      Fix $EDITOR regression introduced by rewrite in C.
      t7005: do not exit inside test.
      builtin-commit: fix amending of the initial commit
      builtin-commit: avoid double-negation in the code.
      Documentation: describe 'union' low-level merge driver
      Fix documentation of --first-parent in git-log and copy it to git-rev-list
      combine-diff: Fix path quoting
      Fix rewrite_diff() name quoting.
      contrib: resurrect scripted git-revert.
      GIT 1.5.4-rc2

Linus Torvalds (1):
      Re(-re)*fix trim_common_tail()

Miklos Vajna (1):
      everyday: replace 'prune' and 'repack' with 'gc'

Pierre Habouzit (3):
      git-tag: fix -l switch handling regression.
      Force the sticked form for options with optional arguments.
      parse-options: Add a gitcli(5) man page.

René Scharfe (1):
      Make "--pretty=format" parser a bit more careful.

Shawn O. Pearce (2):
      Reallow git-rebase --interactive --continue if commit is unnecessary
      Improve error messages when int/long cannot be parsed from config

Stefan Sperling (1):
      Small comment fix for git-cvsimport.

Wincent Colaiuta (1):
      Emit helpful status for accidental "git stash" save

^ permalink raw reply

* [PATCH] Fix rewrite_diff() name quoting.
From: Junio C Hamano @ 2007-12-27  1:19 UTC (permalink / raw)
  To: Salikh Zakirov; +Cc: Git Mailing List
In-Reply-To: <7vodcdkl82.fsf@gitster.siamese.dyndns.org>

This moves the logic to quote two paths (prefix + path) in
C-style introduced in the previous commit from the
dump_quoted_path() in combine-diff.c to quote.c, and uses it to
fix rewrite_diff() that never C-quoted the pathnames correctly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 combine-diff.c |   11 +----------
 diff.c         |   12 +++++++++---
 quote.c        |   16 ++++++++++++++++
 quote.h        |    1 +
 4 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/combine-diff.c b/combine-diff.c
index 7d71033..0e19cba 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -656,16 +656,7 @@ static void dump_quoted_path(const char *head,
 	strbuf_reset(&buf);
 	strbuf_addstr(&buf, c_meta);
 	strbuf_addstr(&buf, head);
-	if (quote_c_style(prefix, NULL, NULL, 0) ||
-	    quote_c_style(path, NULL, NULL, 0)) {
-		strbuf_addch(&buf, '"');
-		quote_c_style(prefix, &buf, NULL, 1);
-		quote_c_style(path, &buf, NULL, 1);
-		strbuf_addch(&buf, '"');
-	} else {
-		strbuf_addstr(&buf, prefix);
-		strbuf_addstr(&buf, path);
-	}
+	quote_two_c_style(&buf, prefix, path, 0);
 	strbuf_addstr(&buf, c_reset);
 	puts(buf.buf);
 }
diff --git a/diff.c b/diff.c
index 61fd492..5bdc111 100644
--- a/diff.c
+++ b/diff.c
@@ -300,19 +300,25 @@ static void emit_rewrite_diff(const char *name_a,
 	const char *old = diff_get_color(color_diff, DIFF_FILE_OLD);
 	const char *new = diff_get_color(color_diff, DIFF_FILE_NEW);
 	const char *reset = diff_get_color(color_diff, DIFF_RESET);
+	static struct strbuf a_name = STRBUF_INIT, b_name = STRBUF_INIT;
 
 	name_a += (*name_a == '/');
 	name_b += (*name_b == '/');
 	name_a_tab = strchr(name_a, ' ') ? "\t" : "";
 	name_b_tab = strchr(name_b, ' ') ? "\t" : "";
 
+	strbuf_reset(&a_name);
+	strbuf_reset(&b_name);
+	quote_two_c_style(&a_name, o->a_prefix, name_a, 0);
+	quote_two_c_style(&b_name, o->b_prefix, name_b, 0);
+
 	diff_populate_filespec(one, 0);
 	diff_populate_filespec(two, 0);
 	lc_a = count_lines(one->data, one->size);
 	lc_b = count_lines(two->data, two->size);
-	printf("%s--- %s%s%s%s\n%s+++ %s%s%s%s\n%s@@ -",
-	       metainfo, o->a_prefix, name_a, name_a_tab, reset,
-	       metainfo, o->b_prefix, name_b, name_b_tab, reset, fraginfo);
+	printf("%s--- %s%s%s\n%s+++ %s%s%s\n%s@@ -",
+	       metainfo, a_name.buf, name_a_tab, reset,
+	       metainfo, b_name.buf, name_b_tab, reset, fraginfo);
 	print_line_count(lc_a);
 	printf(" +");
 	print_line_count(lc_b);
diff --git a/quote.c b/quote.c
index 6986b44..d061626 100644
--- a/quote.c
+++ b/quote.c
@@ -213,6 +213,22 @@ size_t quote_c_style(const char *name, struct strbuf *sb, FILE *fp, int nodq)
 	return quote_c_style_counted(name, -1, sb, fp, nodq);
 }
 
+void quote_two_c_style(struct strbuf *sb, const char *prefix, const char *path, int nodq)
+{
+	if (quote_c_style(prefix, NULL, NULL, 0) ||
+	    quote_c_style(path, NULL, NULL, 0)) {
+		if (!nodq)
+			strbuf_addch(sb, '"');
+		quote_c_style(prefix, sb, NULL, 1);
+		quote_c_style(path, sb, NULL, 1);
+		if (!nodq)
+			strbuf_addch(sb, '"');
+	} else {
+		strbuf_addstr(sb, prefix);
+		strbuf_addstr(sb, path);
+	}
+}
+
 void write_name_quoted(const char *name, FILE *fp, int terminator)
 {
 	if (terminator) {
diff --git a/quote.h b/quote.h
index ab7596f..4da110e 100644
--- a/quote.h
+++ b/quote.h
@@ -41,6 +41,7 @@ extern char *sq_dequote(char *);
 
 extern int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
 extern size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);
+extern void quote_two_c_style(struct strbuf *, const char *, const char *, int);
 
 extern void write_name_quoted(const char *name, FILE *, int terminator);
 extern void write_name_quotedpfx(const char *pfx, size_t pfxlen,
-- 
1.5.4.rc1.23.g3a969

^ permalink raw reply related

* Re: [PATCH] combine-diff: use diff_opts->a_prefix
From: Junio C Hamano @ 2007-12-27  0:57 UTC (permalink / raw)
  To: Salikh Zakirov; +Cc: Git Mailing List
In-Reply-To: <477109A5.9040000@gmail.com>

Salikh Zakirov <salikh@gmail.com> writes:

> The introduction of configurable dir prefix for diff headers in commit
> eab9a40b 'Teach diff machinery to display other prefixes than "a/" and "b/"'
> missed combined diff generation.
>
> Signed-off-by: Salikh Zakirov <salikh@gmail.com>
> ---
>
> I realize that this fix is ugly, so I am all ears for a suggestion
> of a better fix.

It is not so ugly, but I think the original code is broken wrt
its calling of quote_c_style().  It will output "a/" literally
and then would spit out the path with quoting.  IOW, you would
get something like:

	--- a/"foo\tbar"
        +++ b/"foo\tbar"

when it should show:

	--- "a/foo\tbar"
        +++ "b/foo\tbar"

Incidentally, I just noticed that diff.c::emit_rewrite_diff()
has the same bug.

Here is a fix to combine-diff.c

-- >8 -- 
[PATCH] combine-diff: Fix path quoting

Earlier when showing combined diff, the filenames on the ---/+++
header lines were quoted incorrectly.  a/ (or b/) prefix was
output literally and then the path was output, with c-quoting.

This fixes the quoting logic, and while at it, adjusts the code
to use the customizable prefix (a_prefix and b_prefix)
introduced recently.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 combine-diff.c |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/combine-diff.c b/combine-diff.c
index e22db89..7d71033 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -646,12 +646,28 @@ static void reuse_combine_diff(struct sline *sline, unsigned long cnt,
 	sline->p_lno[i] = sline->p_lno[j];
 }
 
-static void dump_quoted_path(const char *prefix, const char *path,
+static void dump_quoted_path(const char *head,
+			     const char *prefix,
+			     const char *path,
 			     const char *c_meta, const char *c_reset)
 {
-	printf("%s%s", c_meta, prefix);
-	quote_c_style(path, NULL, stdout, 0);
-	printf("%s\n", c_reset);
+	static struct strbuf buf = STRBUF_INIT;
+
+	strbuf_reset(&buf);
+	strbuf_addstr(&buf, c_meta);
+	strbuf_addstr(&buf, head);
+	if (quote_c_style(prefix, NULL, NULL, 0) ||
+	    quote_c_style(path, NULL, NULL, 0)) {
+		strbuf_addch(&buf, '"');
+		quote_c_style(prefix, &buf, NULL, 1);
+		quote_c_style(path, &buf, NULL, 1);
+		strbuf_addch(&buf, '"');
+	} else {
+		strbuf_addstr(&buf, prefix);
+		strbuf_addstr(&buf, path);
+	}
+	strbuf_addstr(&buf, c_reset);
+	puts(buf.buf);
 }
 
 static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
@@ -793,7 +809,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 		if (rev->loginfo && !rev->no_commit_id)
 			show_log(rev, opt->msg_sep);
 		dump_quoted_path(dense ? "diff --cc " : "diff --combined ",
-				 elem->path, c_meta, c_reset);
+				 "", elem->path, c_meta, c_reset);
 		printf("%sindex ", c_meta);
 		for (i = 0; i < num_parent; i++) {
 			abb = find_unique_abbrev(elem->parent[i].sha1,
@@ -829,14 +845,19 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 			printf("%s\n", c_reset);
 		}
 		if (added)
-			dump_quoted_path("--- /dev/", "null", c_meta, c_reset);
+			dump_quoted_path("--- ", "", "/dev/null",
+					 c_meta, c_reset);
 		else
-			dump_quoted_path("--- a/", elem->path, c_meta, c_reset);
+			dump_quoted_path("--- ", opt->a_prefix, elem->path,
+					 c_meta, c_reset);
 		if (deleted)
-			dump_quoted_path("+++ /dev/", "null", c_meta, c_reset);
+			dump_quoted_path("+++ ", "", "/dev/null",
+					 c_meta, c_reset);
 		else
-			dump_quoted_path("+++ b/", elem->path, c_meta, c_reset);
-		dump_sline(sline, cnt, num_parent, DIFF_OPT_TST(opt, COLOR_DIFF));
+			dump_quoted_path("+++ ", opt->b_prefix, elem->path,
+					 c_meta, c_reset);
+		dump_sline(sline, cnt, num_parent,
+			   DIFF_OPT_TST(opt, COLOR_DIFF));
 	}
 	free(result);
 
-- 
1.5.4.rc1.23.g3a969

^ permalink raw reply related

* Re: [PATCH 4/4] Allow selection of different cleanup modes for commit messages
From: Linus Torvalds @ 2007-12-27  0:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alex Riesen, git
In-Reply-To: <7vmyrxm2qh.fsf@gitster.siamese.dyndns.org>



On Wed, 26 Dec 2007, Junio C Hamano wrote:
> 
> Any comments on the cleaned-up series?

Me likee. I think there's still room for some possible future discussions 
(the whole "flag in the file to allow the editor to choose" kind of 
thing), but this seems like a good improvement on the current state.

		Linus

^ permalink raw reply

* Re: [PATCH 4/4] Allow selection of different cleanup modes for commit messages
From: Junio C Hamano @ 2007-12-26 23:54 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git, Linus Torvalds
In-Reply-To: <1198382136-15724-4-git-send-email-gitster@pobox.com>

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

> From: Alex Riesen <raa.lkml@gmail.com>
> Date: Sat, 22 Dec 2007 19:46:24 +0100
>
> Although we traditionally stripped away excess blank lines, trailing
> whitespaces and lines that begin with "#" from the commit log message,
> sometimes the message just has to be the way user wants it.
> ...

Any comments on the cleaned-up series?

^ permalink raw reply

* Re: [PATCH] Reallow git-rebase --interactive --continue if commit is unnecessary
From: Junio C Hamano @ 2007-12-26 23:48 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Shawn O. Pearce, Bernt Hansen, git
In-Reply-To: <7vy7bppv3s.fsf@gitster.siamese.dyndns.org>

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

> Will do, but the code looks quite bad (not entirely your fault).
>
> Line by line comment to show my puzzlement.
>
>  		# commit if necessary
>
> Ok, the user has prepared the index for us, and we are going to do some
> tests and conditionally create commit.
>
>  		git rev-parse --verify HEAD > /dev/null &&
>
> Do we have HEAD commit?  Why check this --- we do not want to rebase
> from the beginning of time?  No, that's not it.  If this fails, there is
> something seriously wrong.  This is not about "will we make a commit?"
> check at all.  This is a basic sanity check and if it fails we must
> abort, not just skip.
>
>  		git update-index --refresh &&
>  		git diff-files --quiet &&
>
> Is the work tree clean with respect to the index?  Why check this --- we
> want to skip the commit if work tree is dirty?  Or is this trying to
> enforce the invariant that during the rebase the work tree and index and
> HEAD should all match?  If the latter, failure from this again is a
> reason to abort.
>
>  		! git diff-index --cached --quiet HEAD -- &&
>
> Do we have something to commit?  This needs to be checked so that we can
> skip a commit that results in emptyness, so using this as a check to see
> if we should commit makes sense.
>
>  		. "$DOTEST"/author-script && {
>  			test ! -f "$DOTEST"/amend || git reset --soft HEAD^
>  		} &&
>
> Find GIT_AUTHOR_* variables and if we are amending rewind the HEAD.  The
> failure from this is a grave problem and reason to abort, isn't it?
>
>  		export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
> 		git commit --no-verify -F "$DOTEST"/message -e
>
> Then we go on to create commit.  As you said, failure from this is a
> grave error.

Any response to this or problems in the clean-up patch?

> ---
>  git-rebase--interactive.sh |   29 +++++++++++++++++++----------
>  1 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 090c3e5..7aa4278 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -363,17 +363,26 @@ do
>  
>  		test -d "$DOTEST" || die "No interactive rebase running"
>  
> -		# commit if necessary
> -		git rev-parse --verify HEAD > /dev/null &&
> -		git update-index --refresh &&
> -		git diff-files --quiet &&
> -		! git diff-index --cached --quiet HEAD -- &&
> -		. "$DOTEST"/author-script && {
> -			test ! -f "$DOTEST"/amend || git reset --soft HEAD^
> -		} &&
> -		export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
> -		if ! git commit --no-verify -F "$DOTEST"/message -e
> +		# Sanity check
> +		git rev-parse --verify HEAD >/dev/null ||
> +			die "Cannot read HEAD"
> +		git update-index --refresh && git diff-files --quiet ||
> +			die "Working tree is dirty"
> +
> +		# do we have anything to commit?
> +		if git diff-index --cached --quiet HEAD --
>  		then
> +			: Nothing to commit -- skip this
> +		else
> +			. "$DOTEST"/author-script ||
> +				die "Cannot find the author identity"
> +			if test -f "$DOTEST"/amend
> +			then
> +				git reset --soft HEAD^ ||
> +				die "Cannot rewind the HEAD"
> +			fi
> +			export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
> +			git commit --no-verify -F "$DOTEST"/message -e ||
>  			die "Could not commit staged changes."
>  		fi
>  

^ permalink raw reply

* Re: [ANNOUNCE] qgit2.1rc1_win.exe
From: Peter Klavins @ 2007-12-26 23:37 UTC (permalink / raw)
  To: msysgit-/JYPxA39Uh5TLH3MbocFFw; +Cc: git-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <e5bfff550712261523g7aab6e76nd37257e7b21d1653-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


> Just a question. How about using the auto-extract zip I advertise in
> this thread? With this both Qt and qgit are already compiled and
> should be ready to go.

I did use your auto-extract utility, and it worked as advertised, thanks. 
Just as an aside, I think it would be better for it to also package git 
(msysgit version), so there's no need to search for git and pre-download it.

But being and old engineer at heart, I had to understand how to build qgit 
from scratch, and not being at all familiar with Qt, it was difficult to get 
it working, thus I wrote the note just in case others were having similar 
difficulties. I appreciate your clarification of the build steps.

Do you think it's worthwhile adding this info into your README?

------------------------------------------------------------------------
 Peter Klavins 

^ permalink raw reply

* Re: [ANNOUNCE] qgit2.1rc1_win.exe
From: Marco Costalba @ 2007-12-26 23:23 UTC (permalink / raw)
  To: Peter Klavins; +Cc: git-u79uwXL29TY76Z2rM5mHXA, msysgit-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <fkugn8$d2s$1@ger.gmane.org>


On Dec 26, 2007 10:22 PM, Peter Klavins <klavins-ooduxAEi7gXtt0EhB6fy4g@public.gmane.org> wrote:
>
> 4. configure                 (takes significant time, around 10 minutes from
> memory)

configure -fast -no-qt3support -static -release -no-qmake

Takes much less (about one minute)

> 5. nmake                     (takes over an hour on a Core 2 Duo 2 GHz,
> consumes 2 GByte of disk)
>

2GBytes because default configure is -debug, but giving -release
instead the needed space is much less because debug symbols are not
built.

Also use:

nmake sub-src

30minutes on my Core Duo 1.5Ghz. It just compiles the Qt libraries
under src directory, not Qt tools like designer, assistant and
expecially the Qt examples.

Note: first you need to run nmake to build makefile then, just after
the makefile in main directory is built (few seconds) you can stop it
and run nmake sub-src.

> 16. bin\qgit             (to run qgit to browse qgit4's own repository!)
>

msysgit must be in PATH, both Git\cmd and Git\bin. Or you can use the
launch script start_qgit.bat that just adds msysgit to the PATH for
you before to call qgit.exe



> ------------------------------------------------------------------------
>  Peter Klavins
>

Thanks Peter,

Just a question. How about using the auto-extract zip I advertise in
this thread? With this both Qt and qgit are already compiled and
should be ready to go.


Marco

^ permalink raw reply

* Using git for file archival/backup purposes - deletion strategy
From: Martin Langhoff @ 2007-12-26 22:43 UTC (permalink / raw)
  To: Git Mailing List

Hi list!

I am drafting a tool to use GIT as a behind-the-scenes archival/backup
tool for web applications. There's been countless threads covering
generic file archival, discussing /etc and homedirs, so I am pretty
comfortable with the mechanics and the whole idea. This is a fairly
narrow use, where the web apps are reasonable well behaved -- most
(all?) of the caveats in ~ and /etc archival seem to be under control.

What I am not 100% clear on is the "old history" deletion strategy.
The history will be *strictly* linear, so my intention is to keep the
last N commits, by overriding the parent of the Nth commit that git
log lists with a "shallow" entry in $GIT_DIR/shallow as documented in
Documentation/technical/shallow.txt , and call gc after that.

Is that the correct way to "forget" old history? Searching high and
low in the list, I fail to find a definitive answer. Shallow and
grafts entries are discussed as ways of doing this, but I can't find a
"correct" way of doing this.

BTW I've just done a git clone --depth 10 ~/src/git and while I do get
a clearly "shallow" checkout, with a tiny .git/objects directory, I
can't find any file called shallow, or grafts. .git/config doesn't say
anything either, and alternates is empty. I frankly cannot tell how
git recognizes it as a shallow repo.

Ah! Local clones won't honour --depth!. A clone from git.kernel.org
does get its .git/shallow file.

So the question is: is it safe (and enough) to add the SHA1 to the
.git/shallow file and call git gc? Is there a better way?

cheers,


m

^ permalink raw reply

* Re: [ANNOUNCE] qgit2.1rc1_win.exe
From: Peter Klavins @ 2007-12-26 21:22 UTC (permalink / raw)
  To: msysgit-/JYPxA39Uh5TLH3MbocFFw; +Cc: git-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <e5bfff550712240113y4acdaa11y3483705172a5980e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


> You can find an auto-extract zip file with a version of qgit built for
> Windows (Vista).

I found it a bit obscure as to how to rebuild qgit from scratch on Vista, so 
just for the record:

# Set up VS2008
1. Install Visual Studio 2008

# Set up Qt4
2. Download qt-win-opensource-src-4.3.3.zip from 
http://trolltech.com/developer/downloads/qt/windows and unzip into directory 
(e.g.,) C:\qt-win-opensource-src-4.3.3
3. cd C:\qt-win-opensource-src-4.3.3
4. configure                 (takes significant time, around 10 minutes from 
memory)
5. nmake                     (takes over an hour on a Core 2 Duo 2 GHz, 
consumes 2 GByte of disk)

# Install git and use it to get qgit4 source
6. Download Git-1.5.4-rc1-preview20071221-corrected.exe from 
http://code.google.com/p/msysgit/downloads/ and install (default directory 
C:\Program Files\Git is fine)
7. Open Git Bash from Start menu, set up Src directory (e.g., mkdir Src, cd 
Src)
8. git clone git://git.kernel.org/pub/scm/qgit/qgit4.git        (to get qgit 
sources into Src/qgit4)
9. Exit Git Bash shell

# Build and run qgit
10. Open VS2008 command prompt, ensuring that VS tools are on the PATH by 
test invoking 'nmake'
11. Add qmake to path with PATH=C:\qt-win-opensource-src-4.3.3\bin;%PATH%
12. Add git to path with PATH=C:\Program Files\Git\bin;%PATH%
13. Navigate to qgit4 directory (e.g., cd C:\Users\<you>\Src\qgit4)
14. qmake              (to preprocess with Qt4)
15. nmake              (to build debug version)
16. bin\qgit             (to run qgit to browse qgit4's own repository!)

------------------------------------------------------------------------
 Peter Klavins 

^ permalink raw reply

* Re: [PATCH] Fix "git log --diff-filter" bug
From: Junio C Hamano @ 2007-12-26 19:41 UTC (permalink / raw)
  To: Arjen Laarhoven; +Cc: git
In-Reply-To: <1198580807-18802-1-git-send-email-arjen@yaph.org>

Thanks.  Some tests?

^ permalink raw reply

* Re: [PATCH] Force new line at end of commit message
From: Junio C Hamano @ 2007-12-26 19:36 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Johannes Schindelin, Bernt Hansen, git
In-Reply-To: <20071225044202.GO14735@spearce.org>

"Shawn O. Pearce" <spearce@spearce.org> writes:

> There is nothing that requires that a commit object end with an LF.
> So tools that make this assumption (that there is a trailing LF)
> while processing the body of a commit message are quite simply
> broken.
> ...
> IMHO git-gui is producing valid commit messages, and always does
> so with no trailing LF, and any tool that is assuming a trailing
> LF is always present is broken.

I would not go that far, even though I would agree that the
consumers of existing commits should be lenient and the creators
of new commits should be strict.

Now, "strict" and "lenient" are both relative to some yardstick,
but relative to what?  I would say that the UI layer of "git the
SCM" is about helping humans create commit messages for human
consumption, even though the low-level commit objects are
equipped to record any binary blob (including NUL byte).

As UI layer programs, I think "git commit" and "git rebase -i"
can and should be stricter than allowing "arbitrary binary
blobs".  Namely, they should make sure what they produce are
good text messages (and a good text message ends with a LF ---
prepare a file with an incomplete line, run "cat file" from
interactive shell on it, and see your prompt tucked at the end
before arguing otherwise).

So how about doing something like this?

---
 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 090c3e5..d0d83c3 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -215,15 +215,17 @@ make_squash_message () {
 		COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \
 			< "$SQUASH_MSG" | tail -n 1)+1))
 		echo "# This is a combination of $COUNT commits."
-		sed -n "2,\$p" < "$SQUASH_MSG"
+		sed -e 1d -e '2,/^./{
+			/^$/d
+		}' <"$SQUASH_MSG"
 	else
 		COUNT=2
 		echo "# This is a combination of two commits."
 		echo "# The first commit's message is:"
 		echo
 		git cat-file commit HEAD | sed -e '1,/^$/d'
-		echo
 	fi
+	echo
 	echo "# This is the $(nth_string $COUNT) commit message:"
 	echo
 	git cat-file commit $1 | sed -e '1,/^$/d'

^ permalink raw reply related

* Re: [PATCH] Force new line at end of commit message
From: Bernt Hansen @ 2007-12-26 17:47 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Johannes Schindelin, Junio C Hamano, git
In-Reply-To: <20071225044202.GO14735@spearce.org>

"Shawn O. Pearce" <spearce@spearce.org> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> This is a patch for git-gui, so why not make that clear in the subject?  
>> (And I have a hunch that Shawn would have liked the patch relative to 
>> git-gui.git, not git.git...)
>
> Indeed.
>
> its clear in both the email and in the commit log that the change is
> a git-gui change.  Remember, git-gui's logs show up in the core Git
> logs (as its merged with -s subtree) so having that git-gui: prefix
> does help people to localize the change within the overall suite.
>

Thanks for the feedback on the patch.

This is my first attempt at creating a patch for git (even if it is
mostly trivial in this case) and I wasn't aware of the git-gui.gitk repo
and conventions regarding the commit message.  I just tried to follow
what was in Documentation/SubmittingPatches.  I'll try to do better next
time :)

>> Further, there are other tools than rebase -i that like commit messages 
>> better when terminated by a newline, and _that_ is what I would like to 
>> read in the commit message for this patch.
>
> Hmmph.  For that reason alone I'm tempted to *not* apply Bernt's
> patch.
>
> There is nothing that requires that a commit object end with an LF.
> So tools that make this assumption (that there is a trailing LF)
> while processing the body of a commit message are quite simply
> broken.

Forcing a LF on the end of the commit message feels wrong to me too.

This band-aid solution fixes the issue I'm dealing with for
git-rebase -i when squashing 3 or more commits created by git-gui.

I agree with Sean and think the more correct fix would be to make
git rebase -i and any other tools we encounter with similar problems
handle the case where there is no newline at the end of the commit
message.

The patch as it stands should probably not be applied.

-Bernt

^ permalink raw reply

* Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.
From: David Brown @ 2007-12-26  5:32 UTC (permalink / raw)
  To: Sean; +Cc: git, Joel Becker, Junio C Hamano
In-Reply-To: <BAYC1-PASMTP131135B69209F6EB72F809AE5B0@CEZ.ICE>

On Tue, Dec 25, 2007 at 11:54:38PM -0500, Sean wrote:

>But i wonder about the case where a user has "sendemail.suppresscc = all" in their
>~/.gitconfig.   For the occasion when they do want to cc the author of
>a patch, what do they do?  The above UI seems to lack a way to enable a cc option
>that has been disabled by default.

Well, in that instance, --no-suppress-from would override that, if I did it
right.  Perhaps we could add an unsuppress-cc option, but then the whole
thing is starting to get more complicated than I think it really needs to
be.

My suggestion would be to keep this patch as is, and if the people using it
decide they want the override option, we/I can figure out how to add it.

Dave

^ permalink raw reply

* Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.
From: Sean @ 2007-12-26  4:54 UTC (permalink / raw)
  To: David Brown; +Cc: git, Joel Becker, Junio C Hamano
In-Reply-To: <1198641389-959-1-git-send-email-git@davidb.org>

On Tue, 25 Dec 2007 19:56:29 -0800
David Brown <git@davidb.org> wrote:

> Add a new option --suppress-cc, which can be specified one or more
> times to list the categories of auto-cc fields that should be
> suppressed.  If not specified, it defaults to values to give the same
> behavior as specified by --suppress-from, and --signed-off-cc.  The
> categories are:
> 
>   self   - patch sender.  Same as --suppress-from.
>   author - patch author.
>   cc     - cc lines mentioned in the patch.
>   cccmd  - avoid running the cccmd.
>   sob    - signed off by lines.
>   all    - all non-explicit recipients
> 

Hi Dave,

It's great to see you're taking care of this issue, it's one that i've tripped over
a few times.  If your patch is accepted as-is, i think it's an improvement.

But i wonder about the case where a user has "sendemail.suppresscc = all" in their
~/.gitconfig.   For the occasion when they do want to cc the author of
a patch, what do they do?  The above UI seems to lack a way to enable a cc option
that has been disabled by default.

Cheers,
Sean

^ permalink raw reply

* [PATCH] git-send-email: Generalize auto-cc recipient mechanism.
From: David Brown @ 2007-12-26  3:56 UTC (permalink / raw)
  To: git; +Cc: Joel Becker, Junio C Hamano
In-Reply-To: <7vk5n2o58p.fsf@gitster.siamese.dyndns.org>

There are a few options to git-send-email to suppress the automatic
generation of 'Cc' fields: --suppress-from, and --signed-off-cc.
However, there are other times that git-send-email automatically
includes Cc'd recipients.  This is not desirable for all development
environments.

Add a new option --suppress-cc, which can be specified one or more
times to list the categories of auto-cc fields that should be
suppressed.  If not specified, it defaults to values to give the same
behavior as specified by --suppress-from, and --signed-off-cc.  The
categories are:

  self   - patch sender.  Same as --suppress-from.
  author - patch author.
  cc     - cc lines mentioned in the patch.
  cccmd  - avoid running the cccmd.
  sob    - signed off by lines.
  all    - all non-explicit recipients

Signed-off-by: David Brown <git@davidb.org>
---
I've now added changes similar to those suggested by Junio Hamano so
that signed-off-cc and suppress-from override values set by
signed-off-by.

Dave

 Documentation/git-send-email.txt |   11 +++++++
 git-send-email.perl              |   56 +++++++++++++++++++++++++++++++++-----
 2 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f0bd285..3dcea86 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -117,6 +117,17 @@ The --cc option must be repeated for each user you want on the cc list.
         Default is the value of 'sendemail.suppressfrom' configuration value;
         if that is unspecified, default to --no-suppress-from.
 
+--suppress-cc::
+	Specify an additional category of recipients to suppress the
+	auto-cc of.  'self' will avoid including the sender, 'author' will
+	avoid including the patch author, 'cc' will avoid including anyone
+	mentioned in Cc lines in the patch, 'sob' will avoid including
+	anyone mentioned in Signed-off-by lines, and 'cccmd' will avoid
+	running the --cc-cmd.  'all' will suppress all auto cc values.
+	Default is the value of 'sendemail.suppresscc' configuration value;
+	if that is unspecified, default to 'self' if --suppress-from is
+	specified, as well as 'sob' if --no-signed-off-cc is specified.
+
 --thread, --no-thread::
 	If this is set, the In-Reply-To header will be set on each email sent.
 	If disabled with "--no-thread", no emails will have the In-Reply-To
diff --git a/git-send-email.perl b/git-send-email.perl
index e47994a..a4cf4a9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -88,6 +88,12 @@ Options:
 
    --smtp-ssl     If set, connects to the SMTP server using SSL.
 
+   --suppress-cc  Suppress the specified category of auto-CC.  The category
+                  can be one of 'author' for the patch author, 'self' to
+                  avoid copying yourself, 'sob' for Signed-off-by lines,
+                  'cccmd' for the output of the cccmd, or 'all' to suppress
+                  all of these.
+
    --suppress-from Suppress sending emails to yourself. Defaults to off.
 
    --thread       Specify that the "In-Reply-To:" header should be set on all
@@ -177,12 +183,13 @@ my ($quiet, $dry_run) = (0, 0);
 my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
 my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);
 my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
+my (@suppress_cc);
 
 my %config_bool_settings = (
     "thread" => [\$thread, 1],
     "chainreplyto" => [\$chain_reply_to, 1],
-    "suppressfrom" => [\$suppress_from, 0],
-    "signedoffcc" => [\$signed_off_cc, 1],
+    "suppressfrom" => [\$suppress_from, undef],
+    "signedoffcc" => [\$signed_off_cc, undef],
     "smtpssl" => [\$smtp_ssl, 0],
 );
 
@@ -196,6 +203,7 @@ my %config_settings = (
     "aliasfiletype" => \$aliasfiletype,
     "bcc" => \@bcclist,
     "aliasesfile" => \@alias_files,
+    "suppresscc" => \@suppress_cc,
 );
 
 # Begin by accumulating all the variables (defined above), that we will end up
@@ -218,6 +226,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "quiet" => \$quiet,
 		    "cc-cmd=s" => \$cc_cmd,
 		    "suppress-from!" => \$suppress_from,
+		    "suppress-cc=s" => \@suppress_cc,
 		    "signed-off-cc|signed-off-by-cc!" => \$signed_off_cc,
 		    "dry-run" => \$dry_run,
 		    "envelope-sender=s" => \$envelope_sender,
@@ -262,6 +271,35 @@ foreach my $setting (values %config_bool_settings) {
 	${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));
 }
 
+# Set CC suppressions
+my(%suppress_cc);
+if (@suppress_cc) {
+	foreach my $entry (@suppress_cc) {
+		die "Unknown --suppress-cc field: '$entry'\n"
+			unless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;
+		$suppress_cc{$entry} = 1;
+	}
+}
+
+if ($suppress_cc{'all'}) {
+	foreach my $entry (qw (ccmd cc author self sob)) {
+		$suppress_cc{$entry} = 1;
+	}
+	delete $suppress_cc{'all'};
+}
+
+# If explicit old-style ones are specified, they trump --suppress-cc.
+$suppress_cc{'self'} = $suppress_from if defined $suppress_from;
+$suppress_cc{'sob'} = $signed_off_cc if defined $signed_off_cc;
+
+# Debugging, print out the suppressions.
+if (0) {
+	print "suppressions:\n";
+	foreach my $entry (keys %suppress_cc) {
+		printf "  %-5s -> $suppress_cc{$entry}\n", $entry;
+	}
+}
+
 my ($repoauthor) = $repo->ident_person('author');
 my ($repocommitter) = $repo->ident_person('committer');
 
@@ -701,11 +739,14 @@ foreach my $t (@files) {
 
 				} elsif (/^(Cc|From):\s+(.*)$/) {
 					if (unquote_rfc2047($2) eq $sender) {
-						next if ($suppress_from);
+						next if ($suppress_cc{'self'});
 					}
 					elsif ($1 eq 'From') {
 						($author, $author_encoding)
 						  = unquote_rfc2047($2);
+						next if ($suppress_cc{'author'});
+					} else {
+						next if ($suppress_cc{'cc'});
 					}
 					printf("(mbox) Adding cc: %s from line '%s'\n",
 						$2, $_) unless $quiet;
@@ -732,7 +773,7 @@ foreach my $t (@files) {
 				# line 2 = subject
 				# So let's support that, too.
 				$input_format = 'lots';
-				if (@cc == 0) {
+				if (@cc == 0 && !$suppress_cc{'cc'}) {
 					printf("(non-mbox) Adding cc: %s from line '%s'\n",
 						$_, $_) unless $quiet;
 
@@ -749,10 +790,11 @@ foreach my $t (@files) {
 			}
 		} else {
 			$message .=  $_;
-			if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {
+			if (/^(Signed-off-by|Cc): (.*)$/i) {
+				next if ($suppress_cc{'sob'});
 				my $c = $2;
 				chomp $c;
-				next if ($c eq $sender and $suppress_from);
+				next if ($c eq $sender and $suppress_cc{'self'});
 				push @cc, $c;
 				printf("(sob) Adding cc: %s from line '%s'\n",
 					$c, $_) unless $quiet;
@@ -761,7 +803,7 @@ foreach my $t (@files) {
 	}
 	close F;
 
-	if (defined $cc_cmd) {
+	if (defined $cc_cmd && !$suppress_cc{'cccmd'}) {
 		open(F, "$cc_cmd $t |")
 			or die "(cc-cmd) Could not execute '$cc_cmd'";
 		while(<F>) {
-- 
1.5.3.7

^ permalink raw reply related

* Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.
From: David Brown @ 2007-12-26  3:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Joel Becker
In-Reply-To: <7vk5n2o58p.fsf@gitster.siamese.dyndns.org>

On Tue, Dec 25, 2007 at 01:04:54PM -0800, Junio C Hamano wrote:

>+# If explicit old-style ones are specified, they trump supress-cc
>+if (defined $suppress_from) {
>+	$suppress_cc{'self'} = $suppress_from;
>+}
>+if (defined $signed_off_cc) {
>+	$suppress_cc{'sob'} = !$signed_off_cc;
>+}

This changes the default behavior to --no-signed-off-cc, if nothing is
specified.  I'll see if I can add something that will set that if no
suppress-cc's are set.

Patch to follow shortly.

David

^ permalink raw reply

* Re: [PATCH] Fix "git log --diff-filter" bug
From: Jakub Narebski @ 2007-12-25 22:44 UTC (permalink / raw)
  To: Arjen Laarhoven; +Cc: gitster, git
In-Reply-To: <1198580807-18802-1-git-send-email-arjen@yaph.org>

Arjen Laarhoven <arjen@yaph.org> writes:

> In commit b7bb760d5ed4881422673d32f869d140221d3564 an optimization
> was made to avoid unnecessary diff generation.  This was partly fixed
> in 99516e35d096f41e7133cacde8fbed8ee9a3ecd0, but obviously the
> '--diff-filter' option also needs the diff machinery in action.

Thanks a lot! I was wondering why 'git log --diff-filter=M' didn't
find anything...
-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.
From: Junio C Hamano @ 2007-12-25 21:04 UTC (permalink / raw)
  To: David Brown; +Cc: git, Joel Becker
In-Reply-To: <1198532163-25308-1-git-send-email-git@davidb.org>

David Brown <git@davidb.org> writes:

> ...
>   self   - patch sender.  Same as --suppress-from.
>   author - patch author.
>   cc     - cc lines mentioned in the patch.
>   cccmd  - avoid running the cccmd.
>   sob    - signed off by lines.
>   all    - all non-explicit recipients
>
> Signed-off-by: David Brown <git@davidb.org>
> ...
> What bothers me most about this change is that --signed-of-cc
> and --suppress-from are silently ignored if --suppress-cc is given, either
> on the command line, or in the config.

The order in which various variables are set in the current code
before your patch is like this:

 * my ($var) introduces them -- they are undefined at the
   beginning;

 * GetOptions() may set them to explicit values;

 * read_config(), first for the specific sendemail identity and
   then for the generic ones, fill the ones that are still
   undefined;

 * the built-in default from %config_bool_settings are used to
   fill the ones that are still undefined at this point;

Now, I think you can build on top of the above by adding the
following after that sequence:

 * fill %suppress_cc with explicit @suppress_cc GetOptions and
   read_config() read;

 * if the --suppress-from and/or --signed-off-by-cc, either from
   GetOptions() or from read_config() are given, make them
   override what @suppress_cc says.  So giving --suppress-cc=all
   and --signed-off-by-cc at the same time will still send cc to
   people who signed off the patch (because these old-style ones
   are more specific).

Perhaps something like this (untested, of course!) patch on top
of yours.


 git-send-email.perl |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 1f03d12..cde5ffb 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -188,8 +188,8 @@ my (@suppress_cc);
 my %config_bool_settings = (
     "thread" => [\$thread, 1],
     "chainreplyto" => [\$chain_reply_to, 1],
-    "suppressfrom" => [\$suppress_from, 0],
-    "signedoffcc" => [\$signed_off_cc, 1],
+    "suppressfrom" => [\$suppress_from, undef],
+    "signedoffcc" => [\$signed_off_cc, undef],
     "smtpssl" => [\$smtp_ssl, 0],
 );
 
@@ -279,18 +279,20 @@ if (@suppress_cc) {
 			unless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;
 		$suppress_cc{$entry} = 1;
 	}
-} else {
-	# Convert the old-style options.
-	$suppress_cc{'self'} = 1 if $suppress_from;
-	$suppress_cc{'sob'} = 1 unless $signed_off_cc;
 }
-
 if ($suppress_cc{'all'}) {
 	foreach my $entry (qw (ccmd cc author self sob)) {
 		$suppress_cc{$entry} = 1;
 	}
 	delete $suppress_cc{'all'};
 }
+# If explicit old-style ones are specified, they trump supress-cc
+if (defined $suppress_from) {
+	$suppress_cc{'self'} = $suppress_from;
+}
+if (defined $signed_off_cc) {
+	$suppress_cc{'sob'} = !$signed_off_cc;
+}
 
 my ($repoauthor) = $repo->ident_person('author');
 my ($repocommitter) = $repo->ident_person('committer');

^ permalink raw reply related

* [RFC/PATCH] Add a script to run test scripts using valgrind.
From: Christian Couder @ 2007-12-25 20:29 UTC (permalink / raw)
  To: Junio Hamano; +Cc: git

This patch adds a Perl script 'run_valgrind.pl' that runs
the test scripts passed as arguments using valgrind.

To use valgrind, we use a shell alias like:

alias git='valgrind <options> git'

and we source a test script in the same system call.

The valgrind logs are then parsed for errors and the errors
found are hashed so that they appear only once at the end.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/run_valgrind.pl |  138 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)
 create mode 100755 t/run_valgrind.pl

diff --git a/t/run_valgrind.pl b/t/run_valgrind.pl
new file mode 100755
index 0000000..cb965c9
--- /dev/null
+++ b/t/run_valgrind.pl
@@ -0,0 +1,138 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+# All arguments should be test scripts.
+my @scripts = @ARGV;
+
+my $vg_vers = valgrind_version();
+
+print "Using valgrind version: $vg_vers\n";
+
+my $log_base = '/tmp/vg_log';
+my $log_opt = ($vg_vers < '3.3') ? $log_base : "$log_base.%p";
+my $vg_opts = "--log-file=$log_opt --trace-children=yes";
+my $alias = "alias git='valgrind $vg_opts git'";
+
+# Remove previous log files.
+system("rm -rf $log_base.*");
+
+# Run the scripts using an alias for Git.
+foreach my $file (@scripts) {
+	system("$alias \n . ./$file");
+}
+
+# Error lines from log files.
+my @log_files = glob("$log_base.*");
+my @errs = `grep 'ERROR SUMMARY' $log_base.*`;
+chomp @errs;
+
+print "\nNumber of log files: " . scalar(@log_files) . "\n";
+print "Number of error lines: " . scalar(@errs) . "\n";
+
+my @logs;
+for (@errs) {
+	if (m/^([^:]+):.*ERROR SUMMARY: (\d+) errors/) {
+		push @logs, $1 if ($2 > 0);
+	} else {
+		print STDERR "strange line: $_\n";
+	}
+}
+
+print "\nResulting files with errors:\n\n", join("\n", @logs), "\n\n";
+
+# Parse error files.
+my @info = ();
+for (@logs) {
+	my @new = parse_error_file($_);
+	push @info, @new;
+}
+
+# Get only uniq errors.
+my @uniq = ();
+my %stack = ();
+for (@info) {
+	my $key = stack_info($_, 1);
+	if (exists $stack{$key}) {
+		push @{$stack{$key}}, $_->{file};
+	} else {
+		$stack{$key} = [ $_->{file} ];
+		$_->{file} = $stack{$key};
+		push @uniq, $_;
+	}
+}
+
+# Print uniq errors.
+print "Uniq errors:\n";
+for (@uniq) {
+	print "\n" . stack_info($_);
+	print "Files: " . join(", ", @{$_->{file}}) . "\n";
+}
+
+sub valgrind_version {
+	system("which valgrind > /dev/null 2>&1") == 0
+	  or die "'which valgrind' failed.";
+
+	my $version = `valgrind --version`;
+	chomp $version;
+
+	if ($version =~ m/(\d+)\.(\d+)\.(\d+)/) {
+		return "$1.$2";
+	} else {
+		die "Could not find valgrind version.";
+	}
+}
+
+sub stack_info {
+	$_ = shift;
+	my ($key) = @_;
+
+	my $msg = $_->{msg};
+	$msg =~ s/0x[0-9A-F]+// if ($key);
+
+	my @places = map { $_->[1] } @{$_->{stack}};
+	return "$msg\n" . join("\n", @places) . "\n";
+}
+
+sub clean_line {
+	my ($line) = @_;
+
+	$line =~ s/^==\d+==\s+//;
+
+	return $line;
+}
+
+sub parse_error_file {
+	my ($file) = @_;
+
+	# Slurp file.
+	open(IN, "< $file") or die "Could not open '$file' for reading: $!";
+	my @content = <IN>;
+	chomp @content;
+	close IN;
+
+	# Parse errors in file.
+	my @errs = ();
+	my $stack = 0;
+	my $prev = '';
+	my $cur;
+	for (@content) {
+		if (not $stack and m/    at 0x([0-9A-F]+): (.*)$/) {
+			$stack = 1;
+			$cur = { msg => $prev,
+				 file => $file,
+				 stack => [ [$1, $2] ] };
+		} elsif ($stack) {
+			if (m/    by 0x([0-9A-F]+): (.*)$/) {
+				push @{$cur->{stack}}, [$1, $2];
+			} else {
+				push @errs, $cur;
+				$stack = 0;
+			}
+		}
+		$prev = clean_line($_);
+	}
+
+	return @errs;
+}
-- 
1.5.3.7.2270.g786cf-dirty

^ permalink raw reply related

* [PATCH] git-filter-branch could be confused by similar names
From: Dmitry Potapov @ 2007-12-25 14:35 UTC (permalink / raw)
  To: git; +Cc: Dmitry Potapov

'git-filter-branch branch' could fail producing the error:
"Which ref do you want to rewrite?" if existed another branch
or tag, which name was 'branch-something' or 'something/branch'.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
---
 git-filter-branch.sh     |    2 +-
 t/t7003-filter-branch.sh |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index dbab1a9..b89a720 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -219,7 +219,7 @@ do
 	;;
 	*)
 		ref="$(git for-each-ref --format='%(refname)' |
-			grep /"$ref")"
+			grep '^refs/[^/]\+/'"$ref"'$')"
 	esac
 
 	git check-ref-format "$ref" && echo "$ref"
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 5f60b22..c3e5207 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -36,6 +36,16 @@ test_expect_success 'result is really identical' '
 	test $H = $(git rev-parse HEAD)
 '
 
+test_expect_success 'rewrite branch with similar names' '
+	git branch my &&
+	git tag my/orig &&
+	git tag my-orig &&
+	git tag orig/my &&
+	git tag orig-my &&
+	git-filter-branch my &&
+	test $H = $(git rev-parse HEAD)
+'
+
 test_expect_success 'rewrite, renaming a specific file' '
 	git-filter-branch -f --tree-filter "mv d doh || :" HEAD
 '
-- 
1.5.3.5

^ permalink raw reply related

* [PATCH] combine-diff: use diff_opts->a_prefix
From: Salikh Zakirov @ 2007-12-25 13:46 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


The introduction of configurable dir prefix for diff headers in commit
eab9a40b 'Teach diff machinery to display other prefixes than "a/" and "b/"'
missed combined diff generation.

Signed-off-by: Salikh Zakirov <salikh@gmail.com>
---

I realize that this fix is ugly, so I am all ears for a suggestion
of a better fix.

 combine-diff.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/combine-diff.c b/combine-diff.c
index e22db89..5c3b42d 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -646,10 +646,11 @@ static void reuse_combine_diff(struct sline *sline, unsigned long cnt,
 	sline->p_lno[i] = sline->p_lno[j];
 }
 
-static void dump_quoted_path(const char *prefix, const char *path,
-			     const char *c_meta, const char *c_reset)
+static void dump_quoted_path(const char *prefix, const char *prefix2,
+                             const char *path, const char *c_meta,
+			     const char *c_reset)
 {
-	printf("%s%s", c_meta, prefix);
+	printf("%s%s%s", c_meta, prefix, prefix2);
 	quote_c_style(path, NULL, stdout, 0);
 	printf("%s\n", c_reset);
 }
@@ -792,7 +793,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 
 		if (rev->loginfo && !rev->no_commit_id)
 			show_log(rev, opt->msg_sep);
-		dump_quoted_path(dense ? "diff --cc " : "diff --combined ",
+		dump_quoted_path(dense ? "diff --cc " : "diff --combined ", "",
 				 elem->path, c_meta, c_reset);
 		printf("%sindex ", c_meta);
 		for (i = 0; i < num_parent; i++) {
@@ -829,13 +830,15 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
 			printf("%s\n", c_reset);
 		}
 		if (added)
-			dump_quoted_path("--- /dev/", "null", c_meta, c_reset);
+			dump_quoted_path("--- /dev/", "", "null", c_meta, c_reset);
 		else
-			dump_quoted_path("--- a/", elem->path, c_meta, c_reset);
+			dump_quoted_path("--- ", opt->a_prefix, elem->path,
+			                 c_meta, c_reset);
 		if (deleted)
-			dump_quoted_path("+++ /dev/", "null", c_meta, c_reset);
+			dump_quoted_path("+++ /dev/", "", "null", c_meta, c_reset);
 		else
-			dump_quoted_path("+++ b/", elem->path, c_meta, c_reset);
+			dump_quoted_path("+++ ", opt->b_prefix, elem->path,
+			                 c_meta, c_reset);
 		dump_sline(sline, cnt, num_parent, DIFF_OPT_TST(opt, COLOR_DIFF));
 	}
 	free(result);
-- 
1.5.3.7.1315.g1b8e7

^ permalink raw reply related

* Re: Updated Kernel Hacker's guide to git
From: Salikh Zakirov @ 2007-12-25 13:08 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Git Mailing List
In-Reply-To: <476E42BF.1010300@garzik.org>

Jeff Garzik wrote:
> The kernel hacker's guide to git has received some updates: 
> http://linux.yyz.us/git-howto.html

I have some comments on the contents, though  I need to warn, 
that  I've been following git development for about year and a half now,
and I am not a kernel hacker, so my comments may have wrong bias.

>     Obtain a diff between current branch, and master branch
> 
> In most trees with branches, .git/refs/heads/master contains the
> current 'vanilla' upstream tree, for easy diffing and merging. (in
> trees without branches, 'master' simply contains your latest changes)
> 
> $ git diff master..HEAD

IMHO, syntax 'git diff master HEAD' is preferable, in order to avoid
confusion with 'git log master..HEAD' usage, which has quite different
meaning, roughly expressible as

  git diff `git merge-base master HEAD` HEAD

for getting one big diff of the changes in HEAD since master)

> (this is equivalent to git diff HEAD, when used with HEAD branch)

This seems incorrect to me, as 'git diff master HEAD' compares two
revisions, while 'git diff HEAD' compares working tree with HEAD revision.

Besides, expression 'HEAD branch' is misleading, because HEAD is not a branch by itself,
but rather a link to the latest state of the current branch.

^ permalink raw reply

* [PATCH] Fix "git log --diff-filter" bug
From: Arjen Laarhoven @ 2007-12-25 11:06 UTC (permalink / raw)
  To: gitster; +Cc: git

In commit b7bb760d5ed4881422673d32f869d140221d3564 an optimization
was made to avoid unnecessary diff generation.  This was partly fixed
in 99516e35d096f41e7133cacde8fbed8ee9a3ecd0, but obviously the
'--diff-filter' option also needs the diff machinery in action.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
---
 revision.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/revision.c b/revision.c
index 7e2f4f1..6e85aaa 100644
--- a/revision.c
+++ b/revision.c
@@ -1290,8 +1290,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 	if (revs->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT)
 		revs->diff = 1;
 
-	/* Pickaxe and rename following needs diffs */
-	if (revs->diffopt.pickaxe || DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
+	/* Pickaxe, diff-filter and rename following need diffs */
+	if (revs->diffopt.pickaxe ||
+	    revs->diffopt.filter ||
+	    DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
 		revs->diff = 1;
 
 	if (revs->topo_order)
-- 
1.5.4.rc1.21.g0e545

^ permalink raw reply related

* Re: [PATCH] Document git rev-list --first-parent
From: Junio C Hamano @ 2007-12-25  9:35 UTC (permalink / raw)
  To: Avi Kivity; +Cc: git
In-Reply-To: <476F8679.8010706@qumranet.com>

Avi Kivity <avi@qumranet.com> writes:

> I'm a mid-level maintainer for a particular subsystem (kvm).  I merge
> patchsets from others and do my own work, but I am careful to keep
> everything linear (no real merges in the git sense).  Every once in a
> while I merge from upstream or some other tree, but these are never
> kvm developments.  Every merge window I rebase the development branch
> to upstream, removing commits that were later reverted, and merging
> fixes into the patches that introduce them and push the result to
> Linus.  Hopefully that's clear as I'm not much of an ascii artist.
> So, for me --first-parent means "commits to the development branch of
> kvm", whether by myself or someone else.

Sure.  That's a perfect use case for --first-parent, as you can
afford to rebase.

I wanted to point out that the description needs to be clear
enough that people know the option is applicable only to some
workflow, but not necessarily to their own.  Saying "this option
gives a better overview" as if it always would felt wrong.  For
example for Linus, the option will not give a better overview.

Even in your case, if you merged from others' kvm tree, the
option becomes useless, as you mentioned ("I am careful to keep
everything linear").

If somebody cannot rebase (Linus certainly doesn't, and as a
general rule the top-level integration branch would never be
rebased) but pulls from people, some merges end up as real
merges while some others fast-forward and do not create merge
commits.  In such a history, --first-parent is not very useful.
Some parts of development will see individual commits (i.e. ones
applied by the top-level integrator himself, and the ones built
and committed by a subsystem person whose merge happened to have
fast-forwarded), while other parts will just show merge commits
(i.e. all other merges from subsystem people).

I however think the wording "... the evolution of a particular
branch" lessens my worries a bit, because it hints that the
option is about viewing the history of a topic branch, not the
integration mainline.  Maybe the wording can be made even more
explicit and say something like:

    This option can give a better overview when viewing the
    evolution of a particular topic branch, because merges into
    a topic branch tend to be only about adjusting to updated
    upstream from time to time, and this option allows you to
    ignore the individual commits brought in to your history by
    such a merge.

By the way, the wording "if a branch implements a consistent
fast-forward policy" suggests that forcing a real merge when the
merged branch is a fast-forward of your history is somehow a
good thing, but I think it is backwards to make such an
artificial real merge just to keep --first-parent happy.

^ 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