Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-13 Thread Jeremiah Mahler
Peff, On Fri, Jun 13, 2014 at 03:15:50AM -0400, Jeff King wrote: > On Thu, Jun 12, 2014 at 04:46:37PM -0700, Jeremiah Mahler wrote: > > > > Although strbuf_set() does make the code a bit easier to read > > > when strbufs are repeatedly re-used, re-using a variable for > > > different

Re: [PATCH v5 0/4] commit: Add commit.verbose configuration

2014-06-13 Thread Jeremiah Mahler
On Fri, Jun 13, 2014 at 11:49:10AM -0500, Caleb Thompson wrote: > On Thu, Jun 12, 2014 at 01:30:10PM -0700, Jeremiah Mahler wrote: > > On Thu, Jun 12, 2014 at 02:38:58PM -0500, Caleb Thompson wrote: > > > This patch allows people to set commit.verbose to implicitly send > > > --verbose to git-commi

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Pasha Bolokhov
Thanks for the fix. I knew these backslashes could cause trouble. No doubt the fixed version reads better than a hundred backslashes On Fri, Jun 13, 2014 at 4:25 PM, Jeff King wrote: > On Fri, Jun 13, 2014 at 01:23:47PM -0700, Junio C Hamano wrote: > >> This passes with your shell set to dash bu

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 10:42:26AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > [1] It might make sense for test_set_editor, when run from within a > > test, to behave more like test_config, and do: > > > > test_when_finished ' > > sane_unset FAKE_EDITOR && > >

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 11:36:44AM -0500, Caleb Thompson wrote: > > Or did you just mean that the new rule is "every test sets the editor as > > they need", which means that we do not have to worry anymore about > > polluting the environment for other tests? > > That's exactly what I meant. We ca

Re: [PATCH v5 2/4] commit test: Use write_script

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 11:26:07AM -0500, Caleb Thompson wrote: > You're very right - I may have confused this commit message and the one > to switch to test_set_editor. I'll rewrite this commit message. > > What do you think of something like this for the description: > > Use write_script f

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 01:23:47PM -0700, Junio C Hamano wrote: > This passes with your shell set to dash but fails with bash. > > Let's fix it up like so. Thanks, I should have been more suspicious of the combination of backslashes and echo during review. :) > diff --git a/t/t0008-ignores.sh b

Re: [PATCH 0/5] submodule config lookup API

2014-06-13 Thread Heiko Voigt
On Thu, Jun 12, 2014 at 02:59:23PM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > t/t7410-submodule-config.sh | 141 > > We already use 7410 for something else in 'pu'; please avoid dups > waiting to happen. Sorry about that. Should I use 7411 even though

Re: [PATCH 2/5] implement submodule config cache for lookup of submodule names

2014-06-13 Thread Heiko Voigt
On Thu, Jun 12, 2014 at 02:58:20PM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > ... > > +static int is_cache_init = 0; > > Please don't initialise variables in the .bss to zero by hand. Ok will remove that. > > + ... > > + warning("%s:.gitmodules, multiple configurations found fo

Re: Our merge bases sometimes suck

2014-06-13 Thread Junio C Hamano
Jakub Narębski writes: > I don't know if it has been fixed, but there is a difference > between "git diff A...B" when A and B have one merge base, and > "git diff A...B" when there are more than one merge base. > > When there is one merge base, "git diff A...B" returns simple > unified diff equiv

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Ronnie Sahlberg
On Fri, Jun 13, 2014 at 2:11 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> ... The first >> backend will be the current files based structure but I also will add >> an optional backend using a TDB database. > > I am assuming that as part of the transactions work, accesses to > reflogs

Re: Our merge bases sometimes suck

2014-06-13 Thread Michael Haggerty
On 06/13/2014 05:52 PM, Jakub Narębski wrote: > I don't know if it has been fixed, but there is a difference > between "git diff A...B" when A and B have one merge base, and > "git diff A...B" when there are more than one merge base. > > When there is one merge base, "git diff A...B" returns simpl

[PATCH 7/6] Win32: reliably detect console pipe handles

2014-06-13 Thread Karsten Blees
As of "Win32: Thread-safe windows console output", child processes may print to the console even if stdout has been redirected to a file. E.g.: git config tar.cat.command "cat" git archive -o test.cat HEAD Detecting whether stdout / stderr point to our console pipe is currently based on the ass

Re: [PATCH 2/2] blame: simplify prepare_lines()

2014-06-13 Thread Jonathan Nieder
Hi, René Scharfe wrote: > There is no need to look at the caller -- the contents of the lineno > array is not (intended to be) changed by the patch. Ah. If there is no incomplete line, the 'p < end' condition trips and it doesn't try to record the nonexistent incomplete line. Thanks for explai

[PATCH] gitk: use mktemp -d to avoid predictable temporary directories

2014-06-13 Thread David Aguilar
gitk uses a predictable ".gitk-tmp.$PID" pattern when generating a temporary directory. Use "mktemp -d .gitk-tmp.XX" to harden gitk against someone seeding /tmp with files matching the pid pattern. Signed-off-by: David Aguilar --- This issue was brought up during the first review of the prev

Re: [PATCH 2/2] blame: simplify prepare_lines()

2014-06-13 Thread René Scharfe
Am 13.06.2014 23:13, schrieb Jonathan Nieder: René Scharfe wrote: - if (incomplete) - *lineno++ = len; + *lineno = len; - sb->num_lines = num + incomplete; + sb->num_lines = num; This will always treat whatever comes after the last newline as an incomple

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Junio C Hamano
Ronnie Sahlberg writes: > It gets even more hairy : > If the server has A/a and a/b and you clone it it becomes A/a and A/b > locally. Then you push back to the server and you end up with three > refs on the server: A/a A/b and a/b. That is part of the transition in deployment. David who wants

Re: [PATCH 2/2] blame: simplify prepare_lines()

2014-06-13 Thread Jonathan Nieder
René Scharfe wrote: > - if (incomplete) > - *lineno++ = len; > + *lineno = len; > > - sb->num_lines = num + incomplete; > + sb->num_lines = num; This will always treat whatever comes after the last newline as an incomplete line, even if it has zero length. Is that s

[PATCH] gitk: honor TMPDIR when viewing external diffs

2014-06-13 Thread David Aguilar
gitk fails to show diffs when browsing a read-only repository. This is due to gitk's assumption that the current directory is always writable. Teach gitk to honor either the GITK_TMPDIR or TMPDIR environment variables. This allows users to override the default location used when writing temporary

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Junio C Hamano
Ronnie Sahlberg writes: > ... The first > backend will be the current files based structure but I also will add > an optional backend using a TDB database. I am assuming that as part of the transactions work, accesses to reflogs will also have their own backends? > You could then very easily cr

Re: [PATCH 1/2] blame: factor out get_next_line()

2014-06-13 Thread Jonathan Nieder
René Scharfe wrote: > Signed-off-by: Rene Scharfe > --- > builtin/blame.c | 28 ++-- > 1 file changed, 10 insertions(+), 18 deletions(-) Reviewed-by: Jonathan Nieder [...] > + for (p = get_next_line(buf, end); p; p = get_next_line(p, end)) > + num++; T

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Junio C Hamano
Pasha Bolokhov writes: > diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh > index 63beb99..5ef5ad3 100755 > --- a/t/t0008-ignores.sh > +++ b/t/t0008-ignores.sh > @@ -806,4 +806,27 @@ test_expect_success !MINGW 'quoting allows trailing > whitespace' ' > test_cmp err.expect err > ' >

[PATCH 2/2] blame: simplify prepare_lines()

2014-06-13 Thread René Scharfe
Changing get_next_line() to return the end pointer instead of NULL in case no newline character is found treats allows us to treat complete and incomplete lines the same, simplifying the code. Switching to counting lines instead of EOLs allows us to start counting at the first character, instead o

[PATCH 1/2] blame: factor out get_next_line()

2014-06-13 Thread René Scharfe
Move the code for finding the start of the next line into a helper function in order to reduce duplication. Signed-off-by: Rene Scharfe --- builtin/blame.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index a

Re: [PATCH 1/2] remotes.c: update calls to new signature for repack_without_refs

2014-06-13 Thread Ronnie Sahlberg
It should have been in [PATCH v16 08/48] refs.c: add an err argument to repack_without_refs but it is not. It must have gone AWOL during one of the many conflicts. It should be there nevertheless since we change the signature for this function in this patch. On Fri, Jun 13, 2014 at 12:40 PM, Jun

Re: [PATCH 1/2] remotes.c: update calls to new signature for repack_without_refs

2014-06-13 Thread Junio C Hamano
Ronnie Sahlberg writes: > This should be merged into patch: > 00c74db refs.c: add an err argument to repack_without_refs > > Signed-off-by: Ronnie Sahlberg > --- > builtin/remote.c | 5 +++-- > refs.h | 3 ++- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/builtin

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Ronnie Sahlberg
Thinking about it more. I think we want to wait until the ref transaction API work is finished. The ref transactions API is in progress and it aims to add transactions for ref updates as a first step but then it aims to define a public API for all public ref functions. As part of that I will also

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Jakub Narębski
W dniu 2014-06-13 19:47, Caleb Thompson pisze: On Fri, Jun 13, 2014 at 07:16:53PM +0200, Jakub Narębski wrote: W dniu 2014-06-13 18:36, Caleb Thompson pisze: t/t7507-commit-verbose.sh was using a global test_set_editor call to build its environment. The $EDITOR being used was not ne

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Junio C Hamano
Jeff King writes: >> ( >> for commit in initial second merge fourth-signed fifth-signed >> sixth-signed master >> do >> -git show --pretty=short --show-signature $commit >> >actual && >> +git show --pretty=short --show-signa

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Ronnie Sahlberg
On Thu, Jun 12, 2014 at 12:47 PM, Junio C Hamano wrote: > David Turner writes: > >> This issue bit us again recently. >> >> In talking with some colleagues, I realized that the previous version >> of this patch, in addition to being potentially slow, was incomplete. >> Specifically, it didn't han

Re: [PATCHv2 5/6] t7510: test verify-commit

2014-06-13 Thread Junio C Hamano
Michael J Gruber writes: > Jeff King venit, vidit, dixit 13.06.2014 13:51: >> On Fri, Jun 13, 2014 at 12:42:47PM +0200, Michael J Gruber wrote: >> >>> test_expect_success GPG 'detect fudged signature' ' >>> git cat-file commit master >raw && >>> >>> sed -e "s/seventh/7th forged/" raw

Re: [PATCH] git-gui: show staged submodules regardless of ignore config

2014-06-13 Thread Pat Thoyts
Junio C Hamano writes: >From: Jens Lehmann >Date: Tue, 8 Apr 2014 21:30:51 +0200 > >Currently setting submodule..ignore and/or diff.ignoreSubmodules to >"all" suppresses all output of submodule changes for git-gui. This is >really confusing, as even when the user chooses to record a new commit f

Re: [PATCH 0/5] submodule config lookup API

2014-06-13 Thread Junio C Hamano
Jens Lehmann writes: > Am 13.06.2014 00:04, schrieb Junio C Hamano: >> Hmph, this seems to conflict in a meaningful (and painful) way with >> Jens's "jl/submodule-recursive-checkout". > > Then you might wanna drop my series for now, I need to rebase it > above Heiko's series myself to make new su

Re: [PATCH v5 4/4] commit: Add commit.verbose configuration

2014-06-13 Thread Junio C Hamano
Caleb Thompson writes: > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh > index 35a4d06..402d6a1 100755 > --- a/t/t7507-commit-verbose.sh > +++ b/t/t7507-commit-verbose.sh > @@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF' > exec grep '^diff --git' "$1" > EOF > > +

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Caleb Thompson
On Fri, Jun 13, 2014 at 07:16:53PM +0200, Jakub Narębski wrote: > W dniu 2014-06-13 18:36, Caleb Thompson pisze: > >On Fri, Jun 13, 2014 at 02:59:42AM -0400, Jeff King wrote: > > >>[1] It might make sense for test_set_editor, when run from within a > >> test, to behave more like test_config, an

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Junio C Hamano
Jeff King writes: > [1] It might make sense for test_set_editor, when run from within a > test, to behave more like test_config, and do: > > test_when_finished ' > sane_unset FAKE_EDITOR && > sane_unset EDITOR > ' > > I don't know if there would be fallouts wit

[PATCH] Add --recursive flag to documentation of git submodule sync command.

2014-06-13 Thread Charles Matthew Chen
The "git submodule sync" command supports the --recursive flag, but the documentation does not mention this. That flag is useful, for example when a remote is changed in a submodule of a submodule. Signed-off-by: Matthew Chen --- Documentation/git-submodule.txt | 2 +- 1 file changed, 1 inserti

Re: [PATCH RFC] git-am: support any number of signatures

2014-06-13 Thread Junio C Hamano
"Michael S. Tsirkin" writes: > On Thu, Jun 12, 2014 at 12:07:03PM -0700, Junio C Hamano wrote: >> "Michael S. Tsirkin" writes: >> ... >> > 1. new parameter am.signoff can be used any number >> >of times: >> > >> > [am] >> >signoff = "Reviewed-by: Michael S. Tsirkin " >> >signoff = "

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Jakub Narębski
W dniu 2014-06-13 18:36, Caleb Thompson pisze: On Fri, Jun 13, 2014 at 02:59:42AM -0400, Jeff King wrote: [1] It might make sense for test_set_editor, when run from within a test, to behave more like test_config, and do: test_when_finished ' sane_unset FAKE_EDITOR &&

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Junio C Hamano
Torsten Bögershausen writes: > Or try to have a functionality to always use packed refs, and have a > configuration > for it: > > The advantage can be that branch names like "Branch" and "BRANCH" can live > together > in a project, regardless if you have a case sensitive or insensitve file > s

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-13 Thread Junio C Hamano
David Turner writes: > On Thu, 2014-06-12 at 12:47 -0700, Junio C Hamano wrote: >> David Turner writes: >> >> > This issue bit us again recently. >> > >> > In talking with some colleagues, I realized that the previous version >> > of this patch, in addition to being potentially slow, was incomp

Re: [PATCH 3/3] verify-commit: scriptable commit signature verification

2014-06-13 Thread Junio C Hamano
Jeff King writes: > I realize this isn't really your itch to scratch. It's just that when I > see a description like "verify a commit", I wonder what exactly "verify" > means. I think that is an important point. If a tool only verifies the signature of the commit when conceivably other aspect o

[PATCH] refs.c: fix delete_ref_loose

2014-06-13 Thread Ronnie Sahlberg
Please use this to fixup the patch: refs.c: add an err argument to delete_ref_loose With this fix and the two previous ones the ref-transactions support in origin/pu passes all tests. Signed-off-by: Ronnie Sahlberg --- wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

Re: [PATCH v6] Add an explicit GIT_DIR to the list of excludes

2014-06-13 Thread Junio C Hamano
Pasha Bolokhov writes: >>> + test_cmp status.actual.2 status.expect.2 >> >> It is customary to call the files 'expect' and 'actual'. Furthermore, >> swap the order so that in case of a failure the diff shows how the >> actual text was changed from the expected text: >> >>

Re: [PATCH v5 0/4] commit: Add commit.verbose configuration

2014-06-13 Thread Caleb Thompson
On Thu, Jun 12, 2014 at 01:30:10PM -0700, Jeremiah Mahler wrote: > On Thu, Jun 12, 2014 at 02:38:58PM -0500, Caleb Thompson wrote: > > This patch allows people to set commit.verbose to implicitly send > > --verbose to git-commit. > > > > This version incorporates changes suggested by Eric Sunshine,

[no subject]

2014-06-13 Thread Le Ngoc. Thong
I have a business offer for you; reply on my email:- tinaqatt...@collector.org-- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-13 Thread Caleb Thompson
On Fri, Jun 13, 2014 at 02:59:42AM -0400, Jeff King wrote: > On Thu, Jun 12, 2014 at 02:39:01PM -0500, Caleb Thompson wrote: > > > t/t7507-commit-verbose.sh was using a global test_set_editor call to > > build its environment. > > > > Improve robustness against global state changes by having only t

[PATCH v7] Add an explicit GIT_DIR to the list of excludes

2014-06-13 Thread Pasha Bolokhov
When an explicit '--git-dir' option points to a directory inside the work tree, git treats it as if it were any other directory. In particular, 'git status' lists it as untracked, while 'git add -A' stages the metadata directory entirely Add GIT_DIR to the list of excludes in a dedicated function

Re: [PATCH v5 2/4] commit test: Use write_script

2014-06-13 Thread Caleb Thompson
You're very right - I may have confused this commit message and the one to switch to test_set_editor. I'll rewrite this commit message. What do you think of something like this for the description: Use write_script from t/test-lib-functions.sh instead of cat, shebang, and chmod. This aids

Re: [PATCH v6] Add an explicit GIT_DIR to the list of excludes

2014-06-13 Thread Pasha Bolokhov
>> + test_cmp status.actual.2 status.expect.2 > > It is customary to call the files 'expect' and 'actual'. Furthermore, > swap the order so that in case of a failure the diff shows how the > actual text was changed from the expected text: > > test_cmp status.expect.2 sta

Re: Our merge bases sometimes suck

2014-06-13 Thread Jakub Narębski
W dniu 2014-06-13 11:38, Michael J Gruber pisze: Michael Haggerty venit, vidit, dixit 13.06.2014 00:12: I've been thinking a lot about merge bases lately and think I have discovered something interesting. tl;dr: When two branches have multiple merge bases, git merge-base $master $branch

Re: [PATCH v15 00/48] Use ref transactions

2014-06-13 Thread Ronnie Sahlberg
Looking at it, thanks! I found two issues, I have just sent patches to the list for them. You can just "fixup" these two patches in origin/pu? Or do you want me to re-send the series? regards ronnie sahlberg On Thu, Jun 12, 2014 at 3:15 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >

[PATCH 1/2] remotes.c: update calls to new signature for repack_without_refs

2014-06-13 Thread Ronnie Sahlberg
This should be merged into patch: 00c74db refs.c: add an err argument to repack_without_refs Signed-off-by: Ronnie Sahlberg --- builtin/remote.c | 5 +++-- refs.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index c9102e8..

[PATCH 2/2] receive-pack.c: add missing xstrdup

2014-06-13 Thread Ronnie Sahlberg
This should be merged into patch : 1685d87 receive-pack.c: use a reference transaction for updating the refs Signed-off-by: Ronnie Sahlberg --- builtin/receive-pack.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/rece

[PATCH 0/2] Fixes for the ref-transactions series in origin/pu

2014-06-13 Thread Ronnie Sahlberg
Jun, Please find two fixes for the ref-transactions series in origin/pu Ronnie Sahlberg (2): remotes.c: update calls to new signature for repack_without_refs receive-pack.c: add missing xstrdup builtin/receive-pack.c | 21 +++-- builtin/remote.c | 5 +++-- refs.h

Vorschlag

2014-06-13 Thread Peter
Hallo Ich habe ein Investment-Portfolio, die Geld in der Bank in China hinterlegt, die ich leicht auf Sie übertragen als Begünstigter bringt. Die Transaktion ist ohne Risiko, da es strategisch geplant abgeschlossen erfolgreich. Kontaktieren Sie mich auf meiner E-Mail-Adresse unten für weitere

Re: git rebase --skip stuck in a loop

2014-06-13 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/13/2014 3:34 AM, Jeff King wrote: > Thanks for saving the stuck state. > > If it's possible to share the whole repo, it might be worth seeing > (then we can all just run "git rebase --continue" ourselves). If > it's too big or is confidential, ju

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 15:31, schrieb Michael J Gruber: > rewrite of the form > > a && > b && > test_must_fail c && > d || exit 1 > > hoping that will make things both readable (by avoiding !) and concise > (by avoiding repeated exits). Thanks! Please note that we use 'test_must_fail' only for git invoca

Re: [msysGit] Multi-line commit message changed to a single one

2014-06-13 Thread Erik Faye-Lund
On Fri, Jun 13, 2014 at 1:44 PM, wrote: > Hi, > > Here is a simple script to show my problem. I don't know if it's a > wrong operation (from me), a wrong configuration/parameter, or either a bug, > but I don't get what I expected. > From a git repo (#1), I created a commit message conta

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Johannes Sixt venit, vidit, dixit 13.06.2014 15:21: > Am 6/13/2014 15:06, schrieb Michael J Gruber: >> Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: >>> Am 6/13/2014 14:33, schrieb Michael J Gruber: with this loop, sorry: for X in true false; do for Y in false tr

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 03:21:55PM +0200, Johannes Sixt wrote: > I don't think so. What is the outcome of > > false && # simulate a regression > grep foo && exit 1 > ! grep bar || exit 1 > > assuming that the '! grep bar' happens to be true? Answer: The regression > is not dia

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 15:06, schrieb Michael J Gruber: > Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: >> Am 6/13/2014 14:33, schrieb Michael J Gruber: >>> with this loop, sorry: >>> >>> for X in true false; do >>> for Y in false true; do >>>($X && $Y || exit 1) >>> done >>>

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Johannes Sixt venit, vidit, dixit 13.06.2014 14:54: > Am 6/13/2014 14:33, schrieb Michael J Gruber: >> with this loop, sorry: >> >> for X in true false; do >> for Y in false true; do >>($X && $Y || exit 1) >> done >> echo "$X/last inner $Y: $?" >> done >> >> gives >> >>

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Johannes Sixt
Am 6/13/2014 14:33, schrieb Michael J Gruber: > with this loop, sorry: > > for X in true false; do > for Y in false true; do >($X && $Y || exit 1) > done > echo "$X/last inner $Y: $?" > done > > gives > > true/last inner true: 0 > false/last inner true: 1 > > even th

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 02:33:02PM +0200, Michael J Gruber wrote: > > With X && Y || exit 1 inside the loop, the loop statement will return > > false, but the loop will continue (if X returns false), which is exactly > > the problem that the exit avoids. > > > > Make your example iterate over fal

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Michael J Gruber venit, vidit, dixit 13.06.2014 14:22: > Michael J Gruber venit, vidit, dixit 13.06.2014 14:04: >> Jeff King venit, vidit, dixit 13.06.2014 13:46: >>> On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: >>> When t7510 was introduced, the author made sure that a fo

[PATCH 32/32] t1700: new tests for split-index mode

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 1 + Makefile| 1 + cache.h | 2 + read-cache.c| 3 +- t/t1700-split-index.sh (new +x) | 194 test-dump-sp

[PATCH 31/32] t2104: make sure split index mode is off for the version test

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Version tests only make sense when all entries are in the same file, so we can see if version is downgraded to 2 if 3 is not required. Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2104-update-index-skip-worktree.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/t2104-update-index-skip-wor

[PATCH 28/32] read-tree: force split-index mode off on --index-output

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Just a (paranoid?) safety measure.. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index aa848e1..b1027f7 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2070,7 +2070,8 @@ int write_locked_in

Re: [PATCHv2 4/6] t7510: exit for loop with test result

2014-06-13 Thread Michael J Gruber
Michael J Gruber venit, vidit, dixit 13.06.2014 14:04: > Jeff King venit, vidit, dixit 13.06.2014 13:46: >> On Fri, Jun 13, 2014 at 12:42:46PM +0200, Michael J Gruber wrote: >> >>> When t7510 was introduced, the author made sure that a for loop in >>> a subshell would return with the appropriate er

[PATCH 30/32] read-cache: force split index mode with GIT_TEST_SPLIT_INDEX

2014-06-13 Thread Nguyễn Thái Ngọc Duy
This could be used to run the whole test suite with split indexes. Index splitting is carried out at random. "git read-tree" also resets the index and forces splitting at the next update. I had a lot of headaches with the test suite, which proves it exercises split index pretty good. Signed-off-b

[PATCH 29/32] read-tree: note about dropping split-index mode or index version

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/read-tree.c | 9 + 1 file changed, 9 insertions(+) diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 3204c62..e7e1c33 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -155,6 +155,15 @@ int cmd_read_tree(int argc, con

[PATCH 27/32] rev-parse: add --shared-index-path to get shared index path

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Normally scripts do not have to be aware about split indexes because all shared indexes are in $GIT_DIR. A simple "mv $tmp_index $GIT_DIR/somewhere" is enough. Scripts that generate temporary indexes and move them across repos must be aware about split index and copy the shared file as well. This o

[PATCH 23/32] split-index: do not invalidate cache-tree at read time

2014-06-13 Thread Nguyễn Thái Ngọc Duy
We are sure that after merge_base_index() is done. cache-tree can still be used with the final index. So don't destroy cache tree. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 + read-cache.c | 3 ++- split-index.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH 26/32] update-index --split-index: do not split if $GIT_DIR is read only

2014-06-13 Thread Nguyễn Thái Ngọc Duy
If $GIT_DIR is read only, we can't write $GIT_DIR/sharedindex. This could happen when $GIT_INDEX_FILE is set to somehwere outside $GIT_DIR. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/read-cache.c b/read-

[PATCH 25/32] update-index: new options to enable/disable split index mode

2014-06-13 Thread Nguyễn Thái Ngọc Duy
If you have a large work tree but only make changes in a subset, then $GIT_DIR/index's size should be stable after a while. If you change branches that touch something else, $GIT_DIR/index's size may grow large that it becomes as slow as the unified index. Do --split-index again occasionally to for

[PATCH 24/32] split-index: strip pathname of on-disk replaced entries

2014-06-13 Thread Nguyễn Thái Ngọc Duy
We know the positions of replaced entries via the replace bitmap in "link" extension, so the "name" path does not have to be stored (it's still in the shared index). With this, we also have a way to distinguish additions vs replacements at load time and can catch broken "link" extensions. Signed-o

[PATCH 19/32] read-cache: save deleted entries in split index

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Entries that belong to the base index should not be freed. Mark CE_REMOVE to track them. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 14 -- split-index.c | 12 split-index.h | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/read-cache.c

[PATCH 21/32] split-index: the writing part

2014-06-13 Thread Nguyễn Thái Ngọc Duy
prepare_to_write_split_index() does the major work, classifying deleted, updated and added entries. write_link_extension() then just writes it down. An observation is, deleting an entry, then adding it back is recorded as "entry X is deleted, entry X is added", not "entry X is replaced". This is s

[PATCH 18/32] read-cache: mark new entries for split index

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Make sure entry addition does not lead to unifying the index. We don't need to explicitly keep track of new entries. If ce->index is zero, they're new. Otherwise it's unlikely that they are new, but we'll do a thorough check later at writing time. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cac

[PATCH 22/32] split-index: the reading part

2014-06-13 Thread Nguyễn Thái Ngọc Duy
CE_REMOVE'd entries are removed here because only parts of the code base (unpack_trees in fact) test this bit when they look for the presence of an entry. Leaving them may confuse the code ignores this bit and expects to see a real entry. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c |

[PATCH 20/32] read-cache: mark updated entries for split index

2014-06-13 Thread Nguyễn Thái Ngọc Duy
The large part of this patch just follows CE_ENTRY_CHANGED marks. replace_index_entry() is updated to update split_index->base->cache[] as well so base->cache[] does not reference to a freed entry. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 2 ++ cache.h|

[PATCH 13/32] cache-tree: mark istate->cache_changed on cache tree update

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache-tree.c | 25 +++-- cache-tree.h | 2 +- merge-recursive.c | 4 +--- sequencer.c| 4 +--- test-dump-cache-tree.c | 7 --- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/

[PATCH 17/32] read-cache: split-index mode

2014-06-13 Thread Nguyễn Thái Ngọc Duy
This split-index mode is designed to keep write cost proportional to the number of changes the user has made, not the size of the work tree. (Read cost is another matter, to be dealt separately.) This mode stores index info in a pair of $GIT_DIR/index and $GIT_DIR/sharedindex.. sharedindex is larg

[PATCH 16/32] read-cache: save index SHA-1 after reading

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Also update SHA-1 after writing. If we do not do that, the second read_index() will see "initialized" variable already set and not read .git/index again, which is fine, except istate->sha1 now has a stale value. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h| 1 + read-cache.c | 6 +++

[PATCH 12/32] cache-tree: mark istate->cache_changed on cache tree invalidation

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c| 2 +- builtin/update-index.c | 4 ++-- cache-tree.c | 15 +++ cache-tree.h | 2 +- cache.h| 1 + read-cache.c | 6 +++--- unpack-trees.c | 2 +- 7 files changed

[PATCH 14/32] cache-tree: mark istate->cache_changed on prime_cache_tree()

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/read-tree.c | 2 +- builtin/reset.c | 2 +- cache-tree.c| 9 + cache-tree.h| 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/builtin/read-tree.c b/builtin/read-tree.c index f26d90f..3204c62 100644 ---

[PATCH 15/32] entry.c: update cache_changed if refresh_cache is set in checkout_entry()

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Other fill_stat_cache_info() is on new entries, which should set CE_ENTRY_ADDED in cache_changed, so we're safe. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/apply.c | 8 +--- builtin/checkout-index.c | 1 + builtin/checkout.c | 1 + cache.h | 1 + entry.c

[PATCH 11/32] unpack-trees: be specific what part of the index has changed

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- unpack-trees.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unpack-trees.c b/unpack-trees.c index 97fc995..a722685 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -246,7 +246,9 @@ static int verify_absent_sparse(const stru

[PATCH 09/32] update-index: be specific what part of the index has changed

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index d2654d6..e0e881b 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -56,7 +56,7 @@ static

[PATCH 06/32] read-cache: store in-memory flags in the first 12 bits of ce_flags

2014-06-13 Thread Nguyễn Thái Ngọc Duy
We're running out of room for in-memory flags. But since b60e188 (Strip namelen out of ce_flags into a ce_namelen field - 2012-07-11), we copy the namelen (first 12 bits) to ce_namelen field. So those bits are free to use. Just make sure we do not accidentally write any in-memory flags back. Signe

[PATCH 05/32] read-cache: relocate and unexport commit_locked_index()

2014-06-13 Thread Nguyễn Thái Ngọc Duy
This function is now only used by write_locked_index(). Move it to read-cache.c (because read-cache.c will need to be aware of alternate_index_output later) and unexport it. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 - lockfile.c | 20 read-cache.c | 20 +++

[PATCH 10/32] resolve-undo: be specific what part of the index has changed

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h| 1 + resolve-undo.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 31d4541..976f2e0 100644 --- a/cache.h +++ b/cache.h @@ -272,6 +272,7 @@ static inline unsigned int canon_mode(unsigned int mod

[PATCH 08/32] read-cache: be specific what part of the index has changed

2014-06-13 Thread Nguyễn Thái Ngọc Duy
cache entry additions, removals and modifications are separated out. The rest of changes are still in the catch-all flag SOMETHING_CHANGED, which would be more specific later. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/update-index.c | 6 +++--- cache.h| 5 + read-cach

[PATCH 07/32] read-cache: be strict about "changed" in remove_marked_cache_entries()

2014-06-13 Thread Nguyễn Thái Ngọc Duy
remove_marked_cache_entries() deletes entries marked with CE_REMOVE. But if there is no such entry, do not mark the index as "changed" because that could trigger an index update unnecessarily. Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --gi

[PATCH 01/32] ewah: fix constness of ewah_read_mmap

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ewah/ewah_io.c | 4 ++-- ewah/ewok.h| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ewah/ewah_io.c b/ewah/ewah_io.c index f7f700e..1c2d7af 100644 --- a/ewah/ewah_io.c +++ b/ewah/ewah_io.c @@ -110,9 +110,9 @@ int ewah_serialize(str

[PATCH 03/32] sequencer: do not update/refresh index if the lock cannot be held

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index bde5f04..7b886a6 100644 --- a/sequencer.c +++ b/sequencer.c @@ -679,7 +679,7 @@ static void read_and_refresh_cache(struct replay_opts *opts)

[PATCH 02/32] ewah: delete unused ewah_read_mmap_native declaration

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ewah/ewok.h | 1 - 1 file changed, 1 deletion(-) diff --git a/ewah/ewok.h b/ewah/ewok.h index 0556ca5..f6ad190 100644 --- a/ewah/ewok.h +++ b/ewah/ewok.h @@ -100,7 +100,6 @@ int ewah_serialize_native(struct ewah_bitmap *self, int fd); int ewah_deseriali

[PATCH 04/32] read-cache: new API write_locked_index instead of write_index/write_cache

2014-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/add.c| 6 ++ builtin/apply.c | 9 - builtin/checkout-index.c | 3 +-- builtin/checkout.c | 11 --- builtin/clone.c | 7 +++ builtin/commit.c | 33 ++-

[PATCH 00/32] Split index resend

2014-06-13 Thread Nguyễn Thái Ngọc Duy
This is basically what's in 'pu' with fixup patches squashed in (also resend is a good way to get people's eyes on it one more time). There's also another minor change that SOMETHING_CHANGED now has value 1. This is the usual value of cache_changed before this series. So if another in-flight serie

  1   2   >