[PATCH v3 5/6] push --force-with-lease: tie it all together

2013-07-23 Thread Junio C Hamano
This teaches the deepest part of the callchain for git push (and git send-pack) to enforce the old value of the ref must be this, otherwise fail this push (aka compare-and-swap / --lockref). Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/send-pack.c | 5 + remote.c|

[PATCH v3 4/6] push --force-with-lease: implement logic to populate old_sha1_expect[]

2013-07-23 Thread Junio C Hamano
This plugs the push_cas_option data collected by the command line option parser to the transport system with a new function apply_push_cas(), which is called after match_push_refs() has already been called. At this point, we know which remote we are talking to, and what remote refs we are going

[PATCH v3 0/6] git push --cas/--lockref renamed to --force-with-lease

2013-07-23 Thread Junio C Hamano
This is mostly unchanged since the previous round, except that * The option is spelled --force-with-lease=ref:expect. Nobody liked cas as it was too technical, many disliked lockref because lock sounded as if push by others were excluded by it while in fact this is to fail us. The

[PATCH v3 2/6] builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN

2013-07-23 Thread Junio C Hamano
The command line parser of git push for --tags, --delete, and --thin options still used outdated OPT_BOOLEAN. Because these options do not give escalating levels when given multiple times, they should use OPT_BOOL. Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/push.c | 6 +++--- 1

[PATCH v3 1/6] cache.h: move remote/connect API out of it

2013-07-23 Thread Junio C Hamano
The definition of struct ref in cache.h, a header file so central to the system, always confused me. This structure is not about the local ref used by sha1-name API to name local objects. It is what refspecs are expanded into, after finding out what refs the other side has, to define what refs

[PATCH v3 6/6] t5533: test push --force-with-lease

2013-07-23 Thread Junio C Hamano
Prepare two repositories, src and dst, the latter of which is a clone of the former (with tracking branches), and push from the latter into the former, with various --force-with-lease options. Signed-off-by: Junio C Hamano gits...@pobox.com --- t/t5533-push-cas.sh | 189

[PATCH v3 3/6] remote.c: add command line option parser for --force-with-lease

2013-07-23 Thread Junio C Hamano
Update git push and git send-pack to parse this commnd line option. The intended sematics is: * --force-with-lease alone, without specifying the details, will protect _all_ remote refs that are going to be updated by requiring their current value to be the same as some reasonable

Re: What's cooking in git.git (Jul 2013, #03; Tue, 9)

2013-07-23 Thread Ramkumar Ramachandra
Junio C Hamano wrote: * mv/merge-ff-tristate (2013-07-02) 1 commit (merged to 'next' on 2013-07-09 at c32b95d) + merge: handle --ff/--no-ff/--ff-only as a tri-state option Sorry I didn't notice sooner, but I was confused by the second test title this added: test_expect_success 'option

Re: [PATCH] log: use true parents for diff even when rewriting

2013-07-23 Thread Thomas Rast
Junio C Hamano gits...@pobox.com writes: Thomas Rast tr...@inf.ethz.ch writes: When using pathspec filtering in combination with diff-based log output, parent simplification happens before the diff is computed. The diff is therefore against the *simplified* parents. This works okay,

Re: [PATCH] log: use true parents for diff even when rewriting

2013-07-23 Thread Uwe Kleine-König
Hello Thomas, On Tue, Jul 23, 2013 at 09:27:06AM +0200, Thomas Rast wrote: Junio C Hamano gits...@pobox.com writes: Conceptually I can see how this will change the history simplification in the vertical direction (skipping the ancestry chain and jumping directly to the closest grandparent

Re: What's cooking in git.git (Jul 2013, #03; Tue, 9)

2013-07-23 Thread Miklos Vajna
Hi, On Tue, Jul 23, 2013 at 12:53:25PM +0530, Ramkumar Ramachandra artag...@gmail.com wrote: Junio C Hamano wrote: * mv/merge-ff-tristate (2013-07-02) 1 commit (merged to 'next' on 2013-07-09 at c32b95d) + merge: handle --ff/--no-ff/--ff-only as a tri-state option Sorry I didn't

[PATCH] rm: do not set a variable twice without intermediate reading.

2013-07-23 Thread Stefan Beller
Just the next line assigns a non-null value to seen. Signed-off-by: Stefan Beller stefanbel...@googlemail.com --- builtin/rm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/rm.c b/builtin/rm.c index 5b63d3f..df85f98 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -316,7 +316,6 @@

Re: [PATCH v3 0/6]

2013-07-23 Thread Jakub Narebski
Junio C Hamano gitster at pobox.com writes: This is mostly unchanged since the previous round, except that * The option is spelled --force-with-lease=ref:expect. Nobody liked cas as it was too technical, many disliked lockref because lock sounded as if push by others were

[PATCH] open_istream: remove unneeded check for null pointer

2013-07-23 Thread Stefan Beller
'st' is allocated via xmalloc a few lines before and passed to the stream opening functions. The xmalloc function is written in a way that either 'st' is allocated valid memory or xmalloc already dies. The function calls to open_istream_* do not change 'st', as the pointer is passed by reference

[PATCH 1/5] range-set: fix sort_and_merge_range_set() corner case bug

2013-07-23 Thread Eric Sunshine
When handed an empty range_set (range_set.nr == 0), sort_and_merge_range_set() incorrectly sets range_set.nr to 1 at exit. Subsequent range_set functions then access the bogus range at element zero and crash or throw an assertion failure. Fix this bug. Signed-off-by: Eric Sunshine

[PATCH 4/5] t4211: demonstrate crash when first -L encountered is empty range

2013-07-23 Thread Eric Sunshine
Signed-off-by: Eric Sunshine sunsh...@sunshineco.com --- t/t4211-line-log.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 12814c0..7616365 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -72,4 +72,9 @@ test_expect_success

[PATCH 2/5] t4211: demonstrate empty -L range crash

2013-07-23 Thread Eric Sunshine
Signed-off-by: Eric Sunshine sunsh...@sunshineco.com --- t/t4211-line-log.sh | 8 1 file changed, 8 insertions(+) diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 7776f93..1db1edd 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -64,4 +64,12 @@ test_bad_opts -L

[PATCH 3/5] range-set: satisfy non-empty ranges invariant

2013-07-23 Thread Eric Sunshine
range-set invariants are: ranges must be (1) non-empty, (2) disjoint, (3) sorted in ascending order. During processing, various range-set utility functions break the invariants (for instance, by adding empty ranges), with the expectation that a finalizing sort_and_merge_range_set() will restore

[PATCH 5/5] line-log: fix log -LN crash when N is last line of file

2013-07-23 Thread Eric Sunshine
range-set invariants are: ranges must be (1) non-empty, (2) disjoint, (3) sorted in ascending order. line_log_data_insert() breaks the non-empty invariant under the following conditions: the incoming range is empty and the pathname attached to the range has not yet been encountered. In this case,

Re: [PATCH v2 05/16] fetch-pack: support fetching from a shallow repository

2013-07-23 Thread Duy Nguyen
On Tue, Jul 23, 2013 at 9:06 AM, Duy Nguyen pclo...@gmail.com wrote: Another is reject new shallow history (i.e. no additions to .git/shallow) unless the user explicitly asks so either via --depth or a new option --shallow. This does not mean that fetching from a shallow clone always fails

Re: [PATCH 0/5] range-set and line-log bug fixes

2013-07-23 Thread Thomas Rast
Eric Sunshine sunsh...@sunshineco.com writes: While implementing multiple -L support for git-blame, I encountered several bugs in range-set and line-log resulting in crashes. This series fixes those bugs. Acked-by: Thomas Rast tr...@inf.ethz.ch -- Thomas Rast trast@{inf,student}.ethz.ch --

Re: [PATCH gitk 0/4] gitk support for git log -L

2013-07-23 Thread Thomas Rast
Thomas Rast tr...@inf.ethz.ch writes: Now that git log -L has hit master, I figure it's time to discuss the corresponding change to gitk. Paul, any news on this? Any chance we can get it into the next release, since that will also be the first release to ship with 'git log -L'? -- Thomas

Re: What's cooking in git.git (Jul 2013, #03; Tue, 9)

2013-07-23 Thread Junio C Hamano
Miklos Vajna vmik...@suse.cz writes: How is --ff-only overwriting merge.ff=only here? Was it a typo? Yes, it's a typo in the test name. Thanks for spotting that! Thanks, will do this: Subject: [PATCH] t7600: fix typo in test title Spotted by Ram, confirmed by Miklos. Signed-off-by: Junio

Re: [PATCH 2/5] t4211: demonstrate empty -L range crash

2013-07-23 Thread SZEDER Gábor
On Tue, Jul 23, 2013 at 10:28:05AM -0400, Eric Sunshine wrote: Signed-off-by: Eric Sunshine sunsh...@sunshineco.com --- t/t4211-line-log.sh | 8 1 file changed, 8 insertions(+) diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 7776f93..1db1edd 100755 ---

Re: [PATCH v2 3/3] Update po/ja.po

2013-07-23 Thread Junio C Hamano
Yamada Saburo devil.tamac...@gmail.com writes: -#: git-gui.sh:2893 +#: git-gui.sh:2983 git-gui.sh:3115 +msgid Usage +msgstr 使用状況 Is this correct? I am not familiar with the context this string appears, but shouldn't it be 使い方? It is a title of the error box which does not have seeing

Re: [PATCH v3 0/6]

2013-07-23 Thread Junio C Hamano
Jakub Narebski jna...@gmail.com writes: Junio C Hamano gitster at pobox.com writes: This is mostly unchanged since the previous round, except that * The option is spelled --force-with-lease=ref:expect. Nobody liked cas as it was too technical, many disliked lockref because lock

Re: [PATCH] rm: do not set a variable twice without intermediate reading.

2013-07-23 Thread Junio C Hamano
Stefan Beller stefanbel...@googlemail.com writes: Just the next line assigns a non-null value to seen. Signed-off-by: Stefan Beller stefanbel...@googlemail.com --- builtin/rm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/rm.c b/builtin/rm.c index 5b63d3f..df85f98 100644

Re: [PATCH] rm: do not set a variable twice without intermediate reading.

2013-07-23 Thread Stefan Beller
On 07/23/2013 08:32 PM, Junio C Hamano wrote: Stefan Beller stefanbel...@googlemail.com writes: Just the next line assigns a non-null value to seen. Signed-off-by: Stefan Beller stefanbel...@googlemail.com --- builtin/rm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/rm.c

Re: [PATCH] rm: do not set a variable twice without intermediate reading.

2013-07-23 Thread Junio C Hamano
Stefan Beller stefanbel...@googlemail.com writes: On 07/23/2013 08:32 PM, Junio C Hamano wrote: Interesting. This is ancient and dates back to 7612a1ef (git-rm: honor -n flag., 2006-06-08). Originally it comes from d9b814cc97 (by Linus), which introduced: + seen = NULL; + if

Re: [PATCH 2/5] t4211: demonstrate empty -L range crash

2013-07-23 Thread Junio C Hamano
SZEDER Gábor sze...@ira.uka.de writes: You could avoid the 'cat' here and patch in 4/5 by doing $(wc -l b.c). Correct. (Side question: the test suite is full with similar constructs, i.e. redirecting file contents to stdin, but why not just use wc -l b.c, i.e. let wc open the file?) wc -l

getting git from kernel.org is failing

2013-07-23 Thread Stefan Beller
git clone https://git.kernel.org/cgit/git/git.git Cloning into 'git'... error: Unable to get pack index https://git.kernel.org/cgit/git/git.git/objects/pack/pack-1e2bca8b5127039cff42b1cd3d47767fb577cd4f.idx error: Unable to get pack file

Re: [PATCH v2 15/16] config: add core.noshallow to prevent turning a repo into a shallow one

2013-07-23 Thread Philip Oakley
From: Duy Nguyen pclo...@gmail.com Sent: Tuesday, July 23, 2013 2:28 AM On Tue, Jul 23, 2013 at 2:23 AM, Philip Oakley philipoak...@iee.org wrote: From: Nguyễn Thái Ngọc Duy pclo...@gmail.com Subject: [PATCH v2 15/16] config: add core.noshallow to prevent turning a repo into a shallow one

Re: [PATCH] log: use true parents for diff even when rewriting

2013-07-23 Thread Junio C Hamano
Thomas Rast tr...@inf.ethz.ch writes: +define_commit_slab(saved_parents, struct commit_list *); +struct saved_parents saved_parents_slab; +static int saved_parents_initialized; + +void save_parents(struct commit *commit) +{ + struct commit_list **pp; + + if

Re: getting git from kernel.org is failing

2013-07-23 Thread Fredrik Gustafsson
On Tue, Jul 23, 2013 at 09:41:44PM +0200, Stefan Beller wrote: git clone https://git.kernel.org/cgit/git/git.git Cloning into 'git'... error: Unable to get pack index https://git.kernel.org/cgit/git/git.git/objects/pack/pack-1e2bca8b5127039cff42b1cd3d47767fb577cd4f.idx error: Unable to get

Re: [PATCH 2/5] t4211: demonstrate empty -L range crash

2013-07-23 Thread SZEDER Gábor
On Tue, Jul 23, 2013 at 12:03:05PM -0700, Junio C Hamano wrote: SZEDER Gábor sze...@ira.uka.de writes: (Side question: the test suite is full with similar constructs, i.e. redirecting file contents to stdin, but why not just use wc -l b.c, i.e. let wc open the file?) wc -l b.c is the

Re: getting git from kernel.org is failing

2013-07-23 Thread Jeff King
On Tue, Jul 23, 2013 at 10:06:05PM +0200, Fredrik Gustafsson wrote: Confirmed (tested both with and without trailing /, IIRC there was some configuration change recently that effect that): iveqy@kolya:~/slask/git$ git clone https://git.kernel.org/cgit/git/git.git/ Klonar till git... error:

Re: getting git from kernel.org is failing

2013-07-23 Thread Jonathan Nieder
Jeff King wrote: then smart HTTP works fine. I wonder if there is a problem in the cgit setup on kernel.org (or if it was even intended that you could fetch from the cgit URL at all; the cgit page shows the clone URLs in /pub/scm/git). I didn't think cgit URLs were meant to be clonable, but

[PATCH] http: Add http.savecookies option to write out HTTP cookies

2013-07-23 Thread dborowitz
From: Dave Borowitz dborow...@google.com HTTP servers may send Set-Cookie headers in a response and expect them to be set on subsequent requests. By default, libcurl behavior is to store such cookies in memory and reuse them across requests within a single session. However, it may also make

Re: getting git from kernel.org is failing

2013-07-23 Thread John Keeping
On Tue, Jul 23, 2013 at 01:40:05PM -0700, Jonathan Nieder wrote: Jeff King wrote: then smart HTTP works fine. I wonder if there is a problem in the cgit setup on kernel.org (or if it was even intended that you could fetch from the cgit URL at all; the cgit page shows the clone URLs in

Re: [PATCH v3 0/6]

2013-07-23 Thread Philip Oakley
From: Junio C Hamano gits...@pobox.com Sent: Tuesday, July 23, 2013 7:26 PM Jakub Narebski jna...@gmail.com writes: Junio C Hamano gitster at pobox.com writes: This is mostly unchanged since the previous round, except that * The option is spelled --force-with-lease=ref:expect. Nobody

[PATCH] [SIGNED-OFF] remotes-hg: bugfix for fetching non local remotes

2013-07-23 Thread Joern Hees
6796d49 introduced a bug by making shared_path == .git/hg' which will most likely exist already, causing a new remote never to be cloned and subsequently causing hg.share to fail with error msg: mercurial.error.RepoError: repository .git/hg not found Changing gitdir to dirname causes shared_path

Re: [PATCH] web--browse: support /usr/bin/cygstart on Cygwin

2013-07-23 Thread Yaakov (Cygwin/X)
On 2013-06-21 11:06, Junio C Hamano wrote: From: Yaakov Selkowitz yselkow...@users.sourceforge.net While both GUI and console Cygwin browsers do exist, anecdotal evidence suggests most users rely on their native Windows browser. cygstart, which is a long-standing part of the base Cygwin

Re: [PATCH v2 00/16] First class shallow clone

2013-07-23 Thread Philip Oakley
From: Duy Nguyen pclo...@gmail.com Sent: Tuesday, July 23, 2013 2:20 AM On Tue, Jul 23, 2013 at 6:41 AM, Philip Oakley philipoak...@iee.org wrote: From: Nguyễn Thái Ngọc Duy pclo...@gmail.com Subject: [PATCH v2 00/16] First class shallow clone It's nice to see that shallow can be a first class

[PATCH] Documentation/git-clean: fix description for range

2013-07-23 Thread Jiang Xin
The descriptions of select by numbers section for interactive git-clean are borrowed from git-add, and one sentence should be replaced. Signed-off-by: Jiang Xin worldhello@gmail.com --- Documentation/git-clean.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] http: Add http.savecookies option to write out HTTP cookies

2013-07-23 Thread dborowitz
From: Dave Borowitz dborow...@google.com HTTP servers may send Set-Cookie headers in a response and expect them to be set on subsequent requests. By default, libcurl behavior is to store such cookies in memory and reuse them across requests within a single session. However, it may also make

Re: [PATCH] http: Add http.savecookies option to write out HTTP cookies

2013-07-23 Thread Junio C Hamano
dborow...@google.com writes: From: Dave Borowitz dborow...@google.com HTTP servers may send Set-Cookie headers in a response and expect them to be set on subsequent requests. By default, libcurl behavior is to store such cookies in memory and reuse them across requests within a single

Re: [PATCH 2/5] t4211: demonstrate empty -L range crash

2013-07-23 Thread Eric Sunshine
On Tue, Jul 23, 2013 at 3:03 PM, Junio C Hamano gits...@pobox.com wrote: SZEDER Gábor sze...@ira.uka.de writes: You could avoid the 'cat' here and patch in 4/5 by doing $(wc -l b.c). Correct. Thanks, I like that better. Unfortunately, what actually got queued on 'next', after applying this

Re: [PATCH v3 0/6]

2013-07-23 Thread Eric Sunshine
On Tue, Jul 23, 2013 at 5:26 PM, Philip Oakley philipoak...@iee.org wrote: From: Junio C Hamano gits...@pobox.com Sent: Tuesday, July 23, 2013 7:26 PM Jakub Narebski jna...@gmail.com writes: Junio C Hamano gitster at pobox.com writes: This is mostly unchanged since the previous round, except

Incompatible '+=' syntax in git-completion.bash

2013-07-23 Thread Matthew Wang
Hi there, I noticed a change in commit 734b2f0 on contrib/completion/git-completion.bash which reverted a syntax fix for '+=' syntax [1], the syntax does not work for bash 3.1. As far as I know, bash 3.0.x is still widely used on some old servers, could someone add the fix back again? Thanks,

Re: [PATCH v2 00/16] First class shallow clone

2013-07-23 Thread Duy Nguyen
On Wed, Jul 24, 2013 at 5:33 AM, Philip Oakley philipoak...@iee.org wrote: In some sense a project with a sub-module is a narrow clone, split at a 'commit' object. Yes, except narrow clone is more flexible. You have to decide the split boundary at commit time for sub-module, while you decide

[PATCH] git-clean: implement partial matching for selection

2013-07-23 Thread Jiang Xin
Document for interactive git-clean says: You also could say `c` or `clean` above as long as the choice is unique. But it's not true, because only hotkey `c` and full match (`clean`) could work. Implement partial matching via find_unique function to make the document right. Signed-off-by: Jiang

[PATCH v2] git-clean: implement partial matching for selection

2013-07-23 Thread Jiang Xin
In the 1st version of this patch, I forgot to remove a shell command for debug in t7301: find . /tmp/x Remove the above command in this version. Sorry about this. Jiang Xin (1): git-clean: implement partial matching for selection builtin/clean.c | 80

[PATCH v2] git-clean: implement partial matching for selection

2013-07-23 Thread Jiang Xin
Document for interactive git-clean says: You also could say `c` or `clean` above as long as the choice is unique. But it's not true, because only hotkey `c` and full match (`clean`) could work. Implement partial matching via find_unique function to make the document right. Signed-off-by: Jiang