Re: [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests

2014-03-04 Thread Junio C Hamano
Ilya Bobyr writes: > While it could be done, it looks less obvious than this: > > GIT_TEST_ONLY='1 4' ./t0001-init.sh If you are thinking about affecting only one test, then you shouldn't be mucking with environment variables in the first place, primarily because running: $ GIT_TEST_ONL

[PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread Michael Haggerty
The beginning of the loop ensures that slash can never be NULL. So don't keep checking whether it is NULL later in the loop. Furthermore, there is no need for an early return it; from the loop if slash points at the end of the string, because that is exactly what will happen when the while

[PATCH v3] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Tanay Abhra
In record_author_date() & parse_gpg_output() ,using skip_prefix() instead of starts_with() is a more suitable abstraction. Helped-by: Max Horn Helped-by: Junio C Hamano Helped-by: Michael Haggerty Signed-off-by: Tanay Abhra --- Patch V3 Variable naming improved, removed assignments inside con

Re: [PATCH 3/3] rebase: new convenient option to edit a single commit

2014-03-04 Thread Michael Haggerty
On 03/04/2014 03:08 AM, Duy Nguyen wrote: > On Tue, Mar 4, 2014 at 3:28 AM, Eric Sunshine wrote: >> On Sat, Mar 1, 2014 at 9:53 PM, Nguyễn Thái Ngọc Duy >> wrote: >>> "git rebase -e XYZ" is basically the same as >>> >>> EDITOR="sed -i '1s/pick XYZ/edit XYZ/' $@" \ >>> git rebase -i XYZ^ >>> >>>

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-04 Thread David Kastrup
Duy Nguyen writes: > On Tue, Mar 04, 2014 at 01:09:39AM +0100, David Kastrup wrote: >> Duy Nguyen writes: >> >> > On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano wrote: >> >> diff --git a/git-compat-util.h b/git-compat-util.h >> >> index cbd86c3..68ffaef 100644 >> >> --- a/git-compat-util.h >>

Re: [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests

2014-03-04 Thread Ilya Bobyr
On 3/4/2014 12:29 AM, Junio C Hamano wrote: Ilya Bobyr writes: While it could be done, it looks less obvious than this: GIT_TEST_ONLY='1 4' ./t0001-init.sh If you are thinking about affecting only one test, Yes, that is the use case: when I am developing a specific feature I want to

Re: [PATCH] implemented strbuf_write_or_die()

2014-03-04 Thread Michael Haggerty
On 03/03/2014 07:31 PM, Junio C Hamano wrote: > Eric Sunshine writes: > >> On Sat, Mar 1, 2014 at 7:51 AM, He Sun wrote: >>> 2014-03-01 19:21 GMT+08:00 Faiz Kothari : diff --git a/remote-curl.c b/remote-curl.c index 10cb011..dee8716 100644 --- a/remote-curl.c +++ b/remote-cur

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread David Kastrup
Michael Haggerty writes: > The beginning of the loop ensures that slash can never be NULL. So > don't keep checking whether it is NULL later in the loop. > > Furthermore, there is no need for an early > > return it; > > from the loop if slash points at the end of the string, because that > i

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread Michael Haggerty
On 03/04/2014 10:40 AM, David Kastrup wrote: > Michael Haggerty writes: > >> The beginning of the loop ensures that slash can never be NULL. So >> don't keep checking whether it is NULL later in the loop. >> >> Furthermore, there is no need for an early >> >> return it; >> >> from the loop i

Re: [PATCH 3/3] rebase: new convenient option to edit a single commit

2014-03-04 Thread Duy Nguyen
On Tue, Mar 4, 2014 at 3:59 PM, Michael Haggerty wrote: >> On Tue, Mar 4, 2014 at 3:28 AM, Eric Sunshine >> wrote: >>> Is it correct to single out only "edit" for special treatment? If >>> allowing "edit" on the command-line, then shouldn't command-line >>> "reword" also be supported? I, for one

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread David Kastrup
Michael Haggerty writes: > BTW, I purposely didn't use a "for" loop at the end (even though I > usually like them) because I wanted to keep it prominent that path is > being updated to the value of slash. Putting that assignment in a for > loop makes it easy to overlook because it puts "path" in

Re: Rewriting git history during git-svn conversion

2014-03-04 Thread Thomas Ferris Nicolaisen
On Mon, Mar 3, 2014 at 7:38 PM, Robert Dailey wrote: > > Is it safe to do this while still using git svn fetch? Will it > properly continue to convert SVN commits on top of my rewritten > history? If not, what changes can I make after I run the commands > linked by the URL above so that git svn co

[PATCH v2] upload-pack: allow shallow fetching from a read-only repository

2014-03-04 Thread Nguyễn Thái Ngọc Duy
Before cdab485 (upload-pack: delegate rev walking in shallow fetch to pack-objects - 2013-08-16) upload-pack does not write to the source repository. cdab485 starts to write $GIT_DIR/shallow_XX if it's a shallow fetch, so the source repo must be writable. git:// servers do not need write acces

Re: [PATCH 3/3] rebase: new convenient option to edit a single commit

2014-03-04 Thread Michael Haggerty
On 03/04/2014 11:24 AM, Duy Nguyen wrote: > On Tue, Mar 4, 2014 at 3:59 PM, Michael Haggerty wrote: >> git rebase --fixup COMMIT >> git rebase --squash COMMIT > > This is not interactive (except when merge conflicts occur), is it? --fixup would not be interactive (is that a problem?), bu

Re: Branch Name Case Sensitivity

2014-03-04 Thread Karsten Blees
Am 03.03.2014 18:51, schrieb Junio C Hamano: > Lee Hopkins writes: > >> I went ahead and took a stab at a solution. My solution is more >> aggressive than a warning, I actually prevent the creation of >> ambiguous refs. My changes are also in refs.c, which may not be >> appropriate, but it seemed

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

2014-03-04 Thread Matthijs Kooijman
Hey folks, On Thu, Sep 26, 2013 at 04:10:15PM -0400, Anders Kaseorg wrote: > ‘eval "$@"’ created an extra layer of shell interpretation, which was > probably not expected by a user who passed multiple arguments to git > submodule foreach: It seems this patch has broken the use of $name, $path, et

[RFC] make --set-upstream work for local branches not in refs/heads

2014-03-04 Thread Krzesimir Nowak
It might be possible (in "Gerrited" setups) to have local branches outside refs/heads/, like for example in following fetch config: [remote "origin"] url = ssh://u...@example.com/my-project fetch = +refs/heads/*:refs/remotes/origin/* fetch = +refs/wip/*:refs/remotes/origin-

[PATCH] RFC: make --set-upstream work for branches not in refs/heads/

2014-03-04 Thread Krzesimir Nowak
--- transport.c | 41 ++--- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/transport.c b/transport.c index ca7bb44..ac933ee 100644 --- a/transport.c +++ b/transport.c @@ -143,6 +143,25 @@ static void insert_packed_refs(const char *packed_refs, s

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

2014-03-04 Thread Johan Herland
On Tue, Mar 4, 2014 at 2:51 PM, Matthijs Kooijman wrote: > matthijs@grubby:~/test$ git submodule foreach echo '$name' > Entering 'test' > $name jherland@beta ~/test$ echo '$name' $name What would you expect echo '$name' to do? What happens if you use double instead of single quotes? ...Johan

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

2014-03-04 Thread Matthijs Kooijman
On Tue, Mar 04, 2014 at 03:53:24PM +0100, Johan Herland wrote: > On Tue, Mar 4, 2014 at 2:51 PM, Matthijs Kooijman wrote: > > matthijs@grubby:~/test$ git submodule foreach echo '$name' > > Entering 'test' > > $name > > jherland@beta ~/test$ echo '$name' > $name > > What would you expect echo '$n

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

2014-03-04 Thread Johan Herland
On Tue, Mar 4, 2014 at 3:57 PM, Matthijs Kooijman wrote: > On Tue, Mar 04, 2014 at 03:53:24PM +0100, Johan Herland wrote: >> What would you expect echo '$name' to do? > If I run git submodule foreach each '$name', then my shell eats the > single quotes (which are only to prevent my shell from inte

Confgure option like tagopt=note to notice changed remote tags

2014-03-04 Thread Alexander Holler
Hello, also I'm using git since a long time, I can't remember that I've noticed that git doesn't make a note or warning if remotes tags have changed. E.g. what's often will be forgotten is to annotate tags before pushing them. The usual resolution is just to annotate them locally and push th

git compile with debug symbols

2014-03-04 Thread Mahesh Pujari
Hello,  I am trying to compile git with debug symbols and failed to do so (basically I am a noob), can some one direct me to links or mailing list (have searched but couldn't find) or doc's so that I can debug git using gdb. thanks, mpujari -- To unsubscribe from this list: send the line "uns

Re: git compile with debug symbols

2014-03-04 Thread David Kastrup
Mahesh Pujari writes: > Hello, >  I am trying to compile git with debug symbols and failed to do so > (basically I am a noob), can some one direct me to links or mailing > list (have searched but couldn't find) or doc's so that I can debug > git using gdb. git is compiled with debug symbols by d

[PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Karthik Nayak
In record_author_date() : Replace "buf + strlen(author )" by skip_prefix(), which is saved in a new "const char" variable "indent_line". In parse_signed_commit() : Replace "line + gpg_sig_header_len" by skip_prefix(), which is saved in a new "const char" variable "indent_line". In parse_gpg_outpu

Re: git compile with debug symbols

2014-03-04 Thread karthik nayak
A quick look at the Makefile shows that -g is enabled by default. so debugging is enabled by default On Tue, Mar 4, 2014 at 9:16 PM, Mahesh Pujari wrote: > > > Hello, > I am trying to compile git with debug symbols and failed to do so (basically > I am a noob), can some one direct me to links o

Re: git compile with debug symbols

2014-03-04 Thread Matthieu Moy
David Kastrup writes: > Mahesh Pujari writes: > >> Hello, >>  I am trying to compile git with debug symbols and failed to do so >> (basically I am a noob), can some one direct me to links or mailing >> list (have searched but couldn't find) or doc's so that I can debug >> git using gdb. > > git

Re: [PATCH] git submodule foreach: Skip eval for more than one argument

2014-03-04 Thread Matthijs Kooijman
Hey Johan, > Ok, so IINM, Anders' original commit was about making "git submodule > foreach " behave more like "" (from a naive user's > perspective), Ok, that makes sense. > while you rather expect to insert quotes/escapes to finely control > exactly when shell interpretation happens. Well, I mo

[PATCH] Setup.c: PATH_MAX is the length including the Nil

2014-03-04 Thread Sun He
Signed-off-by: Sun He --- Check the limit.h of linux and find out that the MACRO #define PATH_MAX4096/* # chars in a path name including nul */ So if the magic number 40 is just the size it should be. (e.g. hash code) It may bring bugs with the length(4056) of long name(gitdirenv). As

Re: git compile with debug symbols

2014-03-04 Thread Mahesh Pujari
Thanks David for the reply. I think I need to do more ground work of going through how to use gdb. Basically I am java programmer and I was trying out to debug git source using eclipse CDT and as we do in java, I was trying out to set break point but failed with errors as "No line 396 in file "h

Re: git compile with debug symbols

2014-03-04 Thread David Kastrup
Mahesh Pujari writes: > Thanks David for the reply. I think I need to do more ground work of > going through how to use gdb. > Basically I am java programmer and I was trying out to debug git > source using eclipse CDT and as we do in java, I was trying out to set > break point but failed with er

Re: [PATCH] Setup.c: PATH_MAX is the length including the Nil

2014-03-04 Thread Faiz Kothari
On Tue, Mar 4, 2014 at 9:59 PM, Sun He wrote: > Signed-off-by: Sun He > --- > > Check the limit.h of linux and find out that the MACRO > #define PATH_MAX4096/* # chars in a path name including nul */ > So if the magic number 40 is just the size it should be. (e.g. hash code) > It may

Re: [PATCH] implemented strbuf_write_or_die()

2014-03-04 Thread Faiz Kothari
> I'm the guilty one. I like the change (obviously, since I suggested > it). Writing strbufs comes up frequently and will hopefully increase in > usage and I think it is a positive thing to encourage the use of strbufs > by making them increasingly first-class citizens. > > But I can see your poi

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Tanay Abhra
Karthik Nayak gmail.com> writes: > > In record_author_date() : > Replace "buf + strlen(author )" by skip_prefix(), which is > saved in a new "const char" variable "indent_line". > > In parse_signed_commit() : > Replace "line + gpg_sig_header_len" by skip_prefix(), which > is saved in a new "co

[PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Jeff King
When we are creating a pack to send to a remote, we should make sure that we are not respecting grafts or replace refs. Otherwise, we may end up sending a broken pack to the other side that does not contain all objects (either omitting them entirely, or using objects that the other side does not ha

Re: git compile with debug symbols

2014-03-04 Thread Tanay Abhra
Mahesh Pujari yahoo.com> writes: > > > Hello, >  I am trying to compile git with debug symbols and failed to do so (basically I am a noob), can some one direct > me to links or mailing list (have searched but couldn't find) or doc's so that I can debug git using gdb. > > thanks, > mpujari > >

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread karthik nayak
Hey Tanay, 1. Yes just getting used to git send-email now, should follow that from now 2. I thought it shouldn't be a part of the commit, so i put it after the last --- 3. I did have a thought on your lines also , but concluded to it being more advantageous, you might be right though Nice to hear

Re: [PATCH v2] upload-pack: allow shallow fetching from a read-only repository

2014-03-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Before cdab485 (upload-pack: delegate rev walking in shallow fetch to > pack-objects - 2013-08-16) upload-pack does not write to the source > repository. cdab485 starts to write $GIT_DIR/shallow_XX if it's a > shallow fetch, so the source repo must be writable.

[PATCH] gitk: replace SHA1 entry field on keyboard paste

2014-03-04 Thread Junio C Hamano
From: Ilya Bobyr Date: Thu, 27 Feb 2014 22:51:37 -0800 We already replace old SHA with the clipboard content for the mouse paste event. It seems reasonable to do the same when pasting from keyboard. Signed-off-by: Ilya Bobyr --- * Paul? I do not use <> on my keyboard, so I am not in the

Re: [PATCH 1/3] rev-parse: support OPT_NUMBER_CALLBACK in --parseopt

2014-03-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > If the option spec is > > -NUM Help string > > then rev-parse will accept and parse -([0-9]+) and return "-NUM $1" Even though the hardcoded "NUM" token initially gave me a knee-jerk "Yuck" reaction, that literal option name is very unlikely to be desired by scrip

Re: [PATCH 3/3] rebase: new convenient option to edit a single commit

2014-03-04 Thread Junio C Hamano
Michael Haggerty writes: > ... All of the following seem to make sense: > > git rebase --edit COMMIT > > A long-form for the -e option we have been talking about. > It is unfortunately that this spelling sounds like the > "--edit" option on "git commit --edit" and "gi

Re: [PATCH v2 1/2] i18n: proposed command missing leading dash

2014-03-04 Thread Junio C Hamano
From: Sandy Carter Date: Mon, 3 Mar 2014 09:55:53 -0500 Add missing leading dash to proposed commands in french output when using the command: git branch --set-upstream remotename/branchname and when upstream is gone Signed-off-by: Sandy Carter Signed-off-by: Junio C Hamano --- * Forwar

Re: [PATCH] implemented strbuf_write_or_die()

2014-03-04 Thread Junio C Hamano
Michael Haggerty writes: > On 03/03/2014 07:31 PM, Junio C Hamano wrote: >> That is a very good sign why this change is merely a code-churn and >> not an improvement, isn't it? We know (and any strbuf user should >> know) that ->buf and ->len are the ways to learn the pointer and the >> length t

Re: [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests

2014-03-04 Thread Junio C Hamano
Ilya Bobyr writes: > On 3/4/2014 12:29 AM, Junio C Hamano wrote: > ... >> then you >> shouldn't be mucking with environment variables in the first place, >> primarily because running: >> >> $ GIT_TEST_ONLY='1 4' make test >> >> to run test .1 and .4 of all the test scripts would not make any

Re: [PATCH v3] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Max Horn
On 04.03.2014, at 09:42, Tanay Abhra wrote: [...] > commit.c | 17 + > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/commit.c b/commit.c > index 6bf4fe0..6c92acb 100644 > --- a/commit.c > +++ b/commit.c [...] > @@ -566,14 +566,16 @@ static void record_author

Re: [PATCH] rev-parse --parseopt: option argument name hints

2014-03-04 Thread Junio C Hamano
Ilya Bobyr writes: > Built-in commands can specify names for option arguments, that are shown > when usage text is generated for the command. sh based commands should > be able to do the same. > > Option argument name hint is any text that comes after [*=?!] after the > argument name up to the f

Re: [PATCH v3] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Junio C Hamano
Tanay Abhra writes: > In record_author_date() & parse_gpg_output() ,using skip_prefix() instead of > starts_with() is a more suitable abstraction. Thanks. Will queue with a reworded message to clarify what exactly "A more suitable" means. Here is what I tentatively came up with. -- >8 -- From

Re: [RFC] make --set-upstream work for local branches not in refs/heads

2014-03-04 Thread Junio C Hamano
Krzesimir Nowak writes: > It might be possible (in "Gerrited" setups) to have local branches > outside refs/heads/, like for example in following fetch config: > > [remote "origin"] > url = ssh://u...@example.com/my-project > fetch = +refs/heads/*:refs/remotes/origin/* > fetch =

[PATCH v6 00/11] Add interpret-trailers builtin

2014-03-04 Thread Christian Couder
This patch series implements a new command: git interpret-trailers and an infrastructure to process trailers that can be reused, for example in "commit.c". 1) Rationale: This command should help with RFC 822 style headers, called "trailers", that are found at the end of commit messages.

[PATCH v6 07/11] trailer: add interpret-trailers command

2014-03-04 Thread Christian Couder
This patch adds the "git interpret-trailers" command. This command uses the previously added process_trailers() function in trailer.c. Signed-off-by: Christian Couder --- .gitignore | 1 + Makefile | 1 + builtin.h| 1 + builtin/interp

[PATCH v6 03/11] trailer: read and process config information

2014-03-04 Thread Christian Couder
This patch implements reading the configuration to get trailer information, and then processing it and storing it in a doubly linked list. The config information is stored in the list whose first item is pointed to by: static struct trailer_item *first_conf_item; Signed-off-by: Christian Couder

[PATCH v6 11/11] Documentation: add documentation for 'git interpret-trailers'

2014-03-04 Thread Christian Couder
Signed-off-by: Christian Couder --- Documentation/git-interpret-trailers.txt | 123 +++ 1 file changed, 123 insertions(+) create mode 100644 Documentation/git-interpret-trailers.txt diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-

[PATCH v6 04/11] trailer: process command line trailer arguments

2014-03-04 Thread Christian Couder
Parse the trailer command line arguments and put the result into an arg_tok doubly linked list. Signed-off-by: Christian Couder --- trailer.c | 93 +++ 1 file changed, 93 insertions(+) diff --git a/trailer.c b/trailer.c index 5b8e28b..

[PATCH v6 06/11] trailer: put all the processing together and print

2014-03-04 Thread Christian Couder
This patch adds the process_trailers() function that calls all the previously added processing functions and then prints the results on the standard output. Signed-off-by: Christian Couder --- trailer.c | 48 1 file changed, 48 insertions(+) diff

[PATCH v6 10/11] trailer: add tests for commands in config file

2014-03-04 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 47 +++ 1 file changed, 47 insertions(+) diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh index 3223b12..0badd0e 100755 --- a/t/t7513-interpret-trailers.sh +++ b/

[PATCH v6 01/11] Add data structures and basic functions for commit trailers

2014-03-04 Thread Christian Couder
We will use a doubly linked list to store all information about trailers and their configuration. This way we can easily remove or add trailers to or from trailer lists while traversing the lists in either direction. Signed-off-by: Christian Couder --- Makefile | 1 + trailer.c | 49 +

[PATCH v6 09/11] trailer: execute command from 'trailer..command'

2014-03-04 Thread Christian Couder
Let the user specify a command that will give on its standard output the value to use for the specified trailer. Signed-off-by: Christian Couder --- trailer.c | 64 +++ 1 file changed, 64 insertions(+) diff --git a/trailer.c b/trailer.

[PATCH v6 02/11] trailer: process trailers from stdin and arguments

2014-03-04 Thread Christian Couder
Implement the logic to process trailers from stdin and arguments. At the beginning trailers from stdin are in their own in_tok doubly linked list, and trailers from arguments are in their own arg_tok doubly linked list. The lists are traversed and when an arg_tok should be "applied", it is remove

[PATCH v6 08/11] trailer: add tests for "git interpret-trailers"

2014-03-04 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 214 ++ 1 file changed, 214 insertions(+) create mode 100755 t/t7513-interpret-trailers.sh diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh new file mode 100755

[PATCH v6 05/11] trailer: parse trailers from stdin

2014-03-04 Thread Christian Couder
Read trailers from stdin, parse them and put the result into a doubly linked list. Signed-off-by: Christian Couder --- trailer.c | 76 +++ 1 file changed, 76 insertions(+) diff --git a/trailer.c b/trailer.c index 5d69c00..e0e066f 10064

Re: Branch Name Case Sensitivity

2014-03-04 Thread Torsten Bögershausen
On 2014-03-04 14.23, Karsten Blees wrote: > Am 03.03.2014 18:51, schrieb Junio C Hamano: >> Lee Hopkins writes: >> >>> I went ahead and took a stab at a solution. My solution is more >>> aggressive than a warning, I actually prevent the creation of >>> ambiguous refs. My changes are also in refs.c

Re: [PATCH v3] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Junio C Hamano
Max Horn writes: >> +buf = ident_line; >> if (split_ident_line(&ident, >> - buf + strlen("author "), >> - line_end - (buf + strlen("author "))) || >> + buf, >> +

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Junio C Hamano
Jeff King writes: > When we are creating a pack to send to a remote, we should > make sure that we are not respecting grafts or replace refs. > Otherwise, we may end up sending a broken pack to the other > side that does not contain all objects (either omitting them > entirely, or using objects t

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread Junio C Hamano
Michael Haggerty writes: > while (*path) { > - const char *slash; > struct cache_tree_sub *sub; > + const char *slash = strchr(path, '/'); > > - slash = strchr(path, '/'); > if (!slash) > slash = path +

[PATCH v4] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Tanay Abhra
In record_author_date() & parse_gpg_output(), the callers of starts_with() not just want to know if the string starts with the prefix, but also can benefit from knowing the string that follows the prefix. By using skip_prefix(), we can do both at the same time. Helped-by: Max Horn Helped-by: Jun

[microproject idea]

2014-03-04 Thread Junio C Hamano
Find places where we scan a string twice unnecessarily, once with strchr() and then with strlen(), e.g. const char *colon = strchr(name, ':'); int namelen = colon ? colon - name : strlen(name); and rewrite such a pattern using strchrnul() as appropriate. The above example can bec

Re: [PATCH v4] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Junio C Hamano
Tanay Abhra writes: > In record_author_date() & parse_gpg_output(), the callers of > starts_with() not just want to know if the string starts with the > prefix, but also can benefit from knowing the string that follows > the prefix. > > By using skip_prefix(), we can do both at the same time. > >

[PATCH v2] branch.c: delete size check of newly tracked branch names

2014-03-04 Thread Jacopo Notarstefano
Since commit 6f084a56 the length of a newly tracked branch name is limited to 1009 = 1024 - 7 - 7 - 1 characters, a bound derived by having to store this name in a char[1024] with two strings of length at most 7 and a '\0' character. This is no longer necessary as of commit a9f2c136, which uses a

[PATCH v5] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Tanay Abhra
In record_author_date() & parse_gpg_output(), the callers of starts_with() not just want to know if the string starts with the prefix, but also can benefit from knowing the string that follows the prefix. By using skip_prefix(), we can do both at the same time. Helped-by: Max Horn Helped-by: Jun

Re: [PATCH v4] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Junio C Hamano
Junio C Hamano writes: >> +found = skip_prefix(buf, sigcheck_gpg_status[i].check + 1); >> +if(!found) { Missing SP between the control keyword and parenthesized expression the keyword uses. I've fixed this (and the broken indentation) locally and queued the result to 'pu

Re: [BUG] Halt during fetch on MacOS

2014-03-04 Thread Jacopo Notarstefano
On Sun, Mar 2, 2014 at 3:02 AM, Kyle J. McKay wrote: > I can't reproduce, mostly, on Mac OS X 10.5.8 or 10.6.8. > > What I mean by mostly is that the very first time I ran the test script I > got approximately 36 of these errors: > > fatal: unable to access > 'https://android.googlesource.com/plat

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Eric Sunshine
Thanks for the resend. Etiquette on this list is to cc: people who commented on previous versions of the submission. As Tanay already mentioned, use [PATCH vN] in the subject where N is the version number of this attempt. The -v option of "git format-email" can help. More below. On Tue, Mar 4, 20

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread Michael Haggerty
On 03/04/2014 10:05 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> while (*path) { >> -const char *slash; >> struct cache_tree_sub *sub; >> +const char *slash = strchr(path, '/'); >> >> -slash = strchr(path, '/'); >>

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 12:58 PM, karthik nayak wrote: > Hey Tanay, > > 1. Yes just getting used to git send-email now, should follow that from now > 2. I thought it shouldn't be a part of the commit, so i put it after > the last --- > 3. I did have a thought on your lines also , but concluded to i

Re: [PATCH v4] commit.c: use skip_prefix() instead of starts_with()

2014-03-04 Thread Tanay Abhra
Junio C Hamano pobox.com> writes: > > Junio C Hamano pobox.com> writes: > > >> + found = skip_prefix(buf, sigcheck_gpg_status[i].check + 1); > >> + if(!found) { > > Missing SP between the control keyword and parenthesized expression > the keyword uses. > > I've fixed this (

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 5:27 PM, Eric Sunshine wrote: > On Tue, Mar 4, 2014 at 10:54 AM, Karthik Nayak wrote: >> diff --git a/commit.c b/commit.c >> index 6bf4fe0..71a03e3 100644 >> --- a/commit.c >> +++ b/commit.c >> @@ -1193,10 +1196,8 @@ static void parse_gpg_output(struct signature_check >> *

[PATCH/RFC] git-gui: Add a 'recursive' checkbox in the clone menu.

2014-03-04 Thread Henri GEIST
Permit to do a 'git clone --recursive' through git-gui. Signed-off-by: Henri GEIST --- I have set the default checkbox state to 'true' by default has all my gui users use it all the time this way. But as it change the default behavior you may prefer to set it to 'false' by default. git-gui/lib/

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread Junio C Hamano
Michael Haggerty writes: >> Isn't the above a strchrnul()? > > Oh, cool, I never realized that this GNU extension was blessed for use > in Git. Will change. We do have our own fallbacks for non-glibc platforms, so it should be safe. >> Combining a freestanding decl with intializer assignment t

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 12:48 PM, Jeff King wrote: > diff --git a/commit.c b/commit.c > index 6bf4fe0..886dbfe 100644 > --- a/commit.c > +++ b/commit.c > @@ -114,6 +114,11 @@ static unsigned long parse_commit_date(const char *buf, > const char *tail) > static struct commit_graft **commit_graft; >

Re: [PATCH v2 1/2] t3200-branch: test setting branch as own upstream

2014-03-04 Thread Junio C Hamano
Brian Gesiak writes: > No test asserts that "git branch -u refs/heads/my-branch my-branch" > emits a warning. Add a test that does so. > > Signed-off-by: Brian Gesiak > --- > t/t3200-branch.sh | 8 > 1 file changed, 8 insertions(+) > > diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh

What's cooking in git.git (Mar 2014, #01; Tue, 4)

2014-03-04 Thread Junio C Hamano
What's cooking in git.git (Mar 2014, #01; Tue, 4) -- Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. A handful of "GSoC warm-up microprojects"

[RFC/PATCH] diff: simplify cpp funcname regex

2014-03-04 Thread Jeff King
The current funcname matcher for C files requires one or more words before the function name, like: static int foo(int arg) { However, some coding styles look like this: static int foo(int arg) { and we do not match, even though the default regex would. This patch simplifies the rege

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Jeff King
On Tue, Mar 04, 2014 at 06:36:07PM -0500, Eric Sunshine wrote: > On Tue, Mar 4, 2014 at 12:48 PM, Jeff King wrote: > > diff --git a/commit.c b/commit.c > > index 6bf4fe0..886dbfe 100644 > > --- a/commit.c > > +++ b/commit.c > > @@ -114,6 +114,11 @@ static unsigned long parse_commit_date(const cha

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Jeff King
On Tue, Mar 04, 2014 at 12:52:18PM -0800, Junio C Hamano wrote: > > We already make an attempt to do the right thing in several > > places by turning off read_replace_refs. However, we missed > > at least one case (during bundle creation), and we do > > nothing anywhere to handle grafts. > > "Doi

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 7:37 PM, Jeff King wrote: > On Tue, Mar 04, 2014 at 06:36:07PM -0500, Eric Sunshine wrote: > >> On Tue, Mar 4, 2014 at 12:48 PM, Jeff King wrote: >> > diff --git a/commit.c b/commit.c >> > index 6bf4fe0..886dbfe 100644 >> > --- a/commit.c >> > +++ b/commit.c >> > @@ -114,6

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Jeff King
On Tue, Mar 04, 2014 at 08:00:44PM -0500, Eric Sunshine wrote: > >> > +int commit_grafts_loaded(void) > >> > +{ > >> > + return !!commit_graft_nr; > >> > +} > >> > >> Did you mean !!commit_graft ? > > > > Shouldn't they produce the same results? > > Yes they should, but the use of !! seemed

Re: [PATCH] disable grafts during fetch/push/bundle

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 8:05 PM, Jeff King wrote: > On Tue, Mar 04, 2014 at 08:00:44PM -0500, Eric Sunshine wrote: > >> >> > +int commit_grafts_loaded(void) >> >> > +{ >> >> > + return !!commit_graft_nr; >> >> > +} >> >> >> >> Did you mean !!commit_graft ? >> > >> > Shouldn't they produce the

New directory lost by git am

2014-03-04 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I applied a patch with git am that adds a new source file to a new directory, and later noticed that file was missing from the commit. It seems that git am fails to add the new file/directory to the index. -BEGIN PGP SIGNATURE- Version: GnuP

Re: New directory lost by git am

2014-03-04 Thread Chris Packham
Hi, On 05/03/14 15:49, Phillip Susi wrote: > I applied a patch with git am that adds a new source file to a new > directory, and later noticed that file was missing from the commit. > It seems that git am fails to add the new file/directory to the index. > Could you provide a few more details su

Re: New directory lost by git am

2014-03-04 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/04/2014 10:08 PM, Chris Packham wrote: > Could you provide a few more details such as your git version (git > --version) and an example of the failure. I've tried to reproduce > the problem based on the description provided but everything seem

Re: [PATCH v4 27/27] count-objects: report unused files in $GIT_DIR/repos/...

2014-03-04 Thread Eric Sunshine
On Sat, Mar 1, 2014 at 7:13 AM, Nguyễn Thái Ngọc Duy wrote: > 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 | 37 +++

Re: [PATCH v2] cache_tree_find(): remove redundant checks

2014-03-04 Thread David Kastrup
Junio C Hamano writes: > Michael Haggerty writes: > >> while (*path) { >> -const char *slash; >> struct cache_tree_sub *sub; >> +const char *slash = strchr(path, '/'); >> >> -slash = strchr(path, '/'); >> if (!slash) >>

Bad git log behavior with multiple glob path arguments

2014-03-04 Thread Jeremy Nickurak
git log seems to understand globs in the last path argument, and the last path argument only. I didn't see anything in the git log man page expressly saying this was to be expected, but it does seem like it ought to work for all the arguments or none of them. Here's a little shell script I ended u

Re: git compile with debug symbols

2014-03-04 Thread Mahesh Pujari
Hello all,  Thanks for replying back, figured out (offcourse had to search in net) that 'gdb' version I had was 6.7.1 (OS Ubuntu 12.04 LST), not sure how I got this. Then I upgraded gdb to version 7.4-2012.04 and things got going. thanks, mpujari On Tuesday, March 4, 2014 10:13 PM, David Kast

[PATCH] t3200-branch: test setting branch as own upstream

2014-03-04 Thread Brian Gesiak
No test asserts that "git branch -u refs/heads/my-branch my-branch" emits a warning. Add a test that does so. Signed-off-by: Brian Gesiak --- t/t3200-branch.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index fcdb867..e6d4015 100755 ---

Read

2014-03-04 Thread Donna Kwok
Hello, I am Ms Donna Kwok, HSBC Hong Kong, head of corporate sustainability Asia pacific region. A sum of USD$23,200,000.00 Million was deposited by our Late customer who died without declaring any next of kin before his death in 2006.My suggestion to you is to stand as the next of king to Fade

Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

2014-03-04 Thread Eric Sunshine
On Tue, Mar 4, 2014 at 5:27 PM, Eric Sunshine wrote: > On Tue, Mar 4, 2014 at 10:54 AM, Karthik Nayak wrote: >> diff --git a/commit.c b/commit.c >> index 6bf4fe0..71a03e3 100644 >> --- a/commit.c >> +++ b/commit.c >> @@ -,11 +1114,11 @@ int parse_signed_commit(const unsigned char *sha1, >>

Re: [RFC/PATCH] diff: simplify cpp funcname regex

2014-03-04 Thread Johannes Sixt
Am 3/5/2014 1:36, schrieb Jeff King: > The current funcname matcher for C files requires one or > more words before the function name, like: > > static int foo(int arg) > { > > However, some coding styles look like this: > > static int > foo(int arg) > { > > and we do not match, even