Re: [PATCH 6/6] push: honor branch.*.push

2013-06-23 Thread Johan Herland
On Mon, Jun 24, 2013 at 6:33 AM, Junio C Hamano wrote: > When branch.*.push configuration variable is defined for the current > branch, a lazy-typing "git push" (and "git push there") will push > the commit at the tip of the current branch to the destination and > update the branch named by that v

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-23 Thread Johan Herland
On Mon, Jun 24, 2013 at 6:33 AM, Junio C Hamano wrote: > From: Ramkumar Ramachandra > > The setup creates two bare repositories: repo1 and repo2, but > test_push_commit() hard-codes checking in repo1 for the actual output. > Generalize it and its caller, test_push_success(), to optionally accept

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-23 Thread Johan Herland
On Mon, Jun 24, 2013 at 6:33 AM, Junio C Hamano wrote: > From: Ramkumar Ramachandra > > When remote.pushdefault or branch..pushremote is set (a triangular > workflow feature), master@{u} != origin, and push.default is set to > `upstream` or `simple`: > > $ git push > fatal: You are pushing to

Re: detached HEAD before root commit - possible?

2013-06-23 Thread Junio C Hamano
Martin von Zweigbergk writes: > On Sun, Jun 23, 2013 at 4:54 PM, Jonathan Nieder wrote: >> >> In other words, HEAD always either points to an unborn or existing >> branch or an existing commit. It's not clear to me what it would >> mean to detach from an unborn branch. > > I think it should mea

[PATCH 2/6] config doc: rewrite push.default section

2013-06-23 Thread Junio C Hamano
From: Ramkumar Ramachandra 4d35924e (Merge branch 'rr/triangle', 2013-04-07) introduced support for triangular workflows, but the push.default values still assume central workflows. Rewrite the descriptions of `nothing`, `current`, `upstream` and `matching` for greater clarity, and explicitly ex

[PATCH 0/6] Reroll of rr/triangular-push-fix

2013-06-23 Thread Junio C Hamano
This is mostly Ram's triangular-push-fix series, but the fix-up commits I queued on top of it when the series was queued to 'pu' have been squashed in. [PATCH 1/6] t/t5528-push-default: remove redundant test_config lines No changes, as posted by Ram. [PATCH 2/6] config doc: rewrite push.de

[PATCH 6/6] push: honor branch.*.push

2013-06-23 Thread Junio C Hamano
When branch.*.push configuration variable is defined for the current branch, a lazy-typing "git push" (and "git push there") will push the commit at the tip of the current branch to the destination and update the branch named by that variable. Signed-off-by: Junio C Hamano --- builtin/push.c | 1

[PATCH 1/6] t/t5528-push-default: remove redundant test_config lines

2013-06-23 Thread Junio C Hamano
From: Ramkumar Ramachandra The line test_config push.default upstream appears unnecessarily in two tests, as the final test_push_failure sets push.default before pushing anyway. Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- t/t5528-push-default.sh | 2 -- 1 file ch

[PATCH 5/6] t/t5528-push-default: test pushdefault workflows

2013-06-23 Thread Junio C Hamano
From: Ramkumar Ramachandra Introduce test_pushdefault_workflows(), and test that all push.default modes work with central and triangular workflows as expected. Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- t/t5528-push-default.sh | 57 ++

[PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-23 Thread Junio C Hamano
From: Ramkumar Ramachandra The setup creates two bare repositories: repo1 and repo2, but test_push_commit() hard-codes checking in repo1 for the actual output. Generalize it and its caller, test_push_success(), to optionally accept a third argument to specify the name of the repository to check f

[PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-23 Thread Junio C Hamano
From: Ramkumar Ramachandra When remote.pushdefault or branch..pushremote is set (a triangular workflow feature), master@{u} != origin, and push.default is set to `upstream` or `simple`: $ git push fatal: You are pushing to remote 'origin', which is not the upstream of your current branch '

Re: detached HEAD before root commit - possible?

2013-06-23 Thread Martin von Zweigbergk
On Sun, Jun 23, 2013 at 4:54 PM, Jonathan Nieder wrote: > > In other words, HEAD always either points to an unborn or existing > branch or an existing commit. It's not clear to me what it would > mean to detach from an unborn branch. I think it should mean that the next commit would be a root co

Re: [PATCH v3 6/7] rebase: write better reflog messages

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > @@ -59,6 +63,9 @@ else > return $? > fi > > + # always reset GIT_REFLOG_ACTION before calling any external > + # scripts; they have no idea about our base_reflog_action > + GIT_REFLOG_ACTION="$base_reflog_action" > git am $git

Re: detached HEAD before root commit - possible?

2013-06-23 Thread Jonathan Nieder
Hi, SZEDER Gábor wrote: > $ git init > Initialized empty Git repository in /tmp/test/.git/ > $ git checkout --detach > fatal: You are on a branch yet to be born > > Are there some plumbing commands and options that would still allow > this, or can I rely on that that it's impossible? gitreposito

detached HEAD before root commit - possible?

2013-06-23 Thread SZEDER Gábor
I suspect that detaching HEAD before a root commit is not possible by design. What would HEAD contain then!? 'git checkout' seems to corroborate: $ git init Initialized empty Git repository in /tmp/test/.git/ $ git checkout --detach fatal: You are on a branch yet to be born Are there some plumb

Re: [PATCH 1/3] remote: Add warnings about mixin --mirror and other remotes

2013-06-23 Thread Junio C Hamano
Dennis Kaarsemaker writes: > On zo, 2013-06-23 at 14:22 -0700, Junio C Hamano wrote: >> Dennis Kaarsemaker writes: >> >> > Equality for >> > wildcards is allowed and tested for, so do we really want to 'outlaw' >> > equality of non-wildcard refspecs? >> >> I am not sure what you mean by "equal

Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > I disagree. It is trivial to prove that the tests in t/remote will > break if this fringe feature breaks: I don't know where "we will never > know when we break them" is coming from. If you remove tests that configure the remotes via the .git/branches and the .g

Re: [PATCH 1/3] remote: Add warnings about mixin --mirror and other remotes

2013-06-23 Thread Dennis Kaarsemaker
On zo, 2013-06-23 at 14:22 -0700, Junio C Hamano wrote: > Dennis Kaarsemaker writes: > > > Equality for > > wildcards is allowed and tested for, so do we really want to 'outlaw' > > equality of non-wildcard refspecs? > > I am not sure what you mean by "equality for wildcards is allowed". > Do yo

Re: [PATCH 1/3] remote: Add warnings about mixin --mirror and other remotes

2013-06-23 Thread Junio C Hamano
Dennis Kaarsemaker writes: > Equality for > wildcards is allowed and tested for, so do we really want to 'outlaw' > equality of non-wildcard refspecs? I am not sure what you mean by "equality for wildcards is allowed". Do you mean this pair of remote definition is sane and not warned? [

Re: [PATCH 05/16] remote: remove dead code in read_branches_file()

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: Reminds me of the strategy to deprecate functionality in X (cf. http://lwn.net/Articles/536520/) ;-) >>> >>> Leaving dead code around to confuse readers? :\ >> >> We broke the use case to access jgarzik/netdev-2.6 only by having >> jg

Re: [PATCH] add--interactive: respect diff.algorithm

2013-06-23 Thread Junio C Hamano
John Keeping writes: > The patch below involves deeper Perl magic than I fully grok, but > wouldn't it be simpler to simply use the fact that the string is > "command --options..." and use: > > splice @diff_cmd 1, 0, "--diff-algorithm=${diff_algorithm}"; That inserts the extra options as the

Re: [PATCH] add--interactive: respect diff.algorithm

2013-06-23 Thread John Keeping
On Sun, Jun 23, 2013 at 12:19:05PM -0700, Junio C Hamano wrote: > John Keeping writes: > > >> > +my $diff_algorithm = ($repo->config('diff.algorithm') or 'default'); > >> > + > >> > my $use_readkey = 0; > >> > my $use_termcap = 0; > >> > my %term_escapes; > >> > @@ -731,6 +733,9 @@ sub run_git

Re: [PATCH] add--interactive: respect diff.algorithm

2013-06-23 Thread Junio C Hamano
John Keeping writes: >> > +my $diff_algorithm = ($repo->config('diff.algorithm') or 'default'); >> > + >> > my $use_readkey = 0; >> > my $use_termcap = 0; >> > my %term_escapes; >> > @@ -731,6 +733,9 @@ sub run_git_apply { >> > sub parse_diff { >> >my ($path) = @_; >> >my @diff_cmd =

[PATCH v4 7/8] test-lib: allow prefixing a custom string before "ok N" etc.

2013-06-23 Thread Thomas Rast
This is not really meant for external use, and thus not documented. It allows the next commit to neatly distinguish between sub-tests and the main run. The format is intentionally not valid TAP. The use in the next commit would not result in anything valid either way, and it seems better to make

[PATCH v4 6/8] test-lib: valgrind for only tests matching a pattern

2013-06-23 Thread Thomas Rast
With the new --valgrind-only= option, one can enable --valgrind at a per-test granularity, exactly analogous to --verbose-only from the previous commit. The options are wired such that --valgrind implies --verbose (as before), but --valgrind-only= implies --verbose-only= unless --verbose is also i

[PATCH v4 0/8] --valgrind improvements

2013-06-23 Thread Thomas Rast
> Please hold off; Fredrik found an issue with the test automation that > bisects to "verbose mode for only tests matching a pattern"; when > running with the 'test' target (not with prove however), the suite > reports > > failed test(s): > > fixed 0 > success 9788 > failed 2 > bro

[PATCH v4 3/8] test-lib: rearrange start/end of test_expect_* and test_skip

2013-06-23 Thread Thomas Rast
This moves * the early setup part from test_skip to a new function test_start_ * the final common parts of test_expect_* to a new function test_finish_ to make the next commit more obvious. Signed-off-by: Thomas Rast --- t/test-lib-functions.sh | 6 -- t/test-lib.sh | 9 ++

[PATCH v4 2/8] test-lib: refactor $GIT_SKIP_TESTS matching

2013-06-23 Thread Thomas Rast
It's already used twice, and we will have more of the same kind of matching in a minute. Helped-by: Johannes Sixt Signed-off-by: Thomas Rast --- t/test-lib.sh | 41 - 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/t/test-lib.sh b/t/test-l

[PATCH v4 8/8] test-lib: support running tests under valgrind in parallel

2013-06-23 Thread Thomas Rast
With the new --valgrind-parallel= option, we support running the tests in a single test script under valgrind in parallel using 'n' processes. This really follows the dumbest approach possible, as follows: * We spawn the test script 'n' times, using a throw-away TEST_OUTPUT_DIRECTORY. Each of

[PATCH v4 1/8] test-lib: enable MALLOC_* for the actual tests

2013-06-23 Thread Thomas Rast
1b3185f (MALLOC_CHECK: various clean-ups, 2012-09-14) moved around the MALLOC_CHECK_ and MALLOC_PERTURB_ assignments, intending to limit their effect to only the test runs. However, they were actually enabled only during test cleanup. Call setup/teardown_malloc_check also around the evaluation of

[PATCH v4 4/8] test-lib: self-test that --verbose works

2013-06-23 Thread Thomas Rast
t contains some light self-tests of test-lib.sh, but --verbose was not covered. Add a test. The only catch is that the presence of a test harness influences the output (specifically, the presence of some empty lines). So we need to unset TEST_HARNESS or set it to a known value. Leaving it u

[PATCH v4 5/8] test-lib: verbose mode for only tests matching a pattern

2013-06-23 Thread Thomas Rast
With the new --verbose-only= option, one can enable --verbose at a per-test granularity. The pattern is matched against the test number, e.g. ./t-basic.sh --verbose-only='2[0-2]' to see only the full output of test 20-22, while showing the rest in the one-liner format. As suggested by Jef

Re: [HELP] Corrupted repository

2013-06-23 Thread Matthieu Moy
Junio C Hamano writes: > Ramkumar Ramachandra writes: > >> Junio C Hamano wrote: $ ~/src/git error: object file .git/objects/8e/6a6dda24b017915449897fcc1353a9b848fd2f is empty error: object file .git/objects/8e/6a6dda24b017915449897fcc1353a9b848fd2f is empty

Re: What's cooking in git.git (Jun 2013, #07; Thu, 20)

2013-06-23 Thread Thomas Rast
Junio C Hamano writes: > * tr/test-v-and-v-subtest-only (2013-06-18) 8 commits > - test-lib: support running tests under valgrind in parallel > - test-lib: allow prefixing a custom string before "ok N" etc. > - test-lib: valgrind for only tests matching a pattern > - test-lib: verbose mode fo

[PATCH 3/4] fast-import: allow ls or filecopy of the root tree

2013-06-23 Thread John Keeping
Commit 178e1de (fast-import: don't allow 'ls' of path with empty components, 2012-03-09) restricted paths which: . contain an empty directory component (e.g. foo//bar is invalid), . end with a directory separator (e.g. foo/ is invalid), . start with a directory separator (e.g. /foo is

[PATCH 4/4] fast-import: allow moving the root tree

2013-06-23 Thread John Keeping
Because fast-import.c::tree_content_remove does not check for the empty path, it is not possible to move the root tree to a subdirectory. Instead the error "Path not in branch" is produced (note the double space where the empty path has been inserted). Fix this by explicitly checking for the empt

[PATCH 0/4] fast-import: handle empty paths better

2013-06-23 Thread John Keeping
This series addressed Dave Abraham's recent bug report [1] about using fast-import's "ls" command with an empty path. I also found a couple of other places that do not handle the empty path when it can reasonably be interpreted as meaning the root tree object, which are also fixed here. [1] http:

[PATCH 1/4] t9300: document fast-import empty path issues

2013-06-23 Thread John Keeping
When given an empty path, fast-import sometimes reports "missing" instead of using the root tree object. On top of this, for "ls" and file copy (but not move) it dies with "Empty path component found in input". Document this behaviour with failing test cases. Reported-by: Dave Abrahams Signed-o

[PATCH 2/4] fast-import: set valid mode on root tree in "ls"

2013-06-23 Thread John Keeping
This prevents a failure later when we lift the restriction on ls with the empty path. Signed-off-by: John Keeping --- fast-import.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fast-import.c b/fast-import.c index 23f625f..bdbadea 100644 --- a/fast-import.c +++ b/fast-import.c @@ -3051,6

Re: fast-import bug?

2013-06-23 Thread John Keeping
On Sun, Jun 23, 2013 at 07:19:25AM -0700, Dave Abrahams wrote: > on Sun Jun 23 2013, John Keeping wrote: > > In this case, I think I do now understand why the mode is 0: in > > parse_ls a new tree object is created and the SHA1 of the original is > > copied in but the mode is left blank; clearly t

Re: [PATCH 2/4] git-prompt.sh: refactor colored prompt code

2013-06-23 Thread SZEDER Gábor
On Sat, Jun 22, 2013 at 01:45:38PM -0300, Eduardo D'Avila wrote: > 2013/6/22 Øystein Walle : > > I've gotten the impression it's better to use tput to generate the escape > > sequences instead of hardcoding them. So something like: > > > > local c_red='\['"$(tput setaf 1)"'\]' > > local c_green='\[

Re: fast-import bug?

2013-06-23 Thread Dave Abrahams
on Sun Jun 23 2013, John Keeping wrote: > On Sat, Jun 22, 2013 at 07:16:48PM -0700, Dave Abrahams wrote: >> I also note that the docs >> don't make it clear that quoting the path is mandatory if it might turn >> out to be empty. > > That's not quite t

Re: [PATCH 1/3] remote: Add warnings about mixin --mirror and other remotes

2013-06-23 Thread Dennis Kaarsemaker
On vr, 2013-06-21 at 11:42 -0700, Junio C Hamano wrote: > > +(!fnmatch(refspec, remote->fetch[i].dst, 0) || > > + !fnmatch(remote->fetch[i].dst, refspec, 0))) { > > Does .dst always exist and is never a NULL? My quick scan of > remote.c::parse_refspec_internal() te

Re: fast-import bug?

2013-06-23 Thread John Keeping
On Sat, Jun 22, 2013 at 07:16:48PM -0700, Dave Abrahams wrote: > > on Sat Jun 22 2013, John Keeping wrote: > > > On Fri, Jun 21, 2013 at 02:21:47AM -0700, Dave Abrahams wrote: > >> The docs for fast-import seem to imply that I can use "ls" to get the > >> SHA1 of a commit for which I have a mark

Re: [PATCH] git-daemon: have --no-syslog

2013-06-23 Thread Eric Sunshine
On Sat, Jun 22, 2013 at 1:41 PM, Andreas Krey wrote: > diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt > index 223f731..007d3fc 100644 > --- a/Documentation/git-daemon.txt > +++ b/Documentation/git-daemon.txt > @@ -113,6 +113,10 @@ OPTIONS > Log to syslog instead o

Re: [PATCH 05/16] remote: remove dead code in read_branches_file()

2013-06-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: >>> Reminds me of the strategy to deprecate functionality in X (cf. >>> http://lwn.net/Articles/536520/) ;-) >> >> Leaving dead code around to confuse readers? :\ > > We broke the use case to access jgarzik/netdev-2.6 only by having > jgarzik remote accidentally, and waited fo

Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file

2013-06-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > I'll reject 04/14 and tweak this patch to use 'next' for the new ref > mappings, not duplicated 'master'. It's a matter of taste: I don't like "realistic" (albeit misleading) values when I'm testing configuration variables, while you think they make the tests more readable.

Re: [PATCH 05/16] remote: remove dead code in read_branches_file()

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: >> Reminds me of the strategy to deprecate functionality in X (cf. >> http://lwn.net/Articles/536520/) ;-) > > Leaving dead code around to confuse readers? :\ Did you actually read what was quoted? We broke the use case to access jgarzik/netdev-2.6 only by having jg

Re: [PATCH v2 11/14] t/t5505-remote: test multiple push/pull in remotes-file

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Extend the test "migrate a remote from named file in $GIT_DIR/remotes" > to test that multiple "Push:" and "Pull:" lines in the remotes-file > works as expected. > > Signed-off-by: Ramkumar Ramachandra > --- > t/t5505-remote.sh | 16 ++-- > 1 file chan

Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >> Ramkumar Ramachandra writes: >> >>> Under the EXAMPLES section, there is one invocation on the git.git >>> repository that attempts to list the refs master, pu, and rc. The ref >>> rc does not exist in today's repository, so remove it. Am

[RFC] [submodule] Add depth to submodule update

2013-06-23 Thread Fredrik Gustafsson
Used only when a clone is initialized. This is useful when the submodule(s) are huge and you're not really interested in anything but the latest commit. Signed-off-by: Fredrik Gustafsson --- git-submodule.sh | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/git-s

Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git

2013-06-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > Ramkumar Ramachandra writes: > >> Under the EXAMPLES section, there is one invocation on the git.git >> repository that attempts to list the refs master, pu, and rc. The ref >> rc does not exist in today's repository, so remove it. Among other >> things, this example demo

Re: [PATCH 04/16] t/t5505-remote: remove dependency on $origin_url

2013-06-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > I do not think you are creating a quux repository to be pushed into > and fetched from with this change. Placing 'quux' in the "URL:" field > feels a lot more misleading to me. What am I missing? Dropped. I'll send in a re-roll based on what you put up on pu. -- To unsubs

Re: [PATCH v2 01/14] t/t5505-remote: modernize style

2013-06-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > This smells like a largely blind conversion done with a script, It is :) > I'll queue with this fix-up squashed in. Thanks; I really appreciate it. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v2 01/14] t/t5505-remote: modernize style

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Modernize the style of all tests throughout the file: > - Remove spurious blank lines. > - Indent the test body. > - Make sure that all lines end with &&, to make it easier to spot breaks > in the chain. > - When executing something in a subshell, put the parenthe

Re: [PATCH 1/4] t9903: add tests for git-prompt pcmode

2013-06-23 Thread Junio C Hamano
"Eduardo D'Avila" writes: > However, I agree that they became redundant. > > Would it make sense to include a patch that only removes the zsh > tests, after the refactorization? I think that would be a sensible thing to do. In any case, Szeder seems to be giving a good guidance on patches in th

Re: [PATCH v2 08/14] ls-remote doc: fix example invocation on git.git

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Under the EXAMPLES section, there is one invocation on the git.git > repository that attempts to list the refs master, pu, and rc. The ref > rc does not exist in today's repository, so remove it. Among other > things, this example demonstrates that the "..." argum

Re: [PATCH v2 05/14] remote: remove dead code in read_branches_file()

2013-06-23 Thread Junio C Hamano
Ramkumar Ramachandra writes: > - /* > - * With "slash", e.g. "git fetch jgarzik/netdev-2.6" when > - * reading from $GIT_DIR/branches/jgarzik fetches "HEAD" from > - * the partial URL obtained from the branches file plus > - * "/netdev-2.6" and does not store it in any tra