[PATCH v6 00/10] Add --graft option to git replace

2014-07-07 Thread Christian Couder
Here is a small series to implement: git replace [-f] --graft commit [parent...] This patch series goes on top of the patch series that implements --edit. The changes since v5, thanks to Junio, are: - new patch 1/10 to clean up redirection style in t6050 - new patches 8/10, 9/10 and

[PATCH v6 01/10] replace: cleanup redirection style in tests

2014-07-07 Thread Christian Couder
Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- t/t6050-replace.sh | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index 68b3cb2..fb07ad2 100755 --- a/t/t6050-replace.sh +++

[PATCH v6 02/10] replace: add --graft option

2014-07-07 Thread Christian Couder
The usage string for this option is: git replace [-f] --graft commit [parent...] First we create a new commit that is the same as commit except that its parents are [parents...] Then we create a replace ref that replace commit with the commit we just created. With this new option, it should be

[PATCH v6 06/10] replace: remove signature when using --graft

2014-07-07 Thread Christian Couder
It could be misleading to keep a signature in a replacement commit, so let's remove it. Note that there should probably be a way to sign the replacement commit created when using --graft, but this can be dealt with in another commit or patch series. Signed-off-by: Christian Couder

[PATCH v6 05/10] contrib: add convert-grafts-to-replace-refs.sh

2014-07-07 Thread Christian Couder
This patch adds into contrib/ an example script to convert grafts from an existing grafts file into replace refs using the new --graft option of git replace. While at it let's mention this new script in the git replace documentation for the --graft option. Signed-off-by: Christian Couder

[PATCH v6 10/10] replace: add test for --graft with a mergetag

2014-07-07 Thread Christian Couder
Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- t/t6050-replace.sh | 22 ++ 1 file changed, 22 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index 15fd541..3bb8d06 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -416,4 +416,26 @@

[PATCH v6 04/10] Documentation: replace: add --graft option

2014-07-07 Thread Christian Couder
Signed-off-by: Christian Couder chrisc...@tuxfamily.org Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/git-replace.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt index 61461b9..491875e 100644 ---

[PATCH v6 07/10] replace: add test for --graft with signed commit

2014-07-07 Thread Christian Couder
Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- t/t6050-replace.sh | 25 + 1 file changed, 25 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index d80a89e..15fd541 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -7,6 +7,7 @@

[PATCH v6 03/10] replace: add test for --graft

2014-07-07 Thread Christian Couder
Signed-off-by: Christian Couder chrisc...@tuxfamily.org Signed-off-by: Junio C Hamano gits...@pobox.com --- t/t6050-replace.sh | 40 1 file changed, 40 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index fb07ad2..d80a89e 100755 ---

[PATCH v6 09/10] replace: check mergetags when using --graft

2014-07-07 Thread Christian Couder
When using --graft, with a mergetag in the original commit, we should check that the commit pointed to by the mergetag is still a parent of then new commit we create, otherwise the mergetag could be misleading. If the commit pointed to by the mergetag is no more a parent of the new commit, we

[PATCH v6 08/10] commit: add for_each_mergetag()

2014-07-07 Thread Christian Couder
In the same way as there is for_each_ref() to iterate on refs, it might be useful to have for_each_mergetag() to iterate on the mergetags of a given commit. Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- commit.c | 13 + commit.h | 5 + log-tree.c | 15

Re: [PATCH v5 2/2] test-config: Add tests for the config_set API

2014-07-07 Thread Matthieu Moy
Ramkumar Ramachandra artag...@gmail.com writes: A couple of quick nits. Tanay Abhra wrote: +test_expect_success 'clear default config' ' + rm -f .git/config +' Unnecessary; a fresh temporary directory is created for each test run. Hmm, fresh, but not empty. Anyway, the next test

[PATCH v6 1/2] add `config_set` API for caching config-like files

2014-07-07 Thread Tanay Abhra
Currently `git_config()` uses a callback mechanism and file rereads for config values. Due to this approach, it is not uncommon for the config files to be parsed several times during the run of a git program, with different callbacks picking out different variables useful to themselves. Add a

[PATCH v6 0/3] git config cache special querying api utilizing the cache

2014-07-07 Thread Tanay Abhra
Hi, [PATCH V6]: Style nits and mistakes corrected. Diff between v6 and v5[8] is at the bottom. Thanks to Matthieu, Ramsay and Ram for their suggestions. [PATCH V5]: `config_set` now uses a single hashmap. Corrected style nits raised in the thread[7]. Thanks

[PATCH v6 2/2] test-config: Add tests for the config_set API

2014-07-07 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Tanay Abhra tanay...@gmail.com --- .gitignore | 1 + Makefile

Adding 'Signed-off-by' to 'subtree add --squash' commits

2014-07-07 Thread Finucane, Stephen
Is it possible to sign off squashed commits created by the 'git subtree add ... --squash' command? I ask, because the Signed-off-by tag is a requirement for a project I work on, but I've been unable to achieve this. A thorough search of Google/StackOverflow reveals nothing. Regards, Stephen

Re: [PATCH v5 00/28] Support multiple checkouts

2014-07-07 Thread Duy Nguyen
On Mon, Jul 7, 2014 at 3:46 AM, Max Kirillov m...@max630.net wrote: Hi. What future does this have? Currently it is marked as Stalled, but still mergeable with some trivial conflicts and seem to be working (except some bugs in interaction with submodules, see below). It would be very nice if

Re: [PATCH v5 00/28] Support multiple checkouts

2014-07-07 Thread Dennis Kaarsemaker
On ma, 2014-07-07 at 17:25 +0700, Duy Nguyen wrote: I also have a comment about how it interacts with submodules. Would it be more appropriate to mark modules as a per-checkout directory? Because each of the working tree's submodule is obviously a separated directory in filesystem, and

Re: Adding 'Signed-off-by' to 'subtree add --squash' commits

2014-07-07 Thread Andreas Schwab
Finucane, Stephen stephen.finuc...@intel.com writes: Is it possible to sign off squashed commits created by the 'git subtree add ... --squash' command? If it isn't directly possible, you can always use git commit --amend -C HEAD -s to modify the commit afterwards. Andreas. -- Andreas

Re: [PATCH 1/3] cache-tree: Create/update cache-tree on checkout

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: I am not convinced that doing an equivalent of write-tree when you switch branches is the right approach in the first place. You will eventually write it out as a tree, and having a relatively undamaged cache-tree will help you when you do so,

Re: [PATCH v4 1/2] add `config_set` API for caching config files

2014-07-07 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: On 7/4/2014 2:47 PM, Matthieu Moy wrote: Tanay Abhra tanay...@gmail.com writes: Hi, I have cooked up a single hashmap implementation. What are your thoughts about it? I had a quick look, and it looks good to me. I'll make a more detailed review

Re: [PATCH v6 2/2] test-config: Add tests for the config_set API

2014-07-07 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh new file mode 100755 index 000..ad99f8b --- /dev/null +++ b/t/t1308-config-hash.sh @@ -0,0 +1,168 @@ +#!/bin/sh + +test_description='Test git config-hash API in different settings'

Re: [PATCH 00/14] Add submodule test harness

2014-07-07 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Junio, do you want me to resend 02/14 without the non-portable echo -n or could you just squash the following diff in? Amended locally here already; thanks, both. -8 diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh index

Re: [PATCH v6 0/3] git config cache special querying api utilizing the cache

2014-07-07 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: test_expect_success 'find value with misspelled key' ' - echo Value not found for \my.fOo Bar.hi\ expect - test_must_fail test-config get_value my.fOo Bar.hi actual - test_cmp expect actual + check my.fOo Bar.hi Value not found for

Re: Adding 'Signed-off-by' to 'subtree add --squash' commits

2014-07-07 Thread Jeff King
On Mon, Jul 07, 2014 at 06:55:07PM +0200, Andreas Schwab wrote: Finucane, Stephen stephen.finuc...@intel.com writes: Is it possible to sign off squashed commits created by the 'git subtree add ... --squash' command? If it isn't directly possible, you can always use git commit --amend

Re: [PATCH v1 1/4] hashmap: factor out getting an int hash code from a, SHA1

2014-07-07 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Copying the first bytes of a SHA1 is duplicated in six places, however, the implications (wrong byte order on little-endian systems) is documented only once. s/wrong /different /; but other than that I think this is a good change. +`unsigned int

Re: [PATCH v5 00/28] Support multiple checkouts

2014-07-07 Thread Max Kirillov
On Mon, Jul 07, 2014 at 12:49:01PM +0200, Dennis Kaarsemaker wrote: I do intend to use checkout --to and submodule update on the same repository, but have not yet done so. I will poke at that later this month. If you can easily reproduce errors, I would appreciate to know how, because my use

Re: [PATCH v1 3/4] hashmap: add simplified hashmap_get_from_hash() API

2014-07-07 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Hashmap entries are typically looked up by just a key. The hashmap_get() API expects an initialized entry structure instead, to support compound keys. This flexibility is currently only needed by find_dir_entry() in name-hash.c (and

Re: [PATCH v1 4/4] hashmap: add string interning API

2014-07-07 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Interning short strings with high probability of duplicates can reduce the memory footprint and speed up comparisons. Add strintern() and memintern() APIs that use a hashmap to manage the pool of unique, interned strings. Note:

Re: [BUG] rebase no longer omits local commits

2014-07-07 Thread Junio C Hamano
John Keeping j...@keeping.me.uk writes: Perhaps we shuld do something like this (which passes the test suite): -- 8 -- diff --git a/git-rebase.sh b/git-rebase.sh index 06c810b..0c6c5d3 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -544,7 +544,8 @@ if test $fork_point = t then

Re: [PATCH 2/2] t/Makefile: always test all lint targets when running tests

2014-07-07 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Only the two targets test-lint-duplicates and test-lint-executable are currently executed when running the test target. This was done on purpose when the TEST_LINT variable was added in 81127d74. But as this does not include the test-lint-shell-syntax

Re: [PATCH] refs: Fix valgrind suppression file

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: Add all of the ways in which check_refname_format violates valgrind's expectations to the valgrind suppression file; remove an assumption about the call chain of check_refname_format from same. Signed-off-by: David Turner dtur...@twitter.com ---

Re: [PATCH 1/2] symlinks: remove PATH_MAX limitation

2014-07-07 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: 'git checkout' fails if a directory is longer than PATH_MAX, because the lstat_cache in symlinks.c checks if the leading directory exists using PATH_MAX-bounded string operations. Remove the limitation by using strbuf instead. Good. diff --git

Re: [PATCH v4 1/4] cache-tree: Create/update cache-tree on checkout

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. update_main_cache_tree learned a new flag, WRITE_TREE_REPAIR. When WRITE_TREE_REPAIR is set, portions of the cache-tree which do not

Re: [PATCH v4 3/4] cache-tree: subdirectory tests

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: Add tests to confirm that invalidation of subdirectories nether over- nor under-invalidates. Signed-off-by: David Turner dtur...@twitter.com --- t/t0090-cache-tree.sh | 28 +--- 1 file changed, 25 insertions(+), 3

Re: [PATCH v4 2/4] test-dump-cache-tree: invalid trees are not errors

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: Do not treat known-invalid trees as errors even when their count is incorrect. Because git already knows that these trees are invalid, nothing depends on the count field. s/count/subtree_nr/; they are different. nothing depends on is not quite

Re: [PATCH 00/14] Add submodule test harness

2014-07-07 Thread Torsten Bögershausen
On 2014-07-07 19.05, Junio C Hamano wrote: Jens Lehmann jens.lehm...@web.de writes: Junio, do you want me to resend 02/14 without the non-portable echo -n or could you just squash the following diff in? Amended locally here already; thanks, both. There seems to be some other trouble under

Re: [PATCH v4 4/4] cache-tree: Write updated cache-tree after commit

2014-07-07 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: During the commit process, update the cache-tree. Write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Make all tests test the entire cache-tree,

Re: [PATCH 3/5] Run the perf test suite for profile feedback too

2014-07-07 Thread Junio C Hamano
Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com Open: If the perf test suite is representative enough it may be reasonable to only run that and skip the much longer full test suite. Thoughts? I do not think it right now is representative, nor it was meant to

Re: [BUG] rebase no longer omits local commits

2014-07-07 Thread John Keeping
On Mon, Jul 07, 2014 at 10:56:23AM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: Perhaps we shuld do something like this (which passes the test suite): -- 8 -- diff --git a/git-rebase.sh b/git-rebase.sh index 06c810b..0c6c5d3 100755 --- a/git-rebase.sh +++

Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?

2014-07-07 Thread Junio C Hamano
Pete Wyckoff p...@padd.com writes: I'm not sure how to robustify this. At least doing the multiple comparisons should make the tests work again. The goal of this series of tests is to make sure that copy detection is working, not to verify that the correct copy choice was made. That should

Potential bug in ls-files (version 1.7.9.5)

2014-07-07 Thread Hamilton Turner
I'd appreciate if someone could confirm that this is a bug in git, as this works as expected with git 1.8.5.2. I'm not sure if this 1.7.X is still supported, but I think it's still the latest git-core available in Ubuntu 12.04 repositories. I'm having problems with git ls-files --others

Re: [PATCH 3/5] Run the perf test suite for profile feedback too

2014-07-07 Thread Andi Kleen
On Mon, Jul 07, 2014 at 02:06:57PM -0700, Junio C Hamano wrote: Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com Open: If the perf test suite is representative enough it may be reasonable to only run that and skip the much longer full test suite. Thoughts?

Re: [PATCH v6 03/10] replace: add test for --graft

2014-07-07 Thread Junio C Hamano
Christian Couder chrisc...@tuxfamily.org writes: Signed-off-by: Christian Couder chrisc...@tuxfamily.org Signed-off-by: Junio C Hamano gits...@pobox.com --- t/t6050-replace.sh | 40 1 file changed, 40 insertions(+) diff --git a/t/t6050-replace.sh

Re: Potential bug in ls-files (version 1.7.9.5)

2014-07-07 Thread Jonathan Nieder
Hi Hamilton, Hamilton Turner wrote: My project has this directory structure . ├── aspnet │ ├── .gitignore │ ├── __init__.py │ ├── lib │ │ ├── lots of big stuff My aspnet/.gitignore lists lib/*, and git add aspnet/lib/foo reports that this path is ignored. But git

Re: [PATCH v6 09/10] replace: check mergetags when using --graft

2014-07-07 Thread Junio C Hamano
Christian Couder chrisc...@tuxfamily.org writes: When using --graft, with a mergetag in the original commit, we should check that the commit pointed to by the mergetag is still a parent of then new commit we create, otherwise the mergetag could be misleading. If the commit pointed to by the

Re: [PATCH v6 08/10] commit: add for_each_mergetag()

2014-07-07 Thread Junio C Hamano
Christian Couder chrisc...@tuxfamily.org writes: In the same way as there is for_each_ref() to iterate on refs, it might be useful to have for_each_mergetag() to iterate on the mergetags of a given commit. Signed-off-by: Christian Couder chrisc...@tuxfamily.org --- Heh, might be useful is

Re: [PATCH v4 4/4] cache-tree: Write updated cache-tree after commit

2014-07-07 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: diff --git a/builtin/commit.c b/builtin/commit.c index 9cfef6c..5981755 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -342,6 +342,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix,

[PATCH v5 1/4] cache-tree: Create/update cache-tree on checkout

2014-07-07 Thread David Turner
When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. update_main_cache_tree learned a new flag, WRITE_TREE_REPAIR. When WRITE_TREE_REPAIR is set, portions of the cache-tree which do not correspond to existing tree objects are

[PATCH v5 4/4] cache-tree: Write updated cache-tree after commit

2014-07-07 Thread David Turner
During the commit process, update the cache-tree. Write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Make all tests test the entire cache-tree, not just the root level. Signed-off-by: David Turner

[PATCH v5 2/4] test-dump-cache-tree: invalid trees are not errors

2014-07-07 Thread David Turner
Do not treat known-invalid trees as errors even when their subtree_nr is incorrect. Because git already knows that these trees are invalid, an incorrect subtree_nr will not cause problems. Add a couple of comments. Signed-off-by: David Turner dtur...@twitter.com --- test-dump-cache-tree.c | 4

[PATCH v5 3/4] cache-tree: subdirectory tests

2014-07-07 Thread David Turner
Add tests to confirm that invalidation of subdirectories neither over- nor under-invalidates. Signed-off-by: David Turner dtur...@twitter.com --- t/t0090-cache-tree.sh | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/t/t0090-cache-tree.sh

Branch list by date

2014-07-07 Thread Jeremy Apthorp
I built this terribly-written alias because I wanted to see a list of branches by date of commit. The output looks like this: $ git bbd 11 months ago pipette_editor 7 weeks ago ensure-ie-rendering-edge 6 weeks ago strings-yml 5 weeks ago message-when-validation-fails 4 weeks

Re: [PATCH v6 09/10] replace: check mergetags when using --graft

2014-07-07 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com Christian Couder chrisc...@tuxfamily.org writes: When using --graft, with a mergetag in the original commit, we should check that the commit pointed to by the mergetag is still a parent of then new commit we create, otherwise the mergetag could be

Re: [PATCH v6 03/10] replace: add test for --graft

2014-07-07 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com Christian Couder chrisc...@tuxfamily.org writes: Signed-off-by: Christian Couder chrisc...@tuxfamily.org Signed-off-by: Junio C Hamano gits...@pobox.com --- t/t6050-replace.sh | 40 1 file changed, 40

Re: [PATCH v6 08/10] commit: add for_each_mergetag()

2014-07-07 Thread Christian Couder
From: Junio C Hamano gits...@pobox.com Christian Couder chrisc...@tuxfamily.org writes: In the same way as there is for_each_ref() to iterate on refs, it might be useful to have for_each_mergetag() to iterate on the mergetags of a given commit. Signed-off-by: Christian Couder