No fchmd. was: Re: [PATCH 00/14] Add submodule test harness

2014-07-09 Thread Torsten Bögershausen
On 07/09/2014 11:57 PM, Junio C Hamano wrote: Eric Wong writes: Junio C Hamano wrote: Johannes Sixt writes: Am 08.07.2014 21:34, schrieb Jens Lehmann: And Msysgit complains error: fchmod on c:/xxxt/trash directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock

Align git push stderr output to the same as git pull

2014-07-09 Thread Sam McLeod
As per: https://github.com/git/git/pull/100 'For already up-to-date repos return "Already up-to-date" which is the same message git pull returns.' Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part

Re: [PATCH] makefile: add ability to run specific test files

2014-07-09 Thread Junio C Hamano
On Wed, Jul 9, 2014 at 4:49 PM, Keller, Jacob E wrote: > On Wed, 2014-07-09 at 15:59 -0700, Junio C Hamano wrote: >> >> What kind of things are missing, exactly? Perhaps that is something >> you need to fix, instead of mucking with the top-level Makefile. > > It uses the git from my environment i

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote: > +static int parse_sort_string(const char *arg) > +{ > + int sort = 0; > + int flags = 0; > + > + if (*arg == '-') { > + flags |= REVERSE_SORT; > + arg++; > + } > + if (starts_with(arg, "vers

Re: [PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote: > Add support for configuring default sort ordering for git tags. Command > line option will override this configured value, using the exact same > syntax. Thanks, this version looks pretty good to me. A few minor comments: > + if

Re: move detection doesnt take filename into account

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 03:18:43PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I think the hash here does not collide in that way. It really is just > > the last sixteen characters shoved into a uint32_t. > > All bytes overlap with their adjacent byte because they are shifted > by on

Re: [PATCH] makefile: add ability to run specific test files

2014-07-09 Thread Keller, Jacob E
On Wed, 2014-07-09 at 15:59 -0700, Junio C Hamano wrote: > Jacob Keller writes: > > > Running a specific test file manually does not obtain the exact > > environment setup by the Makefile. > > What kind of things are missing, exactly? Perhaps that is something > you need to fix, instead of muck

Re: [PATCH] makefile: add ability to run specific test files

2014-07-09 Thread Junio C Hamano
Jacob Keller writes: > Running a specific test file manually does not obtain the exact > environment setup by the Makefile. What kind of things are missing, exactly? Perhaps that is something you need to fix, instead of mucking with the top-level Makefile. I recall last time when I did a patch

[PATCH] makefile: add ability to run specific test files

2014-07-09 Thread Jacob Keller
Running a specific test file manually does not obtain the exact environment setup by the Makefile. Add ability to run any of the tests in the t/ directory so that a user can more quickly debug a failing test. Otherwise, the entire test suite needs to be run, which can take a vary long time. Signed

[PATCH v2] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jacob Keller
Add support for configuring default sort ordering for git tags. Command line option will override this configured value, using the exact same syntax. Cc: Jeff King Signed-off-by: Jacob Keller --- Repost with changes suggested by Peff. These include fixing documentation to remove duplicatation, a

Re: move detection doesnt take filename into account

2014-07-09 Thread Junio C Hamano
Jeff King writes: > I think the hash here does not collide in that way. It really is just > the last sixteen characters shoved into a uint32_t. All bytes overlap with their adjacent byte because they are shifted by only 2 bits, not 8 bits, when a new byte is brought in. We can say that the topm

Re: [PATCH] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 10:07:20PM +, Keller, Jacob E wrote: > I only noticed the sort recently, and I first tried to add an alias like > "tag = tag --sort=v:refname" but git didn't pick up the alias of the > name already. It was only added recently (v2.0.0). :) As you noticed, we do not all

Re: [PATCH] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Keller, Jacob E
On Wed, 2014-07-09 at 17:58 -0400, Jeff King wrote: > On Wed, Jul 09, 2014 at 02:21:00PM -0700, Jacob Keller wrote: > > > Add support for configuring default sort ordering for git tags. Command > > line option will override this configured value, using the exact same > > syntax. > > This makes se

Re: [PATCH v2 3/4] use new config API for worktree configurations of submodules

2014-07-09 Thread Junio C Hamano
Heiko Voigt writes: > On Tue, Jul 08, 2014 at 01:14:20PM -0700, Junio C Hamano wrote: >> Heiko Voigt writes: >> >> > diff --git a/builtin/checkout.c b/builtin/checkout.c >> > index 07cf555..03ea20d 100644 >> > --- a/builtin/checkout.c >> > +++ b/builtin/checkout.c >> > @@ -18,6 +18,7 @@ >> > #

Re: move detection doesnt take filename into account

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 08:51:07AM -0700, Junio C Hamano wrote: > > The delta heuristics in pack-objects use pack_name_hash, which claims: > > > > /* > > * This effectively just creates a sortable number from the > > * last sixteen non-whitespace characters. Last characte

Re: [PATCH] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 02:21:00PM -0700, Jacob Keller wrote: > Add support for configuring default sort ordering for git tags. Command > line option will override this configured value, using the exact same > syntax. This makes sense, and was something I was expecting to add once tag and branch

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

2014-07-09 Thread Junio C Hamano
Eric Wong writes: > Junio C Hamano wrote: >> Johannes Sixt writes: >> > Am 08.07.2014 21:34, schrieb Jens Lehmann: >> >>> And Msysgit complains >> >>> error: fchmod on c:/xxxt/trash >> >>> directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock >> >>> failed: Func

[PATCH 2/3] remote-curl: use error instead of fprintf(stderr)

2014-07-09 Thread Jeff King
We usually prefix our error messages with "error: ", but many error messages from remote-curl are simply printed with fprintf. This can make the output a little harder to read (especially because such message may be intermingled with errors from the parent git process). There is no reason to avoid

[PATCH 3/3] remote-curl: mark helper-protocol errors more clearly

2014-07-09 Thread Jeff King
When we encounter an error in remote-curl, we generally just report it to stderr. There is no need for the user to care that the "could not connect to server" error was generated by git-remote-https rather than a function in the parent git-fetch process. However, when the error is in the protocol

[PATCH 1/3] remote-curl: do not complain on EOF from parent git

2014-07-09 Thread Jeff King
The parent git process is supposed to send us an empty line to indicate that the conversation is over. However, the parent process may die() if there is a problem with the operation (e.g., we try to fetch a ref that does not exist). In this case, it produces a useful message, but then remote-curl _

Re: [PATCH] remote-curl: do not complain on EOF from parent git

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 09:25:18PM +, Keller, Jacob E wrote: > On Wed, 2014-07-09 at 17:20 -0400, Jeff King wrote: > > The parent git process is supposed to send us an empty line > > to indicate that the conversation is over. However, the > > parent process may die() if there is a problem with

Re: [PATCH] remote-curl: do not complain on EOF from parent git

2014-07-09 Thread Keller, Jacob E
On Wed, 2014-07-09 at 17:20 -0400, Jeff King wrote: > The parent git process is supposed to send us an empty line > to indicate that the conversation is over. However, the > parent process may die() if there is a problem with the > operaiton (e.g., we try to fetch a ref that does not exist). Nitp

[PATCH] tag: support configuring --sort via .gitconfig

2014-07-09 Thread Jacob Keller
Add support for configuring default sort ordering for git tags. Command line option will override this configured value, using the exact same syntax. Cc: Nguyễn Thái Ngọc Duy Cc: Junio C Hamano Signed-off-by: Jacob Keller --- Documentation/config.txt | 7 +++ Documentation/git-tag.txt |

[PATCH] remote-curl: do not complain on EOF from parent git

2014-07-09 Thread Jeff King
The parent git process is supposed to send us an empty line to indicate that the conversation is over. However, the parent process may die() if there is a problem with the operaiton (e.g., we try to fetch a ref that does not exist). In this case, it produces a useful message, but then remote-curl _

Re: t3200-branch.sh number 102 fails when run under make test

2014-07-09 Thread Keller, Jacob E
On Wed, 2014-07-09 at 16:54 -0400, Jeff King wrote: > On Wed, Jul 09, 2014 at 08:37:51PM +, Keller, Jacob E wrote: > > > I recently cloned the master branch of the git repo, and when I ran make > > test, it fails on test 102 of the t3200-branch.sh test cases. > > Just a guess, but try reverti

Re: "Unexpected end of command stream" message looks irrelevant when I try to pull a non-existing branch

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 11:37:51AM +0400, Dmitry wrote: > I'm using Git 1.8.1 and when I run the following command: > > git pull origin matser > > I get the following output: > > fatal: couldn't find remote ref matser > Unexpected end of command stream > > The first line in the output is right

Re: t3200-branch.sh number 102 fails when run under make test

2014-07-09 Thread Keller, Jacob E
On Wed, 2014-07-09 at 13:37 -0700, Jacob E Keller wrote: > Hello, > > I recently cloned the master branch of the git repo, and when I ran make > test, it fails on test 102 of the t3200-branch.sh test cases. > > not ok 102 - tracking with unexpected .fetch refspec > # > # rm -rf a b

Re: t3200-branch.sh number 102 fails when run under make test

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 08:37:51PM +, Keller, Jacob E wrote: > I recently cloned the master branch of the git repo, and when I ran make > test, it fails on test 102 of the t3200-branch.sh test cases. Just a guess, but try reverting 745224e (refs.c: SSE2 optimizations for check_refname_compone

t3200-branch.sh number 102 fails when run under make test

2014-07-09 Thread Keller, Jacob E
Hello, I recently cloned the master branch of the git repo, and when I ran make test, it fails on test 102 of the t3200-branch.sh test cases. not ok 102 - tracking with unexpected .fetch refspec # # rm -rf a b c d && # git init a && # ( #

Re: No fchmod() under msygit - Was: Re: [PATCH 00/14] Add submodule test harness

2014-07-09 Thread Eric Wong
Torsten Bögershausen wrote: > (And why is it "& 0" and not "& 0777") This is to preserve the uncommon sticky/sgid/suid bits. Probably not needed, but better to keep as much intact as possible. > Can we avoid the fchmod() all together ? For single-user systems, sure. For multi-user syst

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

2014-07-09 Thread Eric Wong
Junio C Hamano wrote: > Johannes Sixt writes: > > Am 08.07.2014 21:34, schrieb Jens Lehmann: > >>> And Msysgit complains > >>> error: fchmod on c:/xxxt/trash > >>> directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock > >>> failed: Function not implemented > >> >

Re: Re: [PATCH v2 3/4] use new config API for worktree configurations of submodules

2014-07-09 Thread Heiko Voigt
On Tue, Jul 08, 2014 at 01:14:20PM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > diff --git a/builtin/checkout.c b/builtin/checkout.c > > index 07cf555..03ea20d 100644 > > --- a/builtin/checkout.c > > +++ b/builtin/checkout.c > > @@ -18,6 +18,7 @@ > > #include "xdiff-interface.h" > >

[PATCH v2 1/2] t/Makefile: check helper scripts for non-portable shell commands too

2014-07-09 Thread Jens Lehmann
Currently only the "t[0-9][0-9][0-9][0-9]-*.sh" scripts are tested for shell incompatibilities using the check-non-portable-shell.pl script. This makes it easy to miss non-POSIX constructs added to one of the t/*lib*.sh helper scripts, as they aren't automatically detected. Fix that by adding a TH

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

2014-07-09 Thread Jens Lehmann
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 to avoid twisted shell scripting by developers only to avoid false positives that might result from

[PATCH v2 0/2] always run all lint targets when running the test suite

2014-07-09 Thread Jens Lehmann
Am 09.07.2014 07:42, schrieb Junio C Hamano: > On Tue, Jul 8, 2014 at 12:24 PM, Jens Lehmann wrote: >> >> Am 07.07.2014 20:13, schrieb Junio C Hamano: >>> >>> So I am not very enthusiastic to see this change myself. >> >> Ok, I understand we do not want to lightly risk false positives. I >> just n

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

2014-07-09 Thread Junio C Hamano
Jens Lehmann writes: > I agree, but this case is special. The test asserts that nobody > added, modified or removed *anything* inside the .git directory. > The reason for problem we are seeing here is that I have to > remove the core.worktree setting when moving the git directory > from .git/modu

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

2014-07-09 Thread Junio C Hamano
Johannes Sixt writes: > Am 08.07.2014 21:34, schrieb Jens Lehmann: >>> And Msysgit complains >>> error: fchmod on c:/xxxt/trash >>> directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock >>> failed: Function not implemented >> >> I'm not sure what this is about, s

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

2014-07-09 Thread Jens Lehmann
Am 09.07.2014 08:14, schrieb Torsten Bögershausen: > >>> There seems to be some other trouble under Mac OS, not yet fully tracked >>> down, >>> (may be related to the "diff -r") >> Torsten sees failures of this kind under Mac OS: >> >> diff -r .git/modules/sub1/config sub1/.git/config >> 6d5 >> <

Re: [PATCH RFC v2 02/19] rebase -i: reword complains about empty commit despite --keep-empty

2014-07-09 Thread Fabian Ruch
Junio C Hamano writes: > Fabian Ruch writes: >> Subject: rebase -i: reword complains about empty commit despite --keep-empty > > I had to read the title and then the log twice before understanding > that the above is not "change the complaint message" (i.e. "reword > complaints" spelled incorrect

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

2014-07-09 Thread Junio C Hamano
Junio C Hamano writes: >> * Still, making sure that the (file, line) is doable later without too >> much change is good. So, if indeed, moving all code to another file is >> required, then it may make sense to do it now to avoid code move >> later. > > Good thinking. As long as the code is

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

2014-07-09 Thread Johannes Sixt
Am 08.07.2014 21:34, schrieb Jens Lehmann: >> And Msysgit complains >> error: fchmod on c:/xxxt/trash >> directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock >> failed: Function not implemented > > I'm not sure what this is about, seems to happen during the "cp -R

Re: [PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-09 Thread Junio C Hamano
Karsten Blees writes: > 'git status' segfaults if a directory is longer than PATH_MAX, because > processing .gitignore files in prep_exclude() writes past the end of a > PATH_MAX-bounded buffer. > > Remove the limitation by using strbuf instead. > > Note: this fix just 'abuses' strbuf as string a

Re: [PATCH RFC v2 00/19] Enable options --signoff, --reset-author for pick, reword

2014-07-09 Thread Fabian Ruch
On 07/08/2014 10:45 PM, Junio C Hamano wrote: > Fabian Ruch writes: >> Fabian Ruch (19): >> rebase -i: Failed reword prints redundant error message >> rebase -i: reword complains about empty commit despite --keep-empty >> rebase -i: reword executes pre-commit hook on interim commit >> reba

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

2014-07-09 Thread Tanay Abhra
On 7/9/2014 7:49 PM, Matthieu Moy wrote: > Tanay Abhra writes: > > > My opinion on this: > > * It's low priority. I think the order of priority should be (high to > low) > > 1) Finish and get the current series into pu (we're almost there, it's > not time to back off and restart somet

Re: move detection doesnt take filename into account

2014-07-09 Thread Junio C Hamano
Jeff King writes: > On Tue, Jul 01, 2014 at 10:08:15AM -0700, Junio C Hamano wrote: > >> I didn't think it through but my gut feeling is that we could change >> the name similarity score to be the length of the tail part that >> matches (e.g. 1.a to a/2.a that has the same two bytes at the tail >

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

2014-07-09 Thread Junio C Hamano
Torsten Bögershausen writes: > A "brute force" approach could be to simply run the config file(s) > through sort and compare them: > > sort <.git/modules/sub1/config >expect && > sort actual && > test_cmp expect actual && Or "git config --list" from these files, perhaps? -- To unsubscribe from t

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

2014-07-09 Thread Junio C Hamano
Matthieu Moy writes: > My opinion on this: > > * It's low priority. I think the order of priority should be (high to > low) > > 1) Finish and get the current series into pu (we're almost there, it's > not time to back off and restart something new). > > 2) Work on the other series that

Re: [PATCH] enums: remove trailing ',' after last item in enum

2014-07-09 Thread Junio C Hamano
Ronnie Sahlberg writes: > Signed-off-by: Ronnie Sahlberg > --- Looks good; thanks. > builtin/clean.c | 2 +- > builtin/tag.c | 2 +- > pretty.c| 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/builtin/clean.c b/builtin/clean.c > index 9a91515..27701d2 10064

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

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

Re: t5150-request-pull.sh fails on newest master in Debian

2014-07-09 Thread René Scharfe
Am 09.07.2014 03:18, schrieb David Turner: On Wed, 2014-07-09 at 02:52 +0200, Øyvind A. Holm wrote: On 3 July 2014 23:55, Øyvind A. Holm wrote: When compiling newest master (v2.0.1-472-g6f92e5f) on Debian 7.5 (64-bit), t5150-request-pull.sh fails when compiling with $ make configure $ ./confi

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

2014-07-09 Thread Matthieu Moy
Tanay Abhra writes: > Also, I tried implementing Junio's request about saving the line > number and the file name for each > key-value pair. I had some success, but with some changes, My opinion on this: * It's low priority. I think the order of priority should be (high to low) 1) Finish a

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

2014-07-09 Thread Tanay Abhra
On 7/9/2014 5:43 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> +test_expect_success 'find value with misspelled key' ' >> +test_must_fail check "my.fOo Bar.hi" "Value not found for \"my.fOo >> Bar.hi\"" >> +' > > Sorry, this is still not right. You're checking that either test-config

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

2014-07-09 Thread Tanay Abhra
On 7/9/2014 5:42 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> diff --git a/Documentation/technical/api-config.txt >> b/Documentation/technical/api-config.txt >> index 230b3a0..65a6717 100644 >> --- a/Documentation/technical/api-config.txt >> +++ b/Documentation/technical/api-config.txt >

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

2014-07-09 Thread Matthieu Moy
Tanay Abhra writes: > diff --git a/Documentation/technical/api-config.txt > b/Documentation/technical/api-config.txt > index 230b3a0..65a6717 100644 > --- a/Documentation/technical/api-config.txt > +++ b/Documentation/technical/api-config.txt > +`int git_config_get_bool(const char *key, int *de

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

2014-07-09 Thread Matthieu Moy
Tanay Abhra writes: > +test_expect_success 'find value with misspelled key' ' > + test_must_fail check "my.fOo Bar.hi" "Value not found for \"my.fOo > Bar.hi\"" > +' Sorry, this is still not right. You're checking that either test-config OR test_cmp fails. You want to check both. Basically

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

2014-07-09 Thread Matthieu Moy
Tanay Abhra writes: > On 7/7/2014 10:34 PM, Matthieu Moy wrote: >> Tanay Abhra 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 >>> +test_expect_success 'setup defau

Re: [PATCH] refs.c: handle REFNAME_REFSPEC_PATTERN at end of page

2014-07-09 Thread Øyvind A . Holm
On 7 July 2014 20:05, Junio C Hamano wrote: > David Turner writes: > > When a ref crosses a memory page boundary, we restart the parsing at > > the beginning with the bytewise code. Pass the original flags to > > that code, rather than the current flags. > > Good. I've run the whole test suite

Re: t5150-request-pull.sh fails on newest master in Debian

2014-07-09 Thread Øyvind A . Holm
On 9 July 2014 03:18, David Turner wrote: > On Wed, 2014-07-09 at 02:52 +0200, Øyvind A. Holm wrote: > > On 3 July 2014 23:55, Øyvind A. Holm wrote: > > > When compiling newest master (v2.0.1-472-g6f92e5f) on Debian 7.5 > > > (64-bit), t5150-request-pull.sh fails when compiling with > > > [snip]

Re: [PATCH v6 27/32] prune: strategies for linked checkouts

2014-07-09 Thread Eric Sunshine
On Wed, Jul 9, 2014 at 3:33 AM, Nguyễn Thái Ngọc Duy wrote: > (alias R=$GIT_COMMON_DIR/repos/) > > - linked checkouts are supposed to keep its location in $R/gitdir up >to date. The use case is auto fixup after a manual checkout move. > > - linked checkouts are supposed to update mtime of $R

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

2014-07-09 Thread Tanay Abhra
On 7/7/2014 10:34 PM, Matthieu Moy wrote: > Tanay Abhra 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 >> +test_expect_success 'setup default config' ' >> +cat >.git

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

2014-07-09 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 --- .gitignore| 1 + Makefile | 1 + t/t1308

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

2014-07-09 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 `con

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

2014-07-09 Thread Tanay Abhra
Hi, [PATCH V7]: Style nits and a broken && chain corrected in `t/t1308-config-set.sh`. See [9] for the nits. [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]: `con

Re: [PATCH] http: Add Accept-Language header if possible

2014-07-09 Thread Peter Krefting
Jeff King: I did some digging, and I think the public API is setlocale with a NULL parameter, like: printf("%s\n", setlocale(LC_MESSAGES, NULL)); That still will end up like "en_US.UTF-8", though; And it only yields the highest-priority language, I think. I couldn't find any standard func

Re: [PATCH] http: Add Accept-Language header if possible

2014-07-09 Thread Peter Krefting
Yi EungJun: Example: LANGUAGE= -> "" LANGUAGE=ko -> "Accept-Language: ko; q=1.000, *; q=0.001" LANGUAGE=ko:en -> "Accept-Language: ko; q=1.000, en; q=0.999, *; q=0.001" Avoid adding "q=1.000". It is redundant (the default for any unqualified language names is 1.0, and additionally there ha

Re: [PATCH v6 29/32] gc: support prune --repos

2014-07-09 Thread Eric Sunshine
On Wed, Jul 9, 2014 at 3:33 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > Documentation/config.txt | 7 +++ > builtin/gc.c | 17 + > 2 files changed, 24 insertions(+) > > diff --git a/Documentation/config.txt b/Documentation/config

Re: [PATCH v6 28/32] gc: style change -- no SP before closing bracket

2014-07-09 Thread Eric Sunshine
On Wed, Jul 9, 2014 at 3:33 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > builtin/gc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/builtin/gc.c b/builtin/gc.c > index 8d219d8..53f1302 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.

"Unexpected end of command stream" message looks irrelevant when I try to pull a non-existing branch

2014-07-09 Thread Dmitry
Hi, I'm using Git 1.8.1 and when I run the following command: git pull origin matser I get the following output: fatal: couldn't find remote ref matser Unexpected end of command stream The first line in the output is right on the money but the second one looks completely irrelevant - the comm

[PATCH v6 30/32] count-objects: report unused files in $GIT_DIR/repos/...

2014-07-09 Thread Nguyễn Thái Ngọc Duy
In linked checkouts, borrowed parts like config is taken from $GIT_COMMON_DIR. $GIT_DIR/config is never used. Report them as garbage. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/count-objects.c | 4 +++- cache.h | 1 + path.c | 29 ++

[PATCH v6 32/32] checkout: don't require a work tree when checking out into a new one

2014-07-09 Thread Nguyễn Thái Ngọc Duy
From: Dennis Kaarsemaker For normal use cases, it does not make sense for 'checkout' to work on a bare repository, without a worktree. But "checkout --to" is an exception because it _creates_ a new worktree. Allow this option to run on bare repositories. People who check out from a bare reposito

[PATCH v6 29/32] gc: support prune --repos

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config.txt | 7 +++ builtin/gc.c | 17 + 2 files changed, 24 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index 286e539..470f979 100644 --- a/Documentation/config.txt +++ b/Do

[PATCH v6 31/32] git_path(): keep "info/sparse-checkout" per work-tree

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Currently git_path("info/sparse-checkout") resolves to $GIT_COMMON_DIR/info/sparse-checkout in multiple worktree mode. It makes more sense for the sparse checkout patterns to be per worktree, so you can have multiple checkouts with different parts of the tree. With this, "git checkout --to " on a

[PATCH v6 24/32] checkout: support checking out into a new working directory

2014-07-09 Thread Nguyễn Thái Ngọc Duy
"git checkout --to" sets up a new working directory with a .git file pointing to $GIT_DIR/repos/. It then executes "git checkout" again on the new worktree with the same arguments except "--to" is taken out. The second checkout execution, which is not contaminated with any info from the current rep

[PATCH v6 23/32] use new wrapper write_file() for simple file writing

2014-07-09 Thread Nguyễn Thái Ngọc Duy
This fixes common problems in these code about error handling, forgetting to close the file handle after fprintf() fails, or not printing out the error string.. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/branch.c | 4 +--- builtin/init-db.c | 7 +-- daemon.c | 11 +--

[PATCH v6 26/32] checkout: detach if the branch is already checked out elsewhere

2014-07-09 Thread Nguyễn Thái Ngọc Duy
The normal rule is anything outside refs/heads/ is detached. This increases strictness of the rule a bit more: if the branch is checked out (either in $GIT_COMMON_DIR/HEAD or any $GIT_DIR/repos/.../HEAD) then it's detached as well. A hint is given so the user knows where to go and do something the

[PATCH v6 25/32] checkout: clean up half-prepared directories in --to mode

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 49 +++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 7df586a..5a52da4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c

[PATCH v6 28/32] gc: style change -- no SP before closing bracket

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 8d219d8..53f1302 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -285,7 +285,7 @@ int cmd_gc(int argc, const char **argv, const char *pref

[PATCH v6 22/32] wrapper.c: wrapper to open a file, fprintf then close

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 2 ++ wrapper.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/cache.h b/cache.h index e7dd5ce..b363c00 100644 --- a/cache.h +++ b/cache.h @@ -1355,6 +1355,8 @@ static inline ssize_t write_str_in_full(int

[PATCH v6 27/32] prune: strategies for linked checkouts

2014-07-09 Thread Nguyễn Thái Ngọc Duy
(alias R=$GIT_COMMON_DIR/repos/) - linked checkouts are supposed to keep its location in $R/gitdir up to date. The use case is auto fixup after a manual checkout move. - linked checkouts are supposed to update mtime of $R/gitdir. If $R/gitdir's mtime is older than a limit, and it points t

[PATCH v6 18/32] setup.c: detect $GIT_COMMON_DIR in is_git_directory()

2014-07-09 Thread Nguyễn Thái Ngọc Duy
If the file "$GIT_DIR/commondir" exists, it contains the value of $GIT_COMMON_DIR. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitrepository-layout.txt | 7 ++ setup.c| 43 +- 2 files changed, 44 insertions(+), 6 dele

[PATCH v6 19/32] setup.c: convert check_repository_format_gently to use strbuf

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.c b/setup.c index 176d505..a17389f 100644 --- a/setup.c +++ b/setup.c @@ -342,7 +342,9 @@ void setup_work_tree(void) static int check_repository_format_gently(

[PATCH v6 21/32] setup.c: support multi-checkout repo setup

2014-07-09 Thread Nguyễn Thái Ngọc Duy
The repo setup procedure is updated to detect $GIT_DIR/commondir and set $GIT_COMMON_DIR properly. The core.worktree is ignored when $GIT_COMMON_DIR is set. This is because the config file is shared in multi-checkout setup, but checkout directories _are_ different. Making core.worktree effective i

[PATCH v6 20/32] setup.c: detect $GIT_COMMON_DIR check_repository_format_gently()

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index a17389f..79f79f2 100644 --- a/setup.c +++ b/setup.c @@ -346,6 +346,10 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)

[PATCH v6 16/32] git-stash: avoid hardcoding $GIT_DIR/logs/....

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git-stash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 393e1ec..41f8f6b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7 +184,7 @@ store_stash () { fi # Make sure the re

[PATCH v6 17/32] setup.c: convert is_git_directory() to use strbuf

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/setup.c b/setup.c index 0a22f8b..425fd79 100644 --- a/setup.c +++ b/setup.c @@ -238,31 +238,36 @@ void verify_non_filename(const char *prefix

[PATCH v6 09/32] *.sh: respect $GIT_INDEX_FILE

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- git-pull.sh | 2 +- git-stash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-pull.sh b/git-pull.sh index 18a394f..6ab0c31 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -240,7 +240,7 @@ test true = "$rebase" && { if !

[PATCH v6 10/32] reflog: avoid constructing .lock path with git_path

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Among pathnames in $GIT_DIR, e.g. "index" or "packed-refs", we want to automatically and silently map some of them to the $GIT_DIR of the repository we are borrowing from via $GIT_COMMON_DIR mechanism. When we formulate the pathname for its lockfile, we want it to be in the same location as its fi

[PATCH v6 08/32] git_path(): be aware of file relocation in $GIT_DIR

2014-07-09 Thread Nguyễn Thái Ngọc Duy
We allow the user to relocate certain paths out of $GIT_DIR via environment variables, e.g. GIT_OBJECT_DIRECTORY, GIT_INDEX_FILE and GIT_GRAFT_FILE. Callers are not supposed to use git_path() or git_pathdup() to get those paths. Instead they must use get_object_directory(), get_index_file() and get

[PATCH v6 15/32] *.sh: avoid hardcoding $GIT_DIR/hooks/...

2014-07-09 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, it should be $GIT_COMMON_DIR/hooks/, not $GIT_DIR/hooks/. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy --- git-am.sh | 22 +++--- git-rebase--interactive.sh | 6 +++--- git-rebase

[PATCH v6 11/32] fast-import: use git_path() for accessing .git dir instead of get_git_dir()

2014-07-09 Thread Nguyễn Thái Ngọc Duy
This allows git_path() to redirect info/fast-import to another place if needed Signed-off-by: Nguyễn Thái Ngọc Duy --- fast-import.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast-import.c b/fast-import.c index c74ea15..e8ec34d 100644 --- a/fast-import.c +++ b/fast-

[PATCH v6 14/32] git-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objects

2014-07-09 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, $GIT_OBJECT_DIRECTORY should be $GIT_COMMON_DIR/objects, not $GIT_DIR/objects. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy --- git-sh-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-sh-setup.sh b/git-sh-

[PATCH v6 12/32] commit: use SEQ_DIR instead of hardcoding "sequencer"

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/commit.c b/builtin/commit.c index 84cec9a..9f2aba3 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -156,7 +156,7 @@ static void determine_whence(struct wt_s

[PATCH v6 13/32] $GIT_COMMON_DIR: a new environment variable

2014-07-09 Thread Nguyễn Thái Ngọc Duy
This variable is intended to support multiple working directories attached to a repository. Such a repository may have a main working directory, created by either "git init" or "git clone" and one or more linked working directories. These working directories and the main repository share the same r

[PATCH v6 00/32] Support multiple checkouts

2014-07-09 Thread Nguyễn Thái Ngọc Duy
This is basically a reroll from what was parked on 'pu' with two new patches at the end: one to not share info/sparse-checkout across worktrees, and one to allow 'checkout --to` from a bare repository. I cherry-picked two patches from jk/xstrfmt (on next) because they result in non-trivial conflic

[PATCH v6 05/32] path.c: group git_path(), git_pathdup() and strbuf_git_path() together

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/path.c b/path.c index 2cb2e61..65881aa 100644 --- a/path.c +++ b/path.c @@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)

[PATCH v6 01/32] path.c: make get_pathname() return strbuf instead of static buffer

2014-07-09 Thread Nguyễn Thái Ngọc Duy
We've been avoiding PATH_MAX whenever possible. This patch makes get_pathname() return a strbuf and updates the callers to take advantage of this. The code is simplified as we no longer need to worry about buffer overflow. vsnpath() behavior is changed slightly: previously it always clears the buf

[PATCH v6 04/32] path.c: rename vsnpath() to do_git_path()

2014-07-09 Thread Nguyễn Thái Ngọc Duy
The name vsnpath() gives an impression that this is general path handling function. It's not. This is the underlying implementation of git_path(), git_pathdup() and strbuf_git_path() which will prefix $GIT_DIR in the result string. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 8 1 f

[PATCH v6 06/32] setup_git_env: use git_pathdup instead of xmalloc + sprintf

2014-07-09 Thread Nguyễn Thái Ngọc Duy
From: Jeff King This is shorter, harder to get wrong, and more clearly captures the intent. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- environment.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/environmen

[PATCH v6 07/32] setup_git_env(): introduce git_path_from_env() helper

2014-07-09 Thread Nguyễn Thái Ngọc Duy
From: Jeff King "Check the value of an environment and fall back to a known path inside $GIT_DIR" is repeated a few times to determine the location of the data store, the index and the graft file, but the return value of getenv is not guaranteed to survive across further invocations of setenv or

[PATCH v6 02/32] path.c: make get_pathname() call sites return const char *

2014-07-09 Thread Nguyễn Thái Ngọc Duy
Before the previous commit, get_pathname returns an array of PATH_MAX length. Even if git_path() and similar functions does not use the whole array, git_path() caller can, in theory. After the commit, get_pathname() may return a buffer that has just enough room for the returned string and git_path

  1   2   >