Git development
 help / color / mirror / Atom feed
* git-completion.tcsh and git-completion.zsh are broken?
From: Manlio Perillo @ 2013-01-09 19:17 UTC (permalink / raw)
  To: git@vger.kernel.org

-----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

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


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-----

^ permalink raw reply

* Re: [PATCH 03/19] reset.c: pass pathspec around instead of (prefix, argv) pair
From: Junio C Hamano @ 2013-01-09 19:26 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git, Nguyễn Thái Ngọc Duy
In-Reply-To: <1357719376-16406-4-git-send-email-martinvonz@gmail.com>

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

> We use the path arguments in two places in reset.c: in
> interactive_reset() and read_from_tree(). Both of these call
> get_pathspec(), so we pass the (prefix, arv) pair to both
> functions. Move the call to get_pathspec() out of these methods, for
> two reasons: 1) One argument is simpler than two. 2) It lets us use
> the (arguably clearer) "if (pathspec)" in place of "if (i < argc)".
> ---
> If I understand correctly, this should be rebased on top of
> nd/parse-pathspec. Please let me know.

Yeah, this will conflict with the get_pathspec-to-parse_pathspec
conversion Duy has been working on.

Without the interactions with that topic, the conversion seems
straightforward to me, though.

>
>  builtin/reset.c | 27 ++++++++++-----------------
>  1 file changed, 10 insertions(+), 17 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 65413d0..045c960 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -153,26 +153,15 @@ static void update_index_from_diff(struct diff_queue_struct *q,
>  	}
>  }
>  
> -static int interactive_reset(const char *revision, const char **argv,
> -			     const char *prefix)
> -{
> -	const char **pathspec = NULL;
> -
> -	if (*argv)
> -		pathspec = get_pathspec(prefix, argv);
> -
> -	return run_add_interactive(revision, "--patch=reset", pathspec);
> -}
> -
> -static int read_from_tree(const char *prefix, const char **argv,
> -		unsigned char *tree_sha1, int refresh_flags)
> +static int read_from_tree(const char **pathspec, unsigned char *tree_sha1,
> +			  int refresh_flags)
>  {
>  	struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
>  	int index_fd;
>  	struct diff_options opt;
>  
>  	memset(&opt, 0, sizeof(opt));
> -	diff_tree_setup_paths(get_pathspec(prefix, (const char **)argv), &opt);
> +	diff_tree_setup_paths(pathspec, &opt);
>  	opt.output_format = DIFF_FORMAT_CALLBACK;
>  	opt.format_callback = update_index_from_diff;
>  
> @@ -216,6 +205,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  	const char *rev = "HEAD";
>  	unsigned char sha1[20], *orig = NULL, sha1_orig[20],
>  				*old_orig = NULL, sha1_old_orig[20];
> +	const char **pathspec = NULL;
>  	struct commit *commit;
>  	struct strbuf msg = STRBUF_INIT;
>  	const struct option options[] = {
> @@ -287,22 +277,25 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  		die(_("Could not parse object '%s'."), rev);
>  	hashcpy(sha1, commit->object.sha1);
>  
> +	if (i < argc)
> +		pathspec = get_pathspec(prefix, argv + i);
> +
>  	if (patch_mode) {
>  		if (reset_type != NONE)
>  			die(_("--patch is incompatible with --{hard,mixed,soft}"));
> -		return interactive_reset(rev, argv + i, prefix);
> +		return run_add_interactive(rev, "--patch=reset", pathspec);
>  	}
>  
>  	/* git reset tree [--] paths... can be used to
>  	 * load chosen paths from the tree into the index without
>  	 * affecting the working tree nor HEAD. */
> -	if (i < argc) {
> +	if (pathspec) {
>  		if (reset_type == MIXED)
>  			warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
>  		else if (reset_type != NONE)
>  			die(_("Cannot do %s reset with paths."),
>  					_(reset_type_names[reset_type]));
> -		return read_from_tree(prefix, argv + i, sha1,
> +		return read_from_tree(pathspec, sha1,
>  				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
>  	}
>  	if (reset_type == NONE)

^ permalink raw reply

* Re: [PATCH 04/19] reset: don't allow "git reset -- $pathspec" in bare repo
From: Junio C Hamano @ 2013-01-09 19:32 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-5-git-send-email-martinvonz@gmail.com>

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

> ---
>  builtin/reset.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

With the patch that does not have any explicit check for bareness
nor new error message to scold user with, it is rather hard to tell
what is going on, without any description on what (if anything) is
broken at the end user level and what remedy is done about that
breakage...

>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 045c960..664fad9 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -295,8 +295,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  		else if (reset_type != NONE)
>  			die(_("Cannot do %s reset with paths."),
>  					_(reset_type_names[reset_type]));
> -		return read_from_tree(pathspec, sha1,
> -				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
>  	}
>  	if (reset_type == NONE)
>  		reset_type = MIXED; /* by default */
> @@ -308,6 +306,10 @@ 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)
> +		return read_from_tree(pathspec, sha1,
> +				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
> +
>  	/* 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. */

^ permalink raw reply

* [PATCHv2] commit: make default of "cleanup" option configurable
From: Ralf Thielow @ 2013-01-09 19:36 UTC (permalink / raw)
  To: gitster, jrnieder; +Cc: git, Ralf Thielow
In-Reply-To: <1357676176-30019-1-git-send-email-ralf.thielow@gmail.com>

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>
---

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'.
+
 commit.status::
 	A boolean to enable/disable inclusion of status information in the
 	commit message template when using an editor to prepare the commit
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]).
 
 -e::
 --edit::
diff --git a/builtin/commit.c b/builtin/commit.c
index d6dd3df..4d55f8f 100644
--- 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[],
@@ -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);
 
 	status = git_gpg_config(k, v, NULL);
 	if (status)
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
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'
 
 . ./test-lib.sh
 
+commit_msg_is () {
+	expect=commit_msg_is.expect
+	actual=commit_msg_is.actual
+
+	printf "%s" "$(git log --pretty=format:%s%b -1)" >$actual &&
+	printf "%s" "$1" >$expect &&
+	test_i18ncmp $expect $actual
+}
+
 # Arguments: [<prefix] [<commit message>] [<commit options>]
 check_summary_oneline() {
 	test_tick &&
@@ -168,7 +177,7 @@ test_expect_success 'verbose respects diff config' '
 	git config --unset color.diff
 '
 
-test_expect_success 'cleanup commit messages (verbatim,-t)' '
+test_expect_success 'cleanup commit messages (verbatim option,-t)' '
 
 	echo >>negative &&
 	{ echo;echo "# text";echo; } >expect &&
@@ -178,7 +187,7 @@ test_expect_success 'cleanup commit messages (verbatim,-t)' '
 
 '
 
-test_expect_success 'cleanup commit messages (verbatim,-F)' '
+test_expect_success 'cleanup commit messages (verbatim option,-F)' '
 
 	echo >>negative &&
 	git commit --cleanup=verbatim -F expect -a &&
@@ -187,7 +196,7 @@ test_expect_success 'cleanup commit messages (verbatim,-F)' '
 
 '
 
-test_expect_success 'cleanup commit messages (verbatim,-m)' '
+test_expect_success 'cleanup commit messages (verbatim option,-m)' '
 
 	echo >>negative &&
 	git commit --cleanup=verbatim -m "$(cat expect)" -a &&
@@ -196,7 +205,7 @@ test_expect_success 'cleanup commit messages (verbatim,-m)' '
 
 '
 
-test_expect_success 'cleanup commit messages (whitespace,-F)' '
+test_expect_success 'cleanup commit messages (whitespace option,-F)' '
 
 	echo >>negative &&
 	{ echo;echo "# text";echo; } >text &&
@@ -207,7 +216,7 @@ test_expect_success 'cleanup commit messages (whitespace,-F)' '
 
 '
 
-test_expect_success 'cleanup commit messages (strip,-F)' '
+test_expect_success 'cleanup commit messages (strip option,-F)' '
 
 	echo >>negative &&
 	{ echo;echo "# text";echo sample;echo; } >text &&
@@ -218,7 +227,7 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
 
 '
 
-test_expect_success 'cleanup commit messages (strip,-F,-e)' '
+test_expect_success 'cleanup commit messages (strip option,-F,-e)' '
 
 	echo >>negative &&
 	{ echo;echo sample;echo; } >text &&
@@ -231,10 +240,71 @@ echo "sample
 # Please enter the commit message for your changes. Lines starting
 # with '#' will be ignored, and an empty message aborts the commit." >expect
 
-test_expect_success 'cleanup commit messages (strip,-F,-e): output' '
+test_expect_success 'cleanup commit messages (strip option,-F,-e): output' '
 	test_i18ncmp expect actual
 '
 
+test_expect_success 'cleanup commit message (fail on invalid cleanup mode option)' '
+	test_must_fail git commit --cleanup=non-existent
+'
+
+test_expect_success 'cleanup commit message (fail on invalid cleanup mode configuration)' '
+	test_must_fail git -c commit.cleanup=non-existent commit
+'
+
+test_expect_success 'cleanup commit message (no config and no option uses default)' '
+	echo content >>file &&
+	git add file &&
+	test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
+	git commit --no-status &&
+	commit_msg_is "commit message"
+'
+
+test_expect_success 'cleanup commit message (option overrides default)' '
+	echo content >>file &&
+	git add file &&
+	test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
+	git commit --cleanup=whitespace --no-status &&
+	commit_msg_is "commit message # comment"
+'
+
+test_expect_success 'cleanup commit message (config overrides default)' '
+	echo content >>file &&
+	git add file &&
+	test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
+	git -c commit.cleanup=whitespace commit --no-status &&
+	commit_msg_is "commit message # comment"
+'
+
+test_expect_success 'cleanup commit message (option overrides config)' '
+	echo content >>file &&
+	git add file &&
+	test_set_editor "$TEST_DIRECTORY"/t7500/add-content-and-comment &&
+	git -c commit.cleanup=whitespace commit --cleanup=default &&
+	commit_msg_is "commit message"
+'
+
+test_expect_success 'cleanup commit message (default, -m)' '
+	echo content >>file &&
+	git add file &&
+	git commit -m "message #comment " &&
+	commit_msg_is "message #comment"
+'
+
+test_expect_success 'cleanup commit message (whitespace option, -m)' '
+	echo content >>file &&
+	git add file &&
+	git commit --cleanup=whitespace --no-status -m "message #comment " &&
+	commit_msg_is "message #comment"
+'
+
+test_expect_success 'cleanup commit message (whitespace config, -m)' '
+	echo content >>file &&
+	git add file &&
+	git -c commit.cleanup=whitespace commit --no-status -m "message #comment " &&
+	commit_msg_is "message #comment"
+'
+
 test_expect_success 'message shows author when it is not equal to committer' '
 	echo >>negative &&
 	git commit -e -m "sample" -a &&
-- 
1.8.1.165.g0eb732d.dirty

^ permalink raw reply related

* Re: [PATCH 16/19] reset [--mixed] --quiet: don't refresh index
From: Martin von Zweigbergk @ 2013-01-09 19:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7v7gnm6uhm.fsf@alter.siamese.dyndns.org>

On Wed, Jan 9, 2013 at 11:12 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Martin von Zweigbergk <martinvonz@gmail.com> writes:
>
> And as a Porcelain, I would rather expect it to leave the resulting
> index refreshed.

Yeah, I guess you're right. Regular users (those using only porcelain)
shouldn't notice, but it does make sense to think that the index would
be refreshed after running a porcelain. And the risk of breaking
people's scripts seems real too. I'll drop patch this from the re-roll
(which I'll also make sure I'll sign off)

(FYI, the reason I wrote this patch was because I was surprised that
"git reset" did anything with the worktree at all.)

^ permalink raw reply

* Re: [PATCH 06/19] reset.c: remove unnecessary variable 'i'
From: Junio C Hamano @ 2013-01-09 19:39 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-7-git-send-email-martinvonz@gmail.com>

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

> Throughout most of parse_args(), the variable 'i' remains at 0. In the
> remaining few cases, we can do pointer arithmentic on argv itself
> instead.
> ---
> This is clearly mostly a matter of taste. The remainder of the series
> does not depend on it in any way.

I agree that it indeed is a matter of taste between

 (1) look at av[i], check with (i < ac) for the end, and increment i to
     iterate over the arguments; and

 (2) look at av[0], check with (0 < ac) for the end, and increment
     av and decrement ac at the same time to iterate over the
     arguments.

When (ac, av) appear as a pair, however, adjusting only av without
adjusting ac is asking for future trouble.  It violates a common
expectation that av[ac] points at the NULL at the end of the list.

If a code chooses to use !av[0] as the terminating condition and
never looks at ac, then incrementing only av is fine, but in such a
case, the function probably should lose ac altogether.

>  builtin/reset.c | 29 ++++++++++++++---------------
>  1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 9473725..68be05c 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -199,7 +199,6 @@ static void die_if_unmerged_cache(int reset_type)
>  }
>  
>  const char **parse_args(int argc, const char **argv, const char *prefix, const char **rev_ret) {
> -	int i = 0;
>  	const char *rev = "HEAD";
>  	unsigned char unused[20];
>  	/*
> @@ -210,34 +209,34 @@ const char **parse_args(int argc, const char **argv, const char *prefix, const c
>  	 * git reset [-opts] -- <paths>...
>  	 * git reset [-opts] <paths>...
>  	 *
> -	 * At this point, argv[i] points immediately after [-opts].
> +	 * At this point, argv points immediately after [-opts].
>  	 */
>  
> -	if (i < argc) {
> -		if (!strcmp(argv[i], "--")) {
> -			i++; /* reset to HEAD, possibly with paths */
> -		} else if (i + 1 < argc && !strcmp(argv[i+1], "--")) {
> -			rev = argv[i];
> -			i += 2;
> +	if (argc) {
> +		if (!strcmp(argv[0], "--")) {
> +			argv++; /* reset to HEAD, possibly with paths */
> +		} else if (argc > 1 && !strcmp(argv[1], "--")) {
> +			rev = argv[0];
> +			argv += 2;
>  		}
>  		/*
> -		 * Otherwise, argv[i] could be either <rev> or <paths> and
> +		 * Otherwise, argv[0] could be either <rev> or <paths> and
>  		 * has to be unambiguous.
>  		 */
> -		else if (!get_sha1_committish(argv[i], unused)) {
> +		else if (!get_sha1_committish(argv[0], unused)) {
>  			/*
> -			 * Ok, argv[i] looks like a rev; it should not
> +			 * Ok, argv[0] looks like a rev; it should not
>  			 * be a filename.
>  			 */
> -			verify_non_filename(prefix, argv[i]);
> -			rev = argv[i++];
> +			verify_non_filename(prefix, argv[0]);
> +			rev = *argv++;
>  		} else {
>  			/* Otherwise we treat this as a filename */
> -			verify_filename(prefix, argv[i], 1);
> +			verify_filename(prefix, argv[0], 1);
>  		}
>  	}
>  	*rev_ret = rev;
> -	return i < argc ? get_pathspec(prefix, argv + i) : NULL;
> +	return *argv ? get_pathspec(prefix, argv) : NULL;
>  }
>  
>  int cmd_reset(int argc, const char **argv, const char *prefix)

^ permalink raw reply

* [PATCH] remote-hg: store converted URL
From: Max Horn @ 2013-01-09 19:43 UTC (permalink / raw)
  To: git; +Cc: Felipe Contreras, Max Horn

From: Felipe Contreras <felipe.contreras@gmail.com>

Mercurial might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Suggested-by: Max Horn <max@quendi.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Max Horn <max@quendi.de>
---
For a discussion of the problem, see also
  http://article.gmane.org/gmane.comp.version-control.git/210250
While I am not quite happy with using "git config" to solve it, there
doesn't seem to be a better way right now.

 contrib/remote-helpers/git-remote-hg | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index c700600..7c74d8b 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -720,6 +720,14 @@ def do_export(parser):
     if peer:
         parser.repo.push(peer, force=False)
 
+def fix_path(alias, repo, orig_url):
+    repo_url = util.url(repo.url())
+    url = util.url(orig_url)
+    if str(url) == str(repo_url):
+        return
+    cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % repo_url]
+    subprocess.call(cmd)
+
 def main(args):
     global prefix, dirname, branches, bmarks
     global marks, blob_marks, parsed_refs
@@ -766,6 +774,9 @@ def main(args):
     repo = get_repo(url, alias)
     prefix = 'refs/hg/%s' % alias
 
+    if not is_tmp:
+        fix_path(alias, peer or repo, url)
+
     if not os.path.exists(dirname):
         os.makedirs(dirname)
 
-- 
1.8.0.1.525.gaaf5ad5

^ permalink raw reply related

* Re: [PATCH 08/19] reset.c: share call to die_if_unmerged_cache()
From: Junio C Hamano @ 2013-01-09 19:48 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-9-git-send-email-martinvonz@gmail.com>

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

> Use a single condition to guard the call to die_if_unmerged_cache for
> both --soft and --keep. This avoids the small distraction of the
> precondition check from the logic following it.
>
> Also change an instance of
>
>   if (e)
>     err = err || f();
>
> to the almost as short, but clearer
>
>   if (e && !err)
>     err = f();
>
> (which is equivalent since we only care whether exit code is 0)

It is not just equivalent, but should give us identical result, even
if we cared the actual value.

And I tend to agree that the latter is more readable, especially
when f() can be longer, which is often the case in real life.

Happy to see this change.

> ---
>  builtin/reset.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 4d556e7..42d1563 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -336,15 +336,13 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  	/* 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. */
> -	if (reset_type == SOFT)
> +	if (reset_type == SOFT || reset_type == KEEP)
>  		die_if_unmerged_cache(reset_type);
> -	else {
> -		int err;
> -		if (reset_type == KEEP)
> -			die_if_unmerged_cache(reset_type);
> -		err = reset_index_file(sha1, reset_type, quiet);
> -		if (reset_type == KEEP)
> -			err = err || reset_index_file(sha1, MIXED, quiet);
> +
> +	if (reset_type != SOFT) {
> +		int err = reset_index_file(sha1, reset_type, quiet);
> +		if (reset_type == KEEP && !err)
> +			err = reset_index_file(sha1, MIXED, quiet);
>  		if (err)
>  			die(_("Could not reset index file to revision '%s'."), rev);
>  	}

^ permalink raw reply

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

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.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 Documentation/git-fast-import.txt | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 3da5cc2..75ce808 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -83,19 +83,17 @@ OPTIONS
 	Like --import-marks but instead of erroring out, silently
 	skips the file if it does not exist.
 
---relative-marks::
+--[no-]relative-marks::
 	After specifying --relative-marks the paths specified
 	with --import-marks= and --export-marks= are relative
 	to an internal directory in the current repository.
 	In git-fast-import this means that the paths are relative
 	to the .git/info/fast-import directory. However, other
 	importers may use a different location.
++
+Relative and non-relative marks may be combined by interweaving
+--(no-)-relative-marks with the --(import|export)-marks= options.
 
---no-relative-marks::
-	Negates a previous --relative-marks. Allows for combining
-	relative and non-relative marks by interweaving
-	--(no-)-relative-marks with the --(import|export)-marks=
-	options.
 
 --cat-blob-fd=<fd>::
 	Write responses to `cat-blob` and `ls` queries to the
-- 
1.8.1.468.g3d9f9b6

^ permalink raw reply related

* [PATCH v2 0/2] Reorganise options in git-fast-import(1)
From: John Keeping @ 2013-01-09 19:43 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Jonathan Nieder, Eric S. Raymond, git, David Michael Barr,
	Pete Wyckoff, Thomas Rast
In-Reply-To: <7va9slnc07.fsf@alter.siamese.dyndns.org>

Here's a second attempt at this taking into account the feedback received so far.

Changes since v1:

 * Left dedup '--done' as a separate patch (now merged)
 * Split combining '--[no-]relative-marks' into a separate patch
 * '--force' moved to the top of the options, making the catchall
   section alphabetically sorted
 * Section headings changed:
    'Options related to the input stream' => 'Options for Frontends'
    'Options related to marks' => 'Locations of Marks Files'
    'Options for tuning' => 'Performance and Compression Tuning'
 * '--export-pack-edges' moves to 'Performance and Compression Tuning'
 * '--cat-blob-fd' moves to 'Options for Frontends'


John Keeping (2):
  git-fast-import(1): combine documentation of --[no-]relative-marks
  git-fast-import(1): reorganise options

 Documentation/git-fast-import.txt | 98 +++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 46 deletions(-)

-- 
1.8.1.468.g3d9f9b6

^ permalink raw reply

* Re: [PATCH 09/19] reset.c: replace switch by if-else
From: Junio C Hamano @ 2013-01-09 19:53 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-10-git-send-email-martinvonz@gmail.com>

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

> ---
>  builtin/reset.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 42d1563..05ccfd4 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -351,18 +351,11 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  	 * saving the previous head in ORIG_HEAD before. */
>  	update_ref_status = update_refs(rev, sha1);
>  
> -	switch (reset_type) {
> -	case HARD:
> -		if (!update_ref_status && !quiet)
> -			print_new_head_line(commit);
> -		break;
> -	case SOFT: /* Nothing else to do. */
> -		break;
> -	case MIXED: /* Report what has not been updated. */
> +	if (reset_type == HARD && !update_ref_status && !quiet)
> +		print_new_head_line(commit);
> +	else if (reset_type == MIXED) /* Report what has not been updated. */
>  		update_index_refresh(0, NULL,
>  				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
> -		break;
> -	}

Justification?

It might be shorter, but I somehow find the original _much_ easier
to follow, and to possibly extend.  The case arms delineate the
major modes of operation, and when somebody is interested in what
happens in "reset --hard", the case labels allow eyes to immediately
spot and skip uninteresting case arms.  On the other hand, the
updated one forces you to read the if/else cascade through.

^ permalink raw reply

* git-archive fails against smart-http repos
From: Bruce Lysik @ 2013-01-09 18:52 UTC (permalink / raw)
  To: git

Hi,

Trying to run git-archive fails against smart-http based repos.  Example:

$ git archive --verbose --format=zip --remote=http://code.toofishes.net/git/dan/initscripts.git
fatal: Operation not supported by protocol.
Unexpected end of command stream

This problem was brought up against my internal repos as well.

^ permalink raw reply

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

The options in git-fast-import(1) are not currently arranged in a
logical order, which has caused the '--done' options to be documented
twice (commit 3266de10).

Rearrange them into logical groups under subheadings.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>

---
 Documentation/git-fast-import.txt | 88 +++++++++++++++++++++------------------
 1 file changed, 48 insertions(+), 40 deletions(-)

diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 75ce808..bf1a02a 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -33,34 +33,46 @@ the frontend program in use.
 
 OPTIONS
 -------
---date-format=<fmt>::
-	Specify the type of dates the frontend will supply to
-	fast-import within `author`, `committer` and `tagger` commands.
-	See ``Date Formats'' below for details about which formats
-	are supported, and their syntax.
 
 --force::
 	Force updating modified existing branches, even if doing
 	so would cause commits to be lost (as the new commit does
 	not contain the old commit).
 
---max-pack-size=<n>::
-	Maximum size of each output packfile.
-	The default is unlimited.
+--quiet::
+	Disable all non-fatal output, making fast-import silent when it
+	is successful.  This option disables the output shown by
+	\--stats.
 
---big-file-threshold=<n>::
-	Maximum size of a blob that fast-import will attempt to
-	create a delta for, expressed in bytes.  The default is 512m
-	(512 MiB).  Some importers may wish to lower this on systems
-	with constrained memory.
+--stats::
+	Display some basic statistics about the objects fast-import has
+	created, the packfiles they were stored into, and the
+	memory used by fast-import during this run.  Showing this output
+	is currently the default, but can be disabled with \--quiet.
 
---depth=<n>::
-	Maximum delta depth, for blob and tree deltification.
-	Default is 10.
+Options for Frontends
+~~~~~~~~~~~~~~~~~~~~~
 
---active-branches=<n>::
-	Maximum number of branches to maintain active at once.
-	See ``Memory Utilization'' below for details.  Default is 5.
+--cat-blob-fd=<fd>::
+	Write responses to `cat-blob` and `ls` queries to the
+	file descriptor <fd> instead of `stdout`.  Allows `progress`
+	output intended for the end-user to be separated from other
+	output.
+
+--date-format=<fmt>::
+	Specify the type of dates the frontend will supply to
+	fast-import within `author`, `committer` and `tagger` commands.
+	See ``Date Formats'' below for details about which formats
+	are supported, and their syntax.
+
+--done::
+	Terminate with error if there is no `done` command at the end of
+	the stream.  This option might be useful for detecting errors
+	that cause the frontend to terminate before it has started to
+	write a stream.
+
+Locations of Marks Files
+~~~~~~~~~~~~~~~~~~~~~~~~
 
 --export-marks=<file>::
 	Dumps the internal marks table to <file> when complete.
@@ -94,19 +106,22 @@ OPTIONS
 Relative and non-relative marks may be combined by interweaving
 --(no-)-relative-marks with the --(import|export)-marks= options.
 
+Performance and Compression Tuning
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
---cat-blob-fd=<fd>::
-	Write responses to `cat-blob` and `ls` queries to the
-	file descriptor <fd> instead of `stdout`.  Allows `progress`
-	output intended for the end-user to be separated from other
-	output.
+--active-branches=<n>::
+	Maximum number of branches to maintain active at once.
+	See ``Memory Utilization'' below for details.  Default is 5.
 
---done::
-	Terminate with error if there is no `done` command at the
-	end of the stream.
-	This option might be useful for detecting errors that
-	cause the frontend to terminate before it has started to
-	write a stream.
+--big-file-threshold=<n>::
+	Maximum size of a blob that fast-import will attempt to
+	create a delta for, expressed in bytes.  The default is 512m
+	(512 MiB).  Some importers may wish to lower this on systems
+	with constrained memory.
+
+--depth=<n>::
+	Maximum delta depth, for blob and tree deltification.
+	Default is 10.
 
 --export-pack-edges=<file>::
 	After creating a packfile, print a line of data to
@@ -117,16 +132,9 @@ Relative and non-relative marks may be combined by interweaving
 	as these commits can be used as edge points during calls
 	to 'git pack-objects'.
 
---quiet::
-	Disable all non-fatal output, making fast-import silent when it
-	is successful.  This option disables the output shown by
-	\--stats.
-
---stats::
-	Display some basic statistics about the objects fast-import has
-	created, the packfiles they were stored into, and the
-	memory used by fast-import during this run.  Showing this output
-	is currently the default, but can be disabled with \--quiet.
+--max-pack-size=<n>::
+	Maximum size of each output packfile.
+	The default is unlimited.
 
 
 Performance
-- 
1.8.1.468.g3d9f9b6

^ permalink raw reply related

* Re: [PATCH 10/19] reset --keep: only write index file once
From: Junio C Hamano @ 2013-01-09 19:55 UTC (permalink / raw)
  To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <1357719376-16406-11-git-send-email-martinvonz@gmail.com>

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

> "git reset --keep" calls reset_index_file() twice, first doing a
> two-way merge to the target revision, updating the index and worktree,
> and then resetting the index. After each call, we write the index
> file.
>
> In the unlikely event that the second call to reset_index_file()
> fails, the index will have been merged to the target revision, but
> HEAD will not be updated, leaving the user with a dirty index.
>
> By moving the locking, writing and committing out of
> reset_index_file() and into the caller, we can avoid writing the index
> twice, thereby making the sure we don't end up in the half-way reset
> state.

Nice.

^ permalink raw reply

* 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


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