Git development
 help / color / mirror / Atom feed
* Re: [PATCH 15/19] reset.c: finish entire cmd_reset() whether or not pathspec is given
From: Junio C Hamano @ 2013-01-09 19:59 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-16-git-send-email-martinvonz@gmail.com>

Martin von Zweigbergk <martinvonz@gmail.com> writes:

> By not returning from inside the "if (pathspec)" block, we can let the
> pathspec-aware and pathspec-less code share a bit more, making it
> easier to make future changes that should affect both cases. This also
> highlights the similarity between read_from_tree() and reset_index().
> ---
> Should error reporting be aligned too? Speaking of which,
> do_diff_cache() never returns anything by 0. Is the return value for
> future-proofing?

Perhaps, and yes.

>
>  builtin/reset.c | 42 ++++++++++++++++++------------------------
>  1 file changed, 18 insertions(+), 24 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 254afa9..9bcad29 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -308,19 +308,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  		die(_("%s reset is not allowed in a bare repository"),
>  		    _(reset_type_names[reset_type]));
>  
> -	if (pathspec) {
> -		struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
> -		int index_fd = hold_locked_index(lock, 1);
> -		if (read_from_tree(pathspec, sha1))
> -			return 1;
> -		update_index_refresh(
> -			quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
> -		if (write_cache(index_fd, active_cache, active_nr) ||
> -		    commit_locked_index(lock))
> -			return error("Could not write new index file.");
> -		return 0;
> -	}
> -
>  	/* Soft reset does not touch the index file nor the working tree
>  	 * at all, but requires them in a good order.  Other resets reset
>  	 * the index file to the tree object we are switching to. */
> @@ -330,11 +317,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  	if (reset_type != SOFT) {
>  		struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
>  		int newfd = hold_locked_index(lock, 1);
> -		int err = reset_index(sha1, reset_type, quiet);
> -		if (reset_type == KEEP && !err)
> -			err = reset_index(sha1, MIXED, quiet);
> -		if (err)
> -			die(_("Could not reset index file to revision '%s'."), rev);
> +		if (pathspec) {
> +			if (read_from_tree(pathspec, sha1))
> +				return 1;
> +		} else {
> +			int err = reset_index(sha1, reset_type, quiet);
> +			if (reset_type == KEEP && !err)
> +				err = reset_index(sha1, MIXED, quiet);
> +			if (err)
> +				die(_("Could not reset index file to revision '%s'."), rev);
> +		}
>  
>  		if (reset_type == MIXED) /* Report what has not been updated. */
>  			update_index_refresh(
> @@ -345,14 +337,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  			die(_("Could not write new index file."));
>  	}
>  
> -	/* Any resets update HEAD to the head being switched to,
> -	 * saving the previous head in ORIG_HEAD before. */
> -	update_ref_status = update_refs(rev, sha1);
> +	if (!pathspec) {
> +		/* Any resets without paths update HEAD to the head being
> +		 * switched to, saving the previous head in ORIG_HEAD before. */
> +		update_ref_status = update_refs(rev, sha1);
>  
> -	if (reset_type == HARD && !update_ref_status && !quiet)
> -		print_new_head_line(commit);
> +		if (reset_type == HARD && !update_ref_status && !quiet)
> +			print_new_head_line(commit);
>  
> -	remove_branch_state();
> +		remove_branch_state();
> +	}
>  
>  	return update_ref_status;
>  }

^ permalink raw reply

* Re: [PATCH 16/19] reset [--mixed] --quiet: don't refresh index
From: Junio C Hamano @ 2013-01-09 20:05 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-17-git-send-email-martinvonz@gmail.com>

Martin von Zweigbergk <martinvonz@gmail.com> writes:

> There is a test case in t7102 called '--mixed refreshes the index',
> but it only checks that right output it printed.

I think that comes from 620a6cd (builtin-reset: avoid forking
"update-index --refresh", 2007-11-03).  Before that commit, we
refreshed the index with --mixed, and the test tries to make sure we
continue to do so after the change.  Even though it is not testing
if the index has stat only changes (which is rather cumbersome to
write---you need to futz with timestamp or something) and using the
output from refresh machinery as a substitute, I think the intent of
that commit is fairly clear.

>  builtin/reset.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 9bcad29..a2e69eb 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -109,12 +109,6 @@ static void print_new_head_line(struct commit *commit)
>  		printf("\n");
>  }
>  
> -static void update_index_refresh(int flags)
> -{
> -	refresh_index(&the_index, (flags), NULL, NULL,
> -		      _("Unstaged changes after reset:"));
> -}
> -
>  static void update_index_from_diff(struct diff_queue_struct *q,
>  		struct diff_options *opt, void *data)
>  {
> @@ -328,9 +322,9 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  				die(_("Could not reset index file to revision '%s'."), rev);
>  		}
>  
> -		if (reset_type == MIXED) /* Report what has not been updated. */
> -			update_index_refresh(
> -				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
> +		if (reset_type == MIXED && !quiet) /* Report what has not been updated. */
> +			refresh_index(&the_index, REFRESH_IN_PORCELAIN, NULL, NULL,
> +				      _("Unstaged changes after reset:"));
>  
>  		if (write_cache(newfd, active_cache, active_nr) ||
>  		    commit_locked_index(lock))

^ permalink raw reply

* [PATCH] git-shortlog(1): document behaviour of zero-width wrap
From: John Keeping @ 2013-01-09 20:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Commit 00d3947 (Teach --wrap to only indent without wrapping) added
special behaviour for a width of zero in the '-w' argument to
'git-shortlog' but this was not documented.  Fix this.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 Documentation/git-shortlog.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index afeb4cd..c308e91 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -56,6 +56,9 @@ OPTIONS
 	line of each entry is indented by `indent1` spaces, and the second
 	and subsequent lines are indented by `indent2` spaces. `width`,
 	`indent1`, and `indent2` default to 76, 6 and 9 respectively.
++
+If width is `0` (zero) then indent the lines of the output without wrapping
+them.
 
 
 MAPPING AUTHORS
-- 
1.8.0.2

^ permalink raw reply related

* RE: git-completion.tcsh and git-completion.zsh are broken?
From: Marc Khouzam @ 2013-01-09 20:21 UTC (permalink / raw)
  To: 'Manlio Perillo', 'git@vger.kernel.org'
In-Reply-To: <50EDC237.3000309@gmail.com>


> -----Original Message-----
> From: git-owner@vger.kernel.org 
> [mailto:git-owner@vger.kernel.org] On Behalf Of Manlio Perillo
> Sent: Wednesday, January 09, 2013 2:17 PM
> To: git@vger.kernel.org
> Subject: git-completion.tcsh and git-completion.zsh are broken?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi.
> 
> I have finally resolved all the problems with my path completion in
> git-completion.bash and, in order to avoid regressions, I'm 
> checking the
> git-completion.zsh and git-completion.tcsh scripts, since they use the
> bash completion support.
> 
> I have installed (Debian 6.0.6):
> * zsh 4.3.10 (i686-pc-linux-gnu)
> * tcsh 6.17.02 (Astron) 2010-05-12 (i586-intel-linux)
>   options wide,nls,dl,al,kan,rh,nd,color,filec
> 
> Note that I'm using my modified git-completion.bash script.
> 
> 
> zsh compatibility support in git-completion.bash seems to 
> "work" (I just
> get a segmentation fault ...), however I have problems with 
> the .zsh and
> .tcsh scripts.
> 
> 
> $zsh
> synapsis% source contrib/completion/git-completion.zsh
> (anon):6: command not found: ___main
> _git:11: command not found: _default
> 
> I have disabled compinit autoload (since, I don't know how, it is able
> to find the git completion script)
> 
> 
> $tcsh
> synapsis:~/projects/git/contrib/git> source ~/.git-completion.tcsh
> synapsis:~/projects/git/contrib/git> git show HEAD:<TAB>
> 
> does not show the file list for the tree object in the HEAD

Hm.  That doesn't work for me either.  I'll look into it.
It is not caused by your changes.

> another problem is that a space is added after a directory name.

The lastest version of git-completion.tcsh in the pu branch should
fix that problem.  It was committed yesterday so you may not have it.

> 
> 
> Another problem with zsh:
> 
> $zsh
> synapsis% git show HEAD:<TAB>569GPXZims
> 
> I don't know where that 569GPXZims came from.
> 
> 
> Can someone else confirm these problems?
> 
> 
> Thanks  Manlio
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAlDtwjcACgkQscQJ24LbaURpuACfVQnoBC3tzvxB0JYxQ5aL3rmN
> 8GEAnA7OjVtPqz+aq/PGtNtTHWgFqhKK
> =3UdZ
> -----END PGP SIGNATURE-----
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: [PATCH 17/19] reset $sha1 $pathspec: require $sha1 only to be treeish
From: Junio C Hamano @ 2013-01-09 20:23 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-18-git-send-email-martinvonz@gmail.com>

Martin von Zweigbergk <martinvonz@gmail.com> writes:

> Resetting with paths does not update HEAD and there is nothing else
> that a commit should be needed for. Relax the argument parsing so only
> a tree is required.
>
> The sha1 is only passed to read_from_tree(), which already only
> requires a tree.
>
> The "rev" variable we pass to run_add_interactive() will resolve to a
> tree. This is fine since interactive_reset only needs the parameter to
> be a treeish and doesn't use it for display purposes.
> ---
> Is it correct that interactive_reset does not use the revision
> specifier for display purposes? Or, worse, that it requires it to be a
> commit in some cases? I tried it and didn't see any problem.

As far as I know, it is only given to git-diff-index as the tree-ish,
and resulting patch text is used for application via git-apply just
like any patch coming from any origin, so I think it should be fine.

> Can the two blocks of code that look up commit or tree be made to
> share more? I'm not very familiar with what functions are available. I
> think I tried keeping a separate "struct object *object" to be able to
> put the last three lines outside the blocks, but didn't like the
> result.

I think the patch looks fine from the sharing perspective, but it
may be even nicer to have a separate variable to hold a commit
object limited to the scope of if (!pathspec) block to make them
more symmetric.  The commit is only needed later to show "we are now
at this commit", but that code can find the commit itself given the
object name in sha1[].

>  builtin/reset.c  | 46 ++++++++++++++++++++++++++--------------------
>  t/t7102-reset.sh |  8 ++++++++
>  2 files changed, 34 insertions(+), 20 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index a2e69eb..4c223bd 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -177,9 +177,10 @@ const char **parse_args(int argc, const char **argv, const char *prefix, const c
>  	/*
>  	 * Possible arguments are:
>  	 *
> -	 * git reset [-opts] <rev> <paths>...
> -	 * git reset [-opts] <rev> -- <paths>...
> -	 * git reset [-opts] -- <paths>...
> +	 * git reset [-opts] [<rev>]
> +	 * git reset [-opts] <tree> [<paths>...]
> +	 * git reset [-opts] <tree> -- [<paths>...]
> +	 * git reset [-opts] -- [<paths>...]
>  	 * git reset [-opts] <paths>...
>  	 *
>  	 * At this point, argv points immediately after [-opts].
> @@ -194,11 +195,13 @@ const char **parse_args(int argc, const char **argv, const char *prefix, const c
>  		}
>  		/*
>  		 * Otherwise, argv[0] could be either <rev> or <paths> and
> -		 * has to be unambiguous.
> +		 * has to be unambiguous. If there is a single argument, it
> +		 * can not be a tree
>  		 */
> -		else if (!get_sha1_committish(argv[0], unused)) {
> +		else if ((argc == 1 && !get_sha1_committish(argv[0], unused)) ||
> +			 (argc > 1 && !get_sha1_treeish(argv[0], unused))) {
>  			/*
> -			 * Ok, argv[0] looks like a rev; it should not
> +			 * Ok, argv[0] looks like a commit/tree; it should not
>  			 * be a filename.
>  			 */
>  			verify_non_filename(prefix, argv[0]);
> @@ -240,7 +243,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  	const char *rev;
>  	unsigned char sha1[20];
>  	const char **pathspec = NULL;
> -	struct commit *commit;
> +	struct commit *commit = NULL;
>  	const struct option options[] = {
>  		OPT__QUIET(&quiet, N_("be quiet, only report errors")),
>  		OPT_SET_INT(0, "mixed", &reset_type,
> @@ -262,19 +265,22 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  						PARSE_OPT_KEEP_DASHDASH);
>  	pathspec = parse_args(argc, argv, prefix, &rev);
>  
> -	if (get_sha1_committish(rev, sha1))
> -		die(_("Failed to resolve '%s' as a valid ref."), rev);
> -
> -	/*
> -	 * NOTE: As "git reset $treeish -- $path" should be usable on
> -	 * any tree-ish, this is not strictly correct. We are not
> -	 * moving the HEAD to any commit; we are merely resetting the
> -	 * entries in the index to that of a treeish.
> -	 */
> -	commit = lookup_commit_reference(sha1);
> -	if (!commit)
> -		die(_("Could not parse object '%s'."), rev);
> -	hashcpy(sha1, commit->object.sha1);
> +	if (!pathspec) {
> +		if (get_sha1_committish(rev, sha1))
> +			die(_("Failed to resolve '%s' as a valid revision."), rev);
> +		commit = lookup_commit_reference(sha1);
> +		if (!commit)
> +			die(_("Could not parse object '%s'."), rev);
> +		hashcpy(sha1, commit->object.sha1);
> +	} else {
> +		struct tree *tree;
> +		if (get_sha1_treeish(rev, sha1))
> +			die(_("Failed to resolve '%s' as a valid tree."), rev);
> +		tree = parse_tree_indirect(sha1);
> +		if (!tree)
> +			die(_("Could not parse object '%s'."), rev);
> +		hashcpy(sha1, tree->object.sha1);
> +	}
>  
>  	if (patch_mode) {
>  		if (reset_type != NONE)
> diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
> index 81b2570..1fa2a5f 100755
> --- a/t/t7102-reset.sh
> +++ b/t/t7102-reset.sh
> @@ -497,4 +497,12 @@ test_expect_success 'disambiguation (4)' '
>  	test ! -f secondfile
>  '
>  
> +test_expect_success 'reset with paths accepts tree' '
> +	# for simpler tests, drop last commit containing added files
> +	git reset --hard HEAD^ &&
> +	git reset HEAD^^{tree} -- . &&
> +	git diff --cached HEAD^ --exit-code &&
> +	git diff HEAD --exit-code
> +'
> +
>  test_done

^ permalink raw reply

* Re: [PATCH 19/19] reset [--mixed]: use diff-based reset whether or not pathspec was given
From: Junio C Hamano @ 2013-01-09 20:27 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-20-git-send-email-martinvonz@gmail.com>

Martin von Zweigbergk <martinvonz@gmail.com> writes:

> Thanks to b65982b (Optimize "diff-index --cached" using cache-tree,
> 2009-05-20), resetting with paths is much faster than resetting
> without paths. Some timings for the linux-2.6 repo to illustrate this
> (best of five, warm cache):
>
>         reset       reset .
> real    0m0.219s    0m0.080s
> user    0m0.140s    0m0.040s
> sys     0m0.070s    0m0.030s

Nice.

^ permalink raw reply

* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Junio C Hamano @ 2013-01-09 20:48 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Bart Trojanowski
In-Reply-To: <20130104124756.GA402@sigill.intra.peff.net>

Jeff King <peff@peff.net> writes:

> When git executes an alias that specifies an external
> command, it will complain if the alias dies due to a signal.
> This is usually a good thing, as signal deaths are
> unexpected. However, SIGPIPE is not unexpected for many
> commands which produce a lot of output; it is intended that
> the user closing the pager would kill them them via SIGPIPE.
>
> As a result, the user might see annoying messages in a
> scenario like this:
>
>   $ cat ~/.gitconfig
>   [alias]
>   lgbase = log --some-options
>   lg = !git lgbase --more-options
>   lg2 = !git lgbase --other-options
>
>   $ git lg -p
>   [user hits 'q' to exit pager]
>   error: git lgbase --more-options died of signal 13
>   fatal: While expanding alias 'lg': 'git lgbase --more-options': Success
>
> Many users won't see this, because we execute the external
> command with the shell, and a POSIX shell will silently
> rewrite the signal-death exit code into 128+signal, and we
> will treat it like a normal exit code. However, this does
> not always happen:

So... with the "flip the sign of the exit code when caught a signal"
patch applied to 'next', do people still see this issue?

^ permalink raw reply

* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Jeff King @ 2013-01-09 20:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Bart Trojanowski
In-Reply-To: <7vr4lu3wx7.fsf@alter.siamese.dyndns.org>

On Wed, Jan 09, 2013 at 12:48:20PM -0800, Junio C Hamano wrote:

> >   $ git lg -p
> >   [user hits 'q' to exit pager]
> >   error: git lgbase --more-options died of signal 13
> >   fatal: While expanding alias 'lg': 'git lgbase --more-options': Success
> >
> > Many users won't see this, because we execute the external
> > command with the shell, and a POSIX shell will silently
> > rewrite the signal-death exit code into 128+signal, and we
> > will treat it like a normal exit code. However, this does
> > not always happen:
> 
> So... with the "flip the sign of the exit code when caught a signal"
> patch applied to 'next', do people still see this issue?

They see half. The patch you've applied clears up the "While
expanding...: Success" message.

But we still say "error: ... died of signal 13", because that comes from
inside wait_or_whine. So it is a separate issue whether or not
wait_or_whine should be silent on SIGPIPE (we already are on SIGINT and
SIGQUIT, as of some recent patches).

The upside is that it is noise in this case that we would no longer see.
The downside is that we may be losing a clue when debugging server
problems, which do not expect to die from SIGPIPE.  Should it be an
optional run-command flag?

-Peff

^ permalink raw reply

* Re: git-completion.tcsh and git-completion.zsh are broken?
From: Manlio Perillo @ 2013-01-09 20:56 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: 'git@vger.kernel.org'
In-Reply-To: <E59706EF8DB1D147B15BECA3322E4BDC06B99D@eusaamb103.ericsson.se>

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

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

Il 09/01/2013 21:21, Marc Khouzam ha scritto:
> [...]
> 
> $zsh
> synapsis% source contrib/completion/git-completion.zsh
> (anon):6: command not found: ___main
> _git:11: command not found: _default
> 
> I have disabled compinit autoload (since, I don't know how, it is able
> to find the git completion script)
> 

The attached patch seems to fix it.
I'm still getting segmentation faults, but only when I try to complete
git rm contrib/<TAB> (in the git repository).

Sorry if this is a plain patch.
The code is simply copied from the one found in git-completion.bash.


I also noted that zsh on my system have preinstalled git completion
support (enabled with autoload).
The code is not the one available in the git source tree.
I don't know if the code is from Debian or zsh.

> 
> $tcsh
> synapsis:~/projects/git/contrib/git> source ~/.git-completion.tcsh
> synapsis:~/projects/git/contrib/git> git show HEAD:<TAB>
> 
> does not show the file list for the tree object in the HEAD
> 
>> Hm.  That doesn't work for me either.  I'll look into it.
>> It is not caused by your changes.
> 
> another problem is that a space is added after a directory name.
> 
>> The lastest version of git-completion.tcsh in the pu branch should
>> fix that problem.  It was committed yesterday so you may not have it.
> 

Ok, thanks.



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

iEYEARECAAYFAlDt2ZoACgkQscQJ24LbaUR/ggCfYNbRrM1HzHWYDwkejNP/hD9k
ShkAnjv3JapVXPlj59CakY4kwaE/4z5J
=qYP5
-----END PGP SIGNATURE-----

[-- Attachment #2: git-completion.zsh.patch --]
[-- Type: text/x-diff, Size: 320 bytes --]

diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 4577502..4aeda2a 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -75,4 +75,5 @@ _git ()
 	return _ret
 }
 
-_git
+autoload -U +X compinit && compinit
+compdef _git git gitk

^ permalink raw reply related

* What's cooking in git.git (Jan 2013, #04; Wed, 9)
From: Junio C Hamano @ 2013-01-09 21:04 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.

So far, about 60 topics, most of which have been cooking since the
previous cycle, have been graduated to the 'master' branch in
preparation for the next release, which tentatively is called 1.8.2.
Many of these early topics are bugfixes and expected to later land
in the 'maint' branch for 1.8.1.1 release as well.

As usual, this cycle is expected to last for 8 to 10 weeks, with a
preview -rc0 sometime in the middle of next month.

You can find the changes described here in the integration branches of the
repositories listed at

    http://git-blame.blogspot.com/p/git-public-repositories.html

--------------------------------------------------
[New Topics]

* nz/send-email-headers-are-case-insensitive (2013-01-06) 1 commit
 - git-send-email: treat field names as case-insensitively

 When user spells "cc:" in lowercase in the fake "header" in the
 trailer part, send-email failed to pick up the addresses from
 there. As e-mail headers field names are case insensitive, this
 script should follow suit and treat "cc:" and "Cc:" the same way.

 Will merge to 'next'.


* mk/complete-tcsh (2013-01-07) 1 commit
 - Prevent space after directories in tcsh completion

 Update tcsh command line completion so that an unwanted space is
 not added to a single directory name.

 Will merge to 'next'.


* dg/subtree-fixes (2013-01-08) 7 commits
 - contrib/subtree: mkdir the manual directory if needed
 - contrib/subtree: honor $(DESTDIR)
 - contrib/subtree: fix synopsis and command help
 - contrib/subtree: better error handling for "add"
 - contrib/subtree: add --unannotate option
 - contrib/subtree: use %B for split Subject/Body
 - t7900: remove test number comments

 contrib/subtree updates.

 Will merge to 'next'.


* ap/log-mailmap (2013-01-08) 11 commits
 - log --use-mailmap: optimize for cases without --author/--committer search
 - log: add log.mailmap configuration option
 - log: grep author/committer using mailmap
 - test: add test for --use-mailmap option
 - log: add --use-mailmap option
 - pretty: use mailmap to display username and email
 - mailmap: add mailmap structure to rev_info and pp
 - mailmap: simplify map_user() interface
 - mailmap: remove email copy and length limitation
 - Use split_ident_line to parse author and committer
 - string-list: allow case-insensitive string list

 Teach commands in the "log" family to optionally pay attention to
 the mailmap.

 Will merge to 'next'.


* nd/upload-pack-shallow-must-be-commit (2013-01-08) 1 commit
 - upload-pack: only accept commits from "shallow" line

 A minor consistency check patch that does not have much relevance
 to the real world.

 Will merge to 'next'.

--------------------------------------------------
[Graduated to "master"]

* ap/merge-stop-at-prepare-commit-msg-failure (2013-01-03) 1 commit
  (merged to 'next' on 2013-01-07 at 6790566)
 + merge: Honor prepare-commit-msg return code

 Originally merged to 'next' on 2013-01-04

 "git merge" started calling prepare-commit-msg hook like "git
 commit" does some time ago, but forgot to pay attention to the exit
 status of the hook.  t7505 may want a general clean-up but that is
 a different topic.


* as/test-name-alias-uniquely (2012-12-28) 1 commit
  (merged to 'next' on 2013-01-07 at 3b11c25)
 + Use longer alias names in subdirectory tests

 Originally merged to 'next' on 2013-01-02

 A few short-and-bland aliases used in the tests were interfering
 with git-custom command in user's $PATH.


* cc/no-gitk-build-dependency (2012-12-18) 3 commits
 + Makefile: replace "echo 1>..." with "echo >..."
 + Makefile: detect when PYTHON_PATH changes
 + Makefile: remove tracking of TCLTK_PATH

 Remove leftover bits from an earlier change to move gitk in its own
 subdirectory.  Reimplementing the dependency tracking rules needs
 to be done in gitk history separately.


* er/python-version-requirements (2012-12-28) 1 commit
  (merged to 'next' on 2013-01-07 at 4954e27)
 + Add checks to Python scripts for version dependencies.

 Originally merged to 'next' on 2013-01-02

 Some python scripts we ship cannot be run with old versions of the
 interpreter.


* er/stop-recommending-parsecvs (2012-12-28) 1 commit
  (merged to 'next' on 2013-01-07 at 689f28f)
 + Remove the suggestion to use parsecvs, which is currently broken.

 Originally merged to 'next' on 2013-01-02

 Stop recommending a defunct third-party software.


* fc/remote-bzr (2013-01-02) 9 commits
  (merged to 'next' on 2013-01-07 at f8c0b76)
 + remote-bzr: detect local repositories
 + remote-bzr: add support for older versions of bzr
 + remote-bzr: add support to push special modes
 + remote-bzr: add support for fecthing special modes
 + remote-bzr: add simple tests
 + remote-bzr: update working tree upon pushing
 + remote-bzr: add support for remote repositories
 + remote-bzr: add support for pushing
 + Add new remote-bzr transport helper

 Originally merged to 'next' on 2013-01-04

 New remote helper for bzr, with minimum fix squashed in.


* jc/apply-trailing-blank-removal (2012-10-12) 1 commit
 + apply.c:update_pre_post_images(): the preimage can be truncated

 Fix to update_pre_post_images() that did not take into account the
 possibility that whitespace fix could shrink the preimage and
 change the number of lines in it.


* jc/submittingpatches (2013-01-02) 4 commits
  (merged to 'next' on 2013-01-07 at 1cc3b8e)
 + SubmittingPatches: give list and maintainer addresses
 + SubmittingPatches: remove overlong checklist
 + SubmittingPatches: mention subsystems with dedicated repositories
 + SubmittingPatches: who am I and who cares?

 Originally merged to 'next' on 2013-01-04

 Streamline the document and update with a few e-mail addresses the
 patches should be sent to.


* jk/enable-test-lint-by-default (2013-01-03) 1 commit
  (merged to 'next' on 2013-01-07 at 2a77155)
 + tests: turn on test-lint by default

 Originally merged to 'next' on 2013-01-04

 We had two simple and quick tests to catch common mistakes when
 writing test scripts, but they weren't run by default when running
 tests.


* jk/maint-fast-import-doc-dedup-done (2013-01-07) 1 commit
  (merged to 'next' on 2013-01-07 at af6a054)
 + git-fast-import(1): remove duplicate '--done' option

 The "logical order" reorganization can come after that is done and
 can cook longer in 'next'.


* jk/pathspec-literal (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-07 at f0725cc)
 + t6130-pathspec-noglob: Windows does not allow a file named "f*"

 Finishing touches to unbreak a test on Windows.


* jn/less-reconfigure (2013-01-02) 1 commit
  (merged to 'next' on 2013-01-07 at 04c11cb)
 + build: do not automatically reconfigure unless configure.ac changed

 Originally merged to 'next' on 2013-01-02

 When autoconf is used, any build on a different commit always ran
 "config.status --recheck" even when unnecessary.


* jn/warn-on-inaccessible-loosen (2012-10-14) 4 commits
 + config: exit on error accessing any config file
 + doc: advertise GIT_CONFIG_NOSYSTEM
 + config: treat user and xdg config permission problems as errors
 + config, gitignore: failure to access with ENOTDIR is ok

 Deal with a situation where .config/git is a file and we notice
 .config/git/config is not readable due to ENOTDIR, not ENOENT.


* kb/maint-bundle-doc (2013-01-01) 2 commits
  (merged to 'next' on 2013-01-07 at 3d2b1ea)
 + Documentation: full-ness of a bundle is significant for cloning
 + Documentation: correct example restore from bundle

 Originally merged to 'next' on 2013-01-04

 Update an example in the "git bundle" documentation.


* mz/oneway-merge-wo-u-no-lstat (2012-12-20) 1 commit
 + oneway_merge(): only lstat() when told to update worktree

 Optimize "read-tree -m <tree-ish>" without "-u".


* nd/maint-branch-desc-doc (2013-01-03) 5 commits
  (merged to 'next' on 2013-01-07 at 5117679)
 + format-patch: pick up branch description when no ref is specified
 + format-patch: pick up correct branch name from symbolic ref
 + t4014: a few more tests on cover letter using branch description
 + branch: delete branch description if it's empty
 + config.txt: a few lines about branch.<name>.description

 Originally merged to 'next' on 2013-01-04

 Teach various forms of "format-patch" command line to identify what
 branch the patches are taken from, so that the branch description
 is picked up in more cases.


* os/gitweb-highlight-uncaptured (2013-01-01) 1 commit
  (merged to 'next' on 2013-01-07 at 5db0558)
 + gitweb: fix error in sanitize when highlight is enabled

 Originally merged to 'next' on 2013-01-04

 The code to sanitize control characters before passing it to
 "highlight" filter lost known-to-be-safe control characters by
 mistake.


* ta/remove-stale-translated-tut (2012-12-27) 1 commit
  (merged to 'next' on 2013-01-07 at 47b1056)
 + Remove Documentation/pt_BR/gittutorial.txt

 Originally merged to 'next' on 2013-01-02

 Remove a translation of a document that was left stale.


* tb/test-t9020-no-which (2013-01-01) 1 commit
  (merged to 'next' on 2013-01-07 at 9661948)
 + t9020: which is not portable

 Originally merged to 'next' on 2013-01-04

 Test portability update.


* tb/test-t9810-no-sed-i (2013-01-01) 1 commit
  (merged to 'next' on 2013-01-07 at cd82266)
 + t9810: Do not use sed -i

 Originally merged to 'next' on 2013-01-04

 Test portability update.

--------------------------------------------------
[Stalled]

* jl/submodule-deinit (2012-12-04) 1 commit
 - submodule: add 'deinit' command

 There was no Porcelain way to say "I no longer am interested in
 this submodule", once you express your interest in a submodule with
 "submodule init".  "submodule deinit" is the way to do so.

 Expecting a reroll.
 $gmane/212884


* jk/lua-hackery (2012-10-07) 6 commits
 - pretty: fix up one-off format_commit_message calls
 - Minimum compilation fixup
 - Makefile: make "lua" a bit more configurable
 - add a "lua" pretty format
 - add basic lua infrastructure
 - pretty: make some commit-parsing helpers more public

 Interesting exercise. When we do this for real, we probably would want
 to wrap a commit to make it more like an "object" with methods like
 "parents", etc.


* rc/maint-complete-git-p4 (2012-09-24) 1 commit
 - Teach git-completion about git p4

 Comment from Pete will need to be addressed ($gmane/206172).


* jc/maint-name-rev (2012-09-17) 7 commits
 - describe --contains: use "name-rev --algorithm=weight"
 - name-rev --algorithm=weight: tests and documentation
 - name-rev --algorithm=weight: cache the computed weight in notes
 - name-rev --algorithm=weight: trivial optimization
 - name-rev: --algorithm option
 - name_rev: clarify the logic to assign a new tip-name to a commit
 - name-rev: lose unnecessary typedef

 "git name-rev" names the given revision based on a ref that can be
 reached in the smallest number of steps from the rev, but that is
 not useful when the caller wants to know which tag is the oldest one
 that contains the rev.  This teaches a new mode to the command that
 uses the oldest ref among those which contain the rev.

 I am not sure if this is worth it; for one thing, even with the help
 from notes-cache, it seems to make the "describe --contains" even
 slower. Also the command will be unusably slow for a user who does
 not have a write access (hence unable to create or update the
 notes-cache).

 Stalled mostly due to lack of responses.


* jc/xprm-generation (2012-09-14) 1 commit
 - test-generation: compute generation numbers and clock skews

 A toy to analyze how bad the clock skews are in histories of real
 world projects.

 Stalled mostly due to lack of responses.


* jc/add-delete-default (2012-08-13) 1 commit
 - git add: notice removal of tracked paths by default

 "git add dir/" updated modified files and added new files, but does
 not notice removed files, which may be "Huh?" to some users.  They
 can of course use "git add -A dir/", but why should they?

 Resurrected from graveyard, as I thought it was a worthwhile thing
 to do in the longer term.

 Stalled mostly due to lack of responses.


* mb/remote-default-nn-origin (2012-07-11) 6 commits
 - Teach get_default_remote to respect remote.default.
 - Test that plain "git fetch" uses remote.default when on a detached HEAD.
 - Teach clone to set remote.default.
 - Teach "git remote" about remote.default.
 - Teach remote.c about the remote.default configuration setting.
 - Rename remote.c's default_remote_name static variables.

 When the user does not specify what remote to interact with, we
 often attempt to use 'origin'.  This can now be customized via a
 configuration variable.

 Expecting a reroll.
 $gmane/210151

 "The first remote becomes the default" bit is better done as a
 separate step.

--------------------------------------------------
[Cooking]

* jc/blame-no-follow (2012-09-21) 2 commits
 - blame: pay attention to --no-follow
 - diff: accept --no-follow option

 Teaches "--no-follow" option to "git blame" to disable its
 whole-file rename detection.

 Will merge to 'next'.


* as/dir-c-cleanup (2012-12-28) 10 commits
  (merged to 'next' on 2013-01-08 at 5aee090)
 + dir.c: rename free_excludes() to clear_exclude_list()
 + dir.c: refactor is_path_excluded()
 + dir.c: refactor is_excluded()
 + dir.c: refactor is_excluded_from_list()
 + dir.c: rename excluded() to is_excluded()
 + dir.c: rename excluded_from_list() to is_excluded_from_list()
 + dir.c: rename path_excluded() to is_path_excluded()
 + dir.c: rename cryptic 'which' variable to more consistent name
 + Improve documentation and comments regarding directory traversal API
 + api-directory-listing.txt: update to match code
 (this branch is used by as/check-ignore.)

 Refactor and generally clean up the directory traversal API
 implementation.

 Will merge to 'master'.


* jk/config-uname (2013-01-03) 1 commit
  (merged to 'next' on 2013-01-08 at f986500)
 + Makefile: hoist uname autodetection to config.mak.uname

 Move the bits to set fallback default based on the platform from
 the main Makefile to a separate file, so that it can be included in
 Makefiles in subdirectories.

 Will merge to 'master'.


* jc/push-2.0-default-to-simple (2013-01-08) 11 commits
  (merged to 'next' on 2013-01-09 at 74c3498)
 + doc: push.default is no longer "matching"
 + push: switch default from "matching" to "simple"
 + t9401: do not assume the "matching" push is the default
 + t9400: do not assume the "matching" push is the default
 + t7406: do not assume the "matching" push is the default
 + t5531: do not assume the "matching" push is the default
 + t5519: do not assume the "matching" push is the default
 + t5517: do not assume the "matching" push is the default
 + t5516: do not assume the "matching" push is the default
 + t5505: do not assume the "matching" push is the default
 + t5404: do not assume the "matching" push is the default

 Will cook in 'next' until Git 2.0 ;-).


* jk/unify-exit-code-by-receiving-signal (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-08 at 5ebf940)
 + run-command: encode signal death as a positive integer

 The internal logic had to deal with two representations of a death
 of a child process by a signal.

 Will merge to 'master'.


* jl/interrupt-clone-remove-separate-git-dir (2013-01-05) 1 commit
  (merged to 'next' on 2013-01-08 at 568f874)
 + clone: support atomic operation with --separate-git-dir

 When "git clone --separate-git-dir" is interrupted, we failed to
 remove the real location we created the repository.

 Will merge to 'master'.


* rs/leave-base-name-in-name-field-of-tar (2013-01-05) 1 commit
  (merged to 'next' on 2013-01-08 at 98f325e)
 + archive-tar: split long paths more carefully

 Improve compatibility with implementations of "tar" that do not
 like empty name field in header (with the additional prefix field
 holding everything).

 Will merge to 'master'.


* as/api-allocation-doc (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-08 at c80b544)
 + api-allocation-growing.txt: encourage better variable naming

 Will merge to 'master'.


* jc/comment-cygwin-win32api-in-makefile (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-08 at dea04e8)
 + Makefile: add comment on CYGWIN_V15_WIN32API

 Will merge to 'master'.


* jn/xml-depends-on-asciidoc-conf (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-08 at 4faf8d4)
 + docs: manpage XML depends on asciidoc.conf

 Will merge to 'master'.


* nd/clone-no-separate-git-dir-with-bare (2013-01-06) 1 commit
 - clone: forbid --bare --separate-git-dir <dir>

 Expecting a reroll.
 $gmane/212863


* nd/parse-pathspec (2013-01-06) 21 commits
 - Convert more init_pathspec() to parse_pathspec()
 - Convert add_files_to_cache to take struct pathspec
 - Convert {read,fill}_directory to take struct pathspec
 - Convert refresh_index to take struct pathspec
 - Convert report_path_error to take struct pathspec
 - checkout: convert read_tree_some to take struct pathspec
 - Convert unmerge_cache to take struct pathspec
 - Convert read_cache_preload() to take struct pathspec
 - add: convert to use parse_pathspec
 - archive: convert to use parse_pathspec
 - ls-files: convert to use parse_pathspec
 - rm: convert to use parse_pathspec
 - checkout: convert to use parse_pathspec
 - rerere: convert to use parse_pathspec
 - status: convert to use parse_pathspec
 - commit: convert to use parse_pathspec
 - clean: convert to use parse_pathspec
 - Export parse_pathspec() and convert some get_pathspec() calls
 - pathspec: make sure the prefix part is wildcard-clean
 - Add parse_pathspec() that converts cmdline args to struct pathspec
 - pathspec: save the non-wildcard length part

 Uses the parsed pathspec structure in more places where we used to
 use the raw "array of strings" pathspec.

 Unfortunately, this conflicts a couple of topics in flight. I tried
 to be careful while resolving conflicts, though.

 Expecting a reroll after the dust settles.


* rs/zip-tests (2013-01-07) 4 commits
  (merged to 'next' on 2013-01-08 at 8e37423)
 + t5003: check if unzip supports symlinks
 + t5000, t5003: move ZIP tests into their own script
 + t0024, t5000: use test_lazy_prereq for UNZIP
 + t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead

 Updates zip tests to skip some that cannot be handled on platform
 unzip.

 I've renamed the t5002 in the original to t5003 to avoid name
 clashes with another topic in flight.

 Will merge to 'master'.


* rs/zip-with-uncompressed-size-in-the-header (2013-01-06) 1 commit
  (merged to 'next' on 2013-01-08 at d9ec30e)
 + archive-zip: write uncompressed size into header even with streaming

 Improve compatibility of our zip output to fill uncompressed size
 in the header, which we can do without seeking back (even though it
 should not be necessary).

 Will merge to 'master'.


* tb/test-shell-lint (2013-01-02) 1 commit
  (merged to 'next' on 2013-01-07 at 0bca54a)
 + test: Add check-non-portable-shell.pl

 Originally merged to 'next' on 2013-01-04

 Check for common mistakes in the test scripts, based on simple
 pattern-matching.

 Will merge to 'master'.


* jc/doc-maintainer (2013-01-03) 2 commits
 - howto/maintain: mark titles for asciidoc
 - Documentation: update "howto maintain git"

 Describe tools for automation that were invented since this
 document was originally written.

 Will merge to 'next'.


* fc/remote-testgit-feature-done (2012-10-29) 1 commit
 - remote-testgit: properly check for errors

 In the longer term, tightening rules is a good thing to do, and
 because nobody who has worked in the remote helper area seems to be
 interested in reviewing this, I would assume they do not think
 such a retroactive tightening will affect their remote helpers.  So
 let's advance this topic to see what happens.

 Will merge to 'next'.


* mo/cvs-server-updates (2012-12-09) 18 commits
  (merged to 'next' on 2013-01-08 at 75e2d11)
 + t9402: Use TABs for indentation
 + t9402: Rename check.cvsCount and check.list
 + t9402: Simplify git ls-tree
 + t9402: Add missing &&; Code style
 + t9402: No space after IO-redirection
 + t9402: Dont use test_must_fail cvs
 + t9402: improve check_end_tree() and check_end_full_tree()
 + t9402: sed -i is not portable
 + cvsserver Documentation: new cvs ... -r support
 + cvsserver: add t9402 to test branch and tag refs
 + cvsserver: support -r and sticky tags for most operations
 + cvsserver: Add version awareness to argsfromdir
 + cvsserver: generalize getmeta() to recognize commit refs
 + cvsserver: implement req_Sticky and related utilities
 + cvsserver: add misc commit lookup, file meta data, and file listing functions
 + cvsserver: define a tag name character escape mechanism
 + cvsserver: cleanup extra slashes in filename arguments
 + cvsserver: factor out git-log parsing logic

 Various git-cvsserver updates.

 Will cook in 'next' for a while to see if anybody screams.


* aw/rebase-am-failure-detection (2012-10-11) 1 commit
  (merged to 'next' on 2013-01-07 at 9e2ee43)
 + rebase: Handle cases where format-patch fails

 Originally merged to 'next' on 2013-01-02

 Save output from format-patch command in a temporary file, just in
 case it aborts, to give a better failure-case behaviour.

 Will merge to 'master'.


* ap/status-ignored-in-ignored-directory (2013-01-07) 3 commits
 - status: always report ignored tracked directories
  (merged to 'next' on 2013-01-07 at 2a20b19)
 + git-status: Test --ignored behavior
 + dir.c: Make git-status --ignored more consistent

 Originally merged to 'next' on 2013-01-04

 Output from "git status --ignored" showed an unexpected interaction
 with "--untracked".

 Will merge to 'next'.


* jc/maint-fmt-merge-msg-no-edit-lose-credit (2012-12-28) 1 commit
  (merged to 'next' on 2013-01-07 at 497bf10)
 + merge --no-edit: do not credit people involved in the side branch

 Originally merged to 'next' on 2013-01-02

 Stop spending cycles to compute information to be placed on
 commented lines in "merge --no-edit".

 Will merge to 'master'.


* as/check-ignore (2013-01-06) 11 commits
 - add git-check-ignore sub-command
 - setup.c: document get_pathspec()
 - add.c: extract new die_if_path_beyond_symlink() for reuse
 - add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
 - pathspec.c: rename newly public functions for clarity
 - add.c: move pathspec matchers into new pathspec.c for reuse
 - add.c: remove unused argument from validate_pathspec()
 - dir.c: improve docs for match_pathspec() and match_pathspec_depth()
 - dir.c: provide clear_directory() for reclaiming dir_struct memory
 - dir.c: keep track of where patterns came from
 - dir.c: use a single struct exclude_list per source of excludes
 (this branch uses as/dir-c-cleanup.)

 The test it adds seems to break under dash.
 Expecting a reroll or fixup.


* jc/format-patch-reroll (2013-01-03) 9 commits
  (merged to 'next' on 2013-01-07 at 0e007e6)
 + format-patch: give --reroll-count a short synonym -v
 + format-patch: document and test --reroll-count
 + format-patch: add --reroll-count=$N option
 + get_patch_filename(): split into two functions
 + get_patch_filename(): drop "just-numbers" hack
 + get_patch_filename(): simplify function signature
 + builtin/log.c: stop using global patch_suffix
 + builtin/log.c: drop redundant "numbered_files" parameter from make_cover_letter()
 + builtin/log.c: drop unused "numbered" parameter from make_cover_letter()

 Originally merged to 'next' on 2013-01-04

 Teach "format-patch" to prefix v4- to its output files for the
 fourth iteration of a patch series, to make it easier for the
 submitter to keep separate copies for iterations.

 Will merge to 'master'.


* mz/pick-unborn (2012-12-23) 2 commits
  (merged to 'next' on 2013-01-07 at c6c062b)
 + learn to pick/revert into unborn branch
 + tests: move test_cmp_rev to test-lib-functions

 Originally merged to 'next' on 2013-01-02

 Allows "git cherry-pick $commit" when you do not have any history
 behind HEAD yet.

 Will merge to 'master'.


* nd/retire-fnmatch (2013-01-01) 7 commits
  (merged to 'next' on 2013-01-07 at ab31f9b)
 + Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
 + wildmatch: advance faster in <asterisk> + <literal> patterns
 + wildmatch: make a special case for "*/" with FNM_PATHNAME
 + test-wildmatch: add "perf" command to compare wildmatch and fnmatch
 + wildmatch: support "no FNM_PATHNAME" mode
 + wildmatch: make dowild() take arbitrary flags
 + wildmatch: rename constants and update prototype
 (this branch uses nd/wildmatch.)

 Originally merged to 'next' on 2013-01-04

 Replace our use of fnmatch(3) with a more feature-rich wildmatch.
 A handful patches at the bottom have been moved to nd/wildmatch to
 graduate as part of that branch, before this series solidifies.

 Will cook in 'next' a bit longer than other topics.


* jc/merge-blobs (2012-12-26) 5 commits
  (merged to 'next' on 2013-01-08 at 582ca38)
 + merge-tree: fix d/f conflicts
 + merge-tree: add comments to clarify what these functions are doing
 + merge-tree: lose unused "resolve_directories"
 + merge-tree: lose unused "flags" from merge_list
 + Which merge_file() function do you mean?

 Update the disused merge-tree proof-of-concept code.

 Will merge to 'master'.


* mb/gitweb-highlight-link-target (2012-12-20) 1 commit
 - Highlight the link target line in Gitweb using CSS

 Expecting a reroll.
 $gmane/211935


* zk/clean-report-failure (2013-01-06) 1 commit
 - git-clean: Display more accurate delete messages

 "git clean" states what it is going to remove and then goes on to
 remove it, but sometimes it only discovers things that cannot be
 removed after recursing into a directory, which makes the output
 confusing and even wrong.

 Expecting a response to $gmane/212860.


* mp/complete-paths (2012-12-21) 1 commit
 - git-completion.bash: add support for path completion

 The completion script used to let the default completer to suggest
 pathnames, which gave too many irrelevant choices (e.g. "git add"
 would not want to add an unmodified path).  Teach it to use a more
 git-aware logic to enumerate only relevant ones.

 It has been reported (no surprise) that this does not work inside
 subdirectory, and fixing it seems to be non-trivial. $gmane/212642

 Waiting for area-experts' help.


* bc/append-signed-off-by (2013-01-01) 12 commits
 - t4014: do not use echo -n
 - Unify appending signoff in format-patch, commit and sequencer
 - format-patch: update append_signoff prototype
 - format-patch: stricter S-o-b detection
 - t4014: more tests about appending s-o-b lines
 - sequencer.c: teach append_signoff to avoid adding a duplicate newline
 - sequencer.c: teach append_signoff how to detect duplicate s-o-b
 - sequencer.c: always separate "(cherry picked from" from commit body
 - sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
 - t/t3511: add some tests of 'cherry-pick -s' functionality
 - t/test-lib-functions.sh: allow to specify the tag name to test_commit
 - sequencer.c: remove broken support for rfc2822 continuation in footer

 Expecting a reroll.
 $gmane/212507


* nd/wildmatch (2013-01-01) 18 commits
  (merged to 'next' on 2013-01-07 at 2a39f7d)
 + wildmatch: replace variable 'special' with better named ones
 + compat/fnmatch: respect NO_FNMATCH* even on glibc
 + wildmatch: fix "**" special case
 + t3070: Disable some failing fnmatch tests
 + test-wildmatch: avoid Windows path mangling
 + Support "**" wildcard in .gitignore and .gitattributes
 + wildmatch: make /**/ match zero or more directories
 + wildmatch: adjust "**" behavior
 + wildmatch: fix case-insensitive matching
 + wildmatch: remove static variable force_lower_case
 + wildmatch: make wildmatch's return value compatible with fnmatch
 + t3070: disable unreliable fnmatch tests
 + Integrate wildmatch to git
 + wildmatch: follow Git's coding convention
 + wildmatch: remove unnecessary functions
 + Import wildmatch from rsync
 + ctype: support iscntrl, ispunct, isxdigit and isprint
 + ctype: make sane_ctype[] const array
 (this branch is used by nd/retire-fnmatch.)

 Originally merged to 'next' on 2013-01-01

 Allows pathname patterns in .gitignore and .gitattributes files
 with double-asterisks "foo/**/bar" to match any number of directory
 hierarchies.

 Will merge to 'master'.

^ permalink raw reply

* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-09 21:20 UTC (permalink / raw)
  To: Brian J. Murrell, git
In-Reply-To: <50EC453A.2060306@giref.ulaval.ca>

Hi Brian,

On 01/08/2013 11:11 AM, Eric Chamberland wrote:
> On 12/24/2012 10:11 AM, Brian J. Murrell wrote:
>> Have you tried adding a "-q" to the git command line to quiet down git's
>> "feedback" messages?
>>
>

I moved to git 1.8.1 and added the "-q" to the command "git gc" but it 
occured to return an error, so the "-q" option is not avoiding the 
problem here... :-/

command in crontab:

cd /rap/jsf-051-aa/ericc/tests_git_clones/GIREF && for i in seq 10; do 
/software/apps/git/1.8.1/bin/git gc -q || true;done

results:
error: index file 
.git/objects/pack/pack-1f09879c88cd71a15dcc891713cf038d249830ad.idx is 
too small
error: refs/remotes/origin/BIB_Branche_1_4_x does not point to a valid 
object!

and this clone was a "clean" clone in which only "git qc -q" has been 
run on....

I still have a doubt on threads....

Eric

^ permalink raw reply

* Re: On --depth=funny value
From: Stefan Beller @ 2013-01-09 21:38 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Duy Nguyen, Jonathan Nieder, schlotter, Ralf.Wildenhues, git
In-Reply-To: <7vy5g383sy.fsf_-_@alter.siamese.dyndns.org>

On 01/09/2013 03:53 AM, Junio C Hamano wrote:
> Can people sanity check the reasoning outlined here?  Anything I
> missed?
> 
> The above outline identifies three concrete tasks that different
> people can tackle more or less independently, each with updated
> code, documentation and test:
> 
>  1. "git fetch --unshallow" that gives a pretty surface on Duy's
>     "--depth=inf";
> 
>  2. Making "git fetch" and "git clone" die on "--depth=0" or
>     "--depth=-4";
> 
>  3 Updating "upload-pack" to count correctly.
> 
> I'll refrain from saying "Any takers?" for now.

Sorry for answering with delay, I am just contributing to git in my
spare time.
So if I understood Duy correctly, he is going to solve 1. and 3 by his
patches.
I'll try to come up with a solution for 2. within the next days.

^ permalink raw reply

* Re: [PATCH v2 1/2] git-fast-import(1): combine documentation of --[no-]relative-marks
From: Jonathan Nieder @ 2013-01-09 21:42 UTC (permalink / raw)
  To: John Keeping
  Cc: Junio C Hamano, Eric S. Raymond, git, David Michael Barr,
	Pete Wyckoff, Thomas Rast
In-Reply-To: <cf4a4a10c1de73491048e8283582bdbf8c79c75e.1357760256.git.john@keeping.me.uk>

John Keeping wrote:

> The descriptions of '--relative-marks' and '--no-relative-marks' make
> more sense when read together instead of as two independent options.
> Combine them into a single description block.

Yep, this is easier to read.  Thanks.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

^ permalink raw reply

* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Junio C Hamano @ 2013-01-09 21:49 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Bart Trojanowski
In-Reply-To: <20130109205116.GA24605@sigill.intra.peff.net>

Jeff King <peff@peff.net> writes:

> But we still say "error: ... died of signal 13", because that comes from
> inside wait_or_whine. So it is a separate issue whether or not
> wait_or_whine should be silent on SIGPIPE (we already are on SIGINT and
> SIGQUIT, as of some recent patches).
>
> The upside is that it is noise in this case that we would no longer see.
> The downside is that we may be losing a clue when debugging server
> problems, which do not expect to die from SIGPIPE.  Should it be an
> optional run-command flag?

Do we know if we are upstream of a pager that reads from us through
a pipe (I think we should, especially in a case where we are the one
who processed the "git -p $alias" option)?  Is there any other case
where we would want to ignore child's death by SIGPIPE?  If the
answers are yes and no, then perhaps we can ask pager_in_use() to
decide this?

^ permalink raw reply

* Re: [PATCH] git-shortlog(1): document behaviour of zero-width wrap
From: Junio C Hamano @ 2013-01-09 22:09 UTC (permalink / raw)
  To: John Keeping; +Cc: git
In-Reply-To: <20130109201645.GB4574@serenity.lan>

Thanks.

^ permalink raw reply

* Re: [PATCH v2 2/2] git-fast-import(1): reorganise options
From: Junio C Hamano @ 2013-01-09 22:21 UTC (permalink / raw)
  To: John Keeping
  Cc: Jonathan Nieder, Eric S. Raymond, git, David Michael Barr,
	Pete Wyckoff, Thomas Rast
In-Reply-To: <e228dd4522dbf7ebfe0e5207b1dcc9591faa4d15.1357760256.git.john@keeping.me.uk>

Thanks.

^ permalink raw reply

* [PATCH] t0008: avoid brace expansion
From: René Scharfe @ 2013-01-09 23:49 UTC (permalink / raw)
  To: Junio C Hamano, git discussion list; +Cc: Adam Spiers
In-Reply-To: <7vboczcq5a.fsf@alter.siamese.dyndns.org>

Brace expansion is not required by POSIX and not supported by dash nor
NetBSD's sh.  Explicitly list all combinations instead.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t0008-ignores.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 9b0fcd6..0273680 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -129,8 +129,9 @@ test_expect_success 'setup' '
 		one
 		ignored-*
 	EOF
-	touch {,a/}{not-ignored,ignored-{and-untracked,but-in-index}} &&
-	git add -f {,a/}ignored-but-in-index
+	touch not-ignored ignored-and-untracked ignored-but-in-index &&
+	touch a/not-ignored a/ignored-and-untracked a/ignored-but-in-index &&
+	git add -f ignored-but-in-index a/ignored-but-in-index &&
 	cat <<-\EOF >a/.gitignore &&
 		two*
 		*three
-- 
1.8.0

^ permalink raw reply related

* Re: [PATCH] t0008: avoid brace expansion
From: Adam Spiers @ 2013-01-09 23:56 UTC (permalink / raw)
  To: René Scharfe; +Cc: Junio C Hamano, git discussion list
In-Reply-To: <50EE01F8.1070109@lsrfire.ath.cx>

On Wed, Jan 9, 2013 at 11:49 PM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> Brace expansion is not required by POSIX and not supported by dash nor
> NetBSD's sh.  Explicitly list all combinations instead.

Good catch, thanks!

^ permalink raw reply

* Re: [PATCHv2] commit: make default of "cleanup" option configurable
From: Junio C Hamano @ 2013-01-10  0:17 UTC (permalink / raw)
  To: Ralf Thielow; +Cc: jrnieder, git
In-Reply-To: <1357760209-3407-1-git-send-email-ralf.thielow@gmail.com>

Ralf Thielow <ralf.thielow@gmail.com> writes:

> The default of the "cleanup" option in "git commit"
> is not configurable. Users who don't want to use the
> default have to pass this option on every commit since
> there's no way to configure it. This commit introduces
> a new config option "commit.cleanup" which can be used
> to change the default of the "cleanup" option in
> "git commit".
>
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---

Thanks.

> Changes in v2:
> - simplify implementation
> - mention configuration variable in documentation of "git commit --cleanup"
> - add an example usecase to documention of commit.cleanup configuration variable
> - add tests
>
>  Documentation/config.txt        |  7 ++++
>  Documentation/git-commit.txt    |  4 +-
>  builtin/commit.c                |  5 ++-
>  t/t7500/add-content-and-comment |  4 ++
>  t/t7502-commit.sh               | 84 +++++++++++++++++++++++++++++++++++++----
>  5 files changed, 95 insertions(+), 9 deletions(-)
>  create mode 100755 t/t7500/add-content-and-comment
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 53c4ca1..0452d56 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -917,6 +917,13 @@ column.tag::
>  	Specify whether to output tag listing in `git tag` in columns.
>  	See `column.ui` for details.
>  
> +commit.cleanup::
> +	This setting overrides the default of the `--cleanup` option in
> +	`git commit`. See linkgit:git-commit[1] for details. Changing the
> +	default can be useful if you want to use the comment character (#)
> +	consistently within your commit messages, in which case you would
> +	like to change the default to 'whitespace'.

When the documentation suggests to use 'whitespace', it would be
helpful to warn the readers that hints Git produces in '#'-commented
section need to be removed, if they are not ment to be kept (which
is 99.99% of the case).  Perhaps:

	This setting overrides the default of the `--cleanup` option
	in `git commit`. Changing the default can be useful when you
	always want to keep lines that begin with comment character
	`#` in your log message, in which case you would do `git
	config commit.cleanup whitespace` (note that you will have
	to remove the help lines that begin with '#' in the commit
	log template yourself, if you do this).

or something?

> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index 7bdb039..41b27da 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -179,7 +179,9 @@ OPTIONS
>  	only if the message is to be edited. Otherwise only whitespace
>  	removed. The 'verbatim' mode does not change message at all,
>  	'whitespace' removes just leading/trailing whitespace lines
> -	and 'strip' removes both whitespace and commentary.
> +	and 'strip' removes both whitespace and commentary. The default
> +	can be changed by the 'commit.cleanup' configuration variable
> +	(see linkgit:git-config[1]).

Nicely written.

> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -103,7 +103,7 @@ static enum {
>  	CLEANUP_NONE,
>  	CLEANUP_ALL
>  } cleanup_mode;
> -static char *cleanup_arg;
> +static const char *cleanup_arg;
>  
>  static enum commit_whence whence;
>  static int use_editor = 1, include_status = 1;
> @@ -966,6 +966,7 @@ static const char *read_commit_message(const char *name)
>  	return out;
>  }
>  
> +
>  static int parse_and_validate_options(int argc, const char *argv[],
>  				      const struct option *options,
>  				      const char * const usage[],

Don't add an extra blank line, please.

> @@ -1320,6 +1321,8 @@ static int git_commit_config(const char *k, const char *v, void *cb)
>  		include_status = git_config_bool(k, v);
>  		return 0;
>  	}
> +	if (!strcmp(k, "commit.cleanup"))
> +		return git_config_string(&cleanup_arg, k, v);

Nice.

> diff --git a/t/t7500/add-content-and-comment b/t/t7500/add-content-and-comment
> new file mode 100755
> index 0000000..988f5e9
> --- /dev/null
> +++ b/t/t7500/add-content-and-comment
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +echo "commit message" >> "$1"
> +echo "# comment" >> "$1"
> +exit 0
> \ No newline at end of file

Have newline at end of file, please.

> diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
> index 1a5cb69..b1c7648 100755
> --- a/t/t7502-commit.sh
> +++ b/t/t7502-commit.sh
> @@ -4,6 +4,15 @@ test_description='git commit porcelain-ish'
> +...
> +'
> +

Nicely done.

Thanks.

^ permalink raw reply

* Re: [PATCH] t0008: avoid brace expansion
From: Junio C Hamano @ 2013-01-10  0:18 UTC (permalink / raw)
  To: Adam Spiers; +Cc: René Scharfe, git discussion list
In-Reply-To: <CAOkDyE_EuuV04KxkkLuHMV+VbDWsDMN1q3YShLtKaimaXH40Sg@mail.gmail.com>

Adam Spiers <git@adamspiers.org> writes:

> On Wed, Jan 9, 2013 at 11:49 PM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> Brace expansion is not required by POSIX and not supported by dash nor
>> NetBSD's sh.  Explicitly list all combinations instead.
>
> Good catch, thanks!

Yeah; thanks.

It would also be nice to avoid touch while we are at it, by the way.

^ permalink raw reply

* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Jonathan Nieder @ 2013-01-10  0:18 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git, Bart Trojanowski
In-Reply-To: <7vehhu3u2y.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:

>> But we still say "error: ... died of signal 13", because that comes from
>> inside wait_or_whine. So it is a separate issue whether or not
>> wait_or_whine should be silent on SIGPIPE (we already are on SIGINT and
>> SIGQUIT, as of some recent patches).
>>
>> The upside is that it is noise in this case that we would no longer see.
>> The downside is that we may be losing a clue when debugging server
>> problems, which do not expect to die from SIGPIPE.  Should it be an
>> optional run-command flag?
>
> Do we know if we are upstream of a pager that reads from us through
> a pipe (I think we should, especially in a case where we are the one
> who processed the "git -p $alias" option)?  Is there any other case
> where we would want to ignore child's death by SIGPIPE?

When we die early by SIGPIPE because output was piped to "head", I
still think the early end of output is not notable enough to complain
about.

I'm not sure whether there are SIGPIPE instances we really don't want
to be silent about, though.  I suspect not. ;-)

Compare <http://thread.gmane.org/gmane.comp.version-control.git/2062>,
<http://thread.gmane.org/gmane.comp.version-control.git/48469/focus=48665>.

Thanks,
Jonathan

^ permalink raw reply

* Re: [PATCH] t0008: avoid brace expansion
From: Adam Spiers @ 2013-01-10  0:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: René Scharfe, git discussion list
In-Reply-To: <7vsj693n6o.fsf@alter.siamese.dyndns.org>

On Thu, Jan 10, 2013 at 12:18 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Adam Spiers <git@adamspiers.org> writes:
>
>> On Wed, Jan 9, 2013 at 11:49 PM, René Scharfe
>> <rene.scharfe@lsrfire.ath.cx> wrote:
>>> Brace expansion is not required by POSIX and not supported by dash nor
>>> NetBSD's sh.  Explicitly list all combinations instead.
>>
>> Good catch, thanks!
>
> Yeah; thanks.
>
> It would also be nice to avoid touch while we are at it, by the way.

Noted.

^ permalink raw reply

* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Junio C Hamano @ 2013-01-10  0:39 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Jeff King, git, Bart Trojanowski
In-Reply-To: <20130110001844.GC21054@google.com>

Jonathan Nieder <jrnieder@gmail.com> writes:

> I'm not sure whether there are SIGPIPE instances we really don't want
> to be silent about, though.  I suspect not. ;-)
>
> Compare <http://thread.gmane.org/gmane.comp.version-control.git/2062>,
> <http://thread.gmane.org/gmane.comp.version-control.git/48469/focus=48665>.

Yeah, thanks for the pointer to 48665.  Quoting from there:

    So EPIPE really _is_ special: because when you write to a pipe,
    there's no guarantee that you'll get it at all, so whenever you get
    an EPIPE you should ask yourself:

     - what would I have done if the data had fit in the 64kB kernel
       buffer?

     - should I really return a different error message or complain just 
       because I just happened to notice that the reader went away
       _this_ 
       time, even if I might not notice it next time?

    In other words, the "exit(0)" is actually _more_ consistent than
    "exit(1)", because exiting with an error message or with an error
    return is going to depend on luck and timing.

and I think I still agree with the analysis and conclusion:

    So what _should_ you do for EPIPE?

    Here's what EPIPE _really_ means:

     - you might as well consider the write a success, but the
       reader isn't actually interested, so rather than go on, you
       might as well stop early.

    Notice how I very carefull avoided the word "error" anywhere.
    Because it's really not an error. The reader already got
    everything it wanted. So EPIPE should generally be seen as an
    "early success" rather than as a "failure".

^ permalink raw reply

* Re: [PATCH v4] git-clean: Display more accurate delete messages
From: Zoltan Klinger @ 2013-01-10  1:01 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Soren Brinkmann, Jens Lehmann, Peter Collingbourne
In-Reply-To: <20130106234022.GB3823@elie.Belkin>

> I wonder whether it's possible to make the output more consistent,
> as in:
>
>     Removing tracked_dir/some_untracked_file
>     Removing untracked_file
>     Skipping repository untracked_foo/frotz.git
>     Removing untracked_foo/bar
>     Removing untracked_foo/emptydir
>     Skipping repository untracked_some.git
>
> or similar.  What do you think?

Agree, the output looks much neater printed like that. I am going to
update the patch unless someone feels strongly against the proposed
output.

^ permalink raw reply

* Re: [PATCH v4] git-clean: Display more accurate delete messages
From: Junio C Hamano @ 2013-01-10  2:56 UTC (permalink / raw)
  To: Zoltan Klinger; +Cc: git
In-Reply-To: <1357514219-16102-1-git-send-email-zoltan.klinger@gmail.com>

Zoltan Klinger <zoltan.klinger@gmail.com> writes:

> Consider the output of the improved version:
>
>   $ git clean -fd
>   Removing tracked_dir/some_untracked_file
>   Removing untracked_file
>   warning: ignoring untracked git repository untracked_foo/frotz.git
>   Removing untracked_foo/bar
>   Removing untracked_foo/emptydir
>   warning: ignoring untracked git repository untracked_some.git/
>
> Now it displays only the file and directory names that got actually
> deleted and shows warnings about ignored untracked git repositories.
>
> Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
>
> Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
> ---

I think the code before this patch used to say "Would not remove"
and "Not removing" in certain cases to report the paths that the
command decided not to remove, but after this patch these two
messages no longer appear in the patch.

Is it expected, are we losing information, or...?

>  builtin/clean.c |  158 +++++++++++++++++++++++++++++++++++++++++++++----------
>  1 file changed, 129 insertions(+), 29 deletions(-)
>
> diff --git a/builtin/clean.c b/builtin/clean.c
> index 69c1cda..1714546 100644
> --- a/builtin/clean.c
> +++ b/builtin/clean.c
> @@ -10,6 +10,7 @@
>  #include "cache.h"
>  #include "dir.h"
>  #include "parse-options.h"
> +#include "refs.h"
>  #include "string-list.h"
>  #include "quote.h"
>  
> @@ -20,6 +21,12 @@ static const char *const builtin_clean_usage[] = {
>  	NULL
>  };
>  
> +static const char *msg_remove = N_("Removing %s\n");
> +static const char *msg_would_remove = N_("Would remove %s\n");
> +static const char *msg_would_ignore_git_dir = N_("Would ignore untracked git repository %s\n");
> +static const char *msg_warn_ignore_git_dir = N_("ignoring untracked git repository %s");
> +static const char *msg_warn_remove_failed = N_("failed to remove %s");
> +
>  static int git_clean_config(const char *var, const char *value, void *cb)
>  {
>  	if (!strcmp(var, "clean.requireforce"))
> @@ -34,11 +41,116 @@ static int exclude_cb(const struct option *opt, const char *arg, int unset)
>  	return 0;
>  }
>  
> +static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
> +		int dry_run, int quiet, int *dir_gone)
> +{
> +	DIR *dir;
> +	struct strbuf quoted = STRBUF_INIT;
> +	struct dirent *e;
> +	int res = 0, ret = 0, gone = 1, original_len = path->len, len, i;
> +	unsigned char submodule_head[20];
> +	struct string_list dels = STRING_LIST_INIT_DUP;
> +
> +	*dir_gone = 1;
> +
> +	if ((force_flag & REMOVE_DIR_KEEP_NESTED_GIT) &&
> +	    !resolve_gitlink_ref(path->buf, "HEAD", submodule_head)) {
> +		if (dry_run && !quiet) {
> +			quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +			printf(_(msg_would_ignore_git_dir), quoted.buf);
> +		} else if (!dry_run) {
> +			quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +			warning(_(msg_warn_ignore_git_dir), quoted.buf);
> +		}
> +
> +		*dir_gone = 0;
> +		return 0;
> +	}
> +
> +	dir = opendir(path->buf);
> +	if (!dir) {
> +		/* an empty dir could be removed even if it is unreadble */
> +		res = dry_run ? 0 : rmdir(path->buf);
> +		if (res) {
> +			quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +			warning(_(msg_warn_remove_failed), quoted.buf);
> +			*dir_gone = 0;
> +		}
> +		return res;
> +	}
> +
> +	if (path->buf[original_len - 1] != '/')
> +		strbuf_addch(path, '/');
> +
> +	len = path->len;
> +	while ((e = readdir(dir)) != NULL) {
> +		struct stat st;
> +		if (is_dot_or_dotdot(e->d_name))
> +			continue;
> +
> +		strbuf_setlen(path, len);
> +		strbuf_addstr(path, e->d_name);
> +		if (lstat(path->buf, &st))
> +			; /* fall thru */
> +		else if (S_ISDIR(st.st_mode)) {
> +			if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
> +				ret = 1;
> +			if (gone) {
> +				quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +				string_list_append(&dels, quoted.buf);
> +			}
> +			else
> +				*dir_gone = 0;
> +			continue;
> +		} else {
> +			res = dry_run ? 0 : unlink(path->buf);
> +			if (!res) {
> +				quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +				string_list_append(&dels, quoted.buf);
> +			}
> +			else {
> +				quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +				warning(_(msg_warn_remove_failed), quoted.buf);
> +				*dir_gone = 0;
> +				ret = 1;
> +			}
> +			continue;
> +		}
> +
> +		/* path too long, stat fails, or non-directory still exists */
> +		*dir_gone = 0;
> +		ret = 1;
> +		break;
> +	}
> +	closedir(dir);
> +
> +	strbuf_setlen(path, original_len);
> +
> +	if (*dir_gone) {
> +		res = dry_run ? 0 : rmdir(path->buf);
> +		if (!res)
> +			*dir_gone = 1;
> +		else {
> +			quote_path_relative(path->buf, strlen(path->buf), &quoted, prefix);
> +			warning(_(msg_warn_remove_failed), quoted.buf);
> +			*dir_gone = 0;
> +			ret = 1;
> +		}
> +	}
> +
> +	if (!*dir_gone && !quiet) {
> +		for (i = 0; i < dels.nr; i++)
> +			printf(dry_run ?  _(msg_would_remove) : _(msg_remove), dels.items[i].string);
> +	}
> +	string_list_clear(&dels, 0);
> +	return ret;
> +}
> +
>  int cmd_clean(int argc, const char **argv, const char *prefix)
>  {
> -	int i;
> -	int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0;
> -	int ignored_only = 0, config_set = 0, errors = 0;
> +	int i, res;
> +	int dry_run = 0, remove_directories = 0, quiet = 0, ignored = 0;
> +	int ignored_only = 0, config_set = 0, errors = 0, gone = 1;
>  	int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT;
>  	struct strbuf directory = STRBUF_INIT;
>  	struct dir_struct dir;
> @@ -49,7 +161,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  	char *seen = NULL;
>  	struct option options[] = {
>  		OPT__QUIET(&quiet, N_("do not print names of files removed")),
> -		OPT__DRY_RUN(&show_only, N_("dry run")),
> +		OPT__DRY_RUN(&dry_run, N_("dry run")),
>  		OPT__FORCE(&force, N_("force")),
>  		OPT_BOOLEAN('d', NULL, &remove_directories,
>  				N_("remove whole directories")),
> @@ -77,7 +189,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  	if (ignored && ignored_only)
>  		die(_("-x and -X cannot be used together"));
>  
> -	if (!show_only && !force) {
> +	if (!dry_run && !force) {
>  		if (config_set)
>  			die(_("clean.requireForce set to true and neither -n nor -f given; "
>  				  "refusing to clean"));
> @@ -149,38 +261,26 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  
>  		if (S_ISDIR(st.st_mode)) {
>  			strbuf_addstr(&directory, ent->name);
> -			qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
> -			if (show_only && (remove_directories ||
> -			    (matches == MATCHED_EXACTLY))) {
> -				printf(_("Would remove %s\n"), qname);
> -			} else if (remove_directories ||
> -				   (matches == MATCHED_EXACTLY)) {
> -				if (!quiet)
> -					printf(_("Removing %s\n"), qname);
> -				if (remove_dir_recursively(&directory,
> -							   rm_flags) != 0) {
> -					warning(_("failed to remove %s"), qname);
> +			if (remove_directories || (matches == MATCHED_EXACTLY)) {
> +				if (remove_dirs(&directory, prefix, rm_flags, dry_run, quiet, &gone))
>  					errors++;
> +				if (gone && !quiet) {
> +					qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
> +					printf(dry_run ? _(msg_would_remove) : _(msg_remove), qname);
>  				}
> -			} else if (show_only) {
> -				printf(_("Would not remove %s\n"), qname);
> -			} else {
> -				printf(_("Not removing %s\n"), qname);
>  			}
>  			strbuf_reset(&directory);
>  		} else {
>  			if (pathspec && !matches)
>  				continue;
> -			qname = quote_path_relative(ent->name, -1, &buf, prefix);
> -			if (show_only) {
> -				printf(_("Would remove %s\n"), qname);
> -				continue;
> -			} else if (!quiet) {
> -				printf(_("Removing %s\n"), qname);
> -			}
> -			if (unlink(ent->name) != 0) {
> -				warning(_("failed to remove %s"), qname);
> +			res = dry_run ? 0 : unlink(ent->name);
> +			if (res) {
> +				qname = quote_path_relative(ent->name, -1, &buf, prefix);
> +				warning(_(msg_warn_remove_failed), qname);
>  				errors++;
> +			} else if (!quiet) {
> +				qname = quote_path_relative(ent->name, -1, &buf, prefix);
> +				printf(dry_run ? _(msg_would_remove) : _(msg_remove), qname);
>  			}
>  		}
>  	}

^ 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