[PATCH 0/4] Simplify and document strbuf_split() functions

2012-11-04 Thread Michael Haggerty
The strbuf_split() family of functions was completely undocumented. Add documentation and also simplify the definition of strbuf_split_buf(). Michael Haggerty (4): strbuf_split_buf(): use ALLOC_GROW() strbuf_split_buf(): simplify iteration strbuf_split*(): rename delim parameter to

[PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-04 Thread Michael Haggerty
Use ALLOC_GROW() rather than inline code to manage memory in strbuf_split_buf(). Rename pos to nr because it better describes the use of the variable and it better conforms to the ALLOC_GROW idiom. Also, instead of adding a sentinal NULL value after each entry is added to the list, only add it

[PATCH 2/4] strbuf_split_buf(): simplify iteration

2012-11-04 Thread Michael Haggerty
While iterating, update str and slen to keep track of the part of the string that hasn't been processed yet rather than computing things relative to the start of the original string. This eliminates one local variable, reduces the scope of another, and reduces the amount of arithmetic needed

[PATCH 3/4] strbuf_split*(): rename delim parameter to terminator

2012-11-04 Thread Michael Haggerty
The word delimiter suggests that the argument separates the substrings, whereas in fact (1) the delimiter characters are included in the output, and (2) if the input string ends with the delimiter, then the output does not include a final empty string. So rename the delim arguments of the

[PATCH 4/4] strbuf_split*(): document functions

2012-11-04 Thread Michael Haggerty
Document strbuf_split_buf(), strbuf_split_str(), strbuf_split_max(), strbuf_split(), and strbuf_list_free() in the header file and in api-strbuf.txt. (These functions were previously completely undocumented.) Signed-off-by: Michael Haggerty mhag...@alum.mit.edu ---

[PATCH 0/5] Use string_lists when processing notes

2012-11-04 Thread Michael Haggerty
This simplifies the code. Also, sort lines all at once (O(N lg N)) rather than insertion sorting as lines are processed (O(N^2)) and fix the handling of empty values in GIT_NOTES_DISPLAY_REF and GIT_NOTES_REWRITE_REF. Michael Haggerty (5): string_list: add a function

[PATCH 1/5] string_list: add a function string_list_remove_empty_items()

2012-11-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-string-list.txt | 9 - string-list.c | 9 + string-list.h | 7 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git

[PATCH 2/5] Initialize sort_uniq_list using named constant

2012-11-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- notes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes.c b/notes.c index bc454e1..8652f8f 100644 --- a/notes.c +++ b/notes.c @@ -901,7 +901,7 @@ static int string_list_join_lines_helper(struct string_list_item

[PATCH 3/5] combine_notes_cat_sort_uniq(): sort and dedup lines all at once

2012-11-04 Thread Michael Haggerty
Instead of reading lines one by one and insertion-sorting them into a string_list, read all of the lines, sort them, then remove duplicates. Aside from being less code, this reduces the complexity from O(N^2) to O(N lg N) in the total number of lines. Signed-off-by: Michael Haggerty

[PATCH 4/5] notes: fix handling of colon-separated values

2012-11-04 Thread Michael Haggerty
The substrings output by strbuf_split() include the ':' delimiters. When processing GIT_NOTES_DISPLAY_REF and GIT_NOTES_REWRITE_REF, strip off the delimiter character *before* checking whether the substring is empty rather than after, so that empty strings within the list are also skipped.

[PATCH 5/5] string_list_add_refs_from_colon_sep(): use string_list_split()

2012-11-04 Thread Michael Haggerty
It makes for simpler code than strbuf_split(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- notes.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/notes.c b/notes.c index 63b2a09..b823701 100644 --- a/notes.c +++ b/notes.c @@ -943,23

Re: Wrap commit messages on `git commit -m`

2012-11-04 Thread Tay Ray Chuan
On Thu, Nov 1, 2012 at 11:29 AM, Lars Gullik Bjønnes lar...@gullik.org wrote: Ramkumar Ramachandra artag...@gmail.com writes: | Hi, | Some of my colleagues are lazy to fire up an editor and write proper | commit messages- they often write one-liners using `git commit -m`. | However, that

Re: [PATCH 1/4] strbuf_split_buf(): use ALLOC_GROW()

2012-11-04 Thread Jeff King
On Sun, Nov 04, 2012 at 07:46:51AM +0100, Michael Haggerty wrote: Use ALLOC_GROW() rather than inline code to manage memory in strbuf_split_buf(). Rename pos to nr because it better describes the use of the variable and it better conforms to the ALLOC_GROW idiom. I suspect this was not used

Re: [PATCH 0/4] Simplify and document strbuf_split() functions

2012-11-04 Thread Jeff King
On Sun, Nov 04, 2012 at 07:46:50AM +0100, Michael Haggerty wrote: The strbuf_split() family of functions was completely undocumented. Add documentation and also simplify the definition of strbuf_split_buf(). Thanks. Looks good overall, even with the comments I raised for patch 1 (I think it

Re: [PATCH 5/5] string_list_add_refs_from_colon_sep(): use string_list_split()

2012-11-04 Thread Jeff King
On Sun, Nov 04, 2012 at 08:07:10AM +0100, Michael Haggerty wrote: It makes for simpler code than strbuf_split(). Agreed. I wonder how useful the strbuf_split functions really are. Callers might care about splitting content in a strbuf, but in general, getting a list of strbufs out is just a

Re: What's cooking in git.git (Oct 2012, #09; Mon, 29)

2012-11-04 Thread Jeff King
On Fri, Nov 02, 2012 at 09:33:14PM +, Ramsay Jones wrote: I wonder if Ramsay has an older perl that does not do this special hackery right. I'll see if I can dig up where it first appeared. Hmm, sorry for not specifying this upfront, but this failure is on Linux. ;-) Ah, that's

Re: [PATCH] Add rm to submodule command.

2012-11-04 Thread Jeff King
On Fri, Nov 02, 2012 at 10:26:11AM -0700, Alex Linden Levy wrote: This change removes the config entries in .gitmodules and adds it. --- Signoff? git-submodule.sh | 62 +++- 1 file changed, 61 insertions(+), 1 deletion(-) No

Re: [PATCH] gitweb.perl: fix %highlight_ext

2012-11-04 Thread Jeff King
On Fri, Nov 02, 2012 at 02:18:09PM -0700, rh wrote: I think the patch itself looks OK, but: 1. It isn't formatted to apply with git-am. Please use git-format-patch. git format-patch command wouldn't work for me. I can see that you don't need more stuff to do but not knowing

Re: [PATCH] gitweb.perl: fix %highlight_ext mappings

2012-11-04 Thread Jeff King
On Fri, Nov 02, 2012 at 02:12:26PM -0700, rh wrote: The previous change created a dictionary of one-to-one elements when the intent was to map mutliple related types to one main type. e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax This makes the mapping as the original

Re: [PATCH] Add rm to submodule command.

2012-11-04 Thread Jens Lehmann
Am 04.11.2012 14:43, schrieb Jeff King: On Fri, Nov 02, 2012 at 10:26:11AM -0700, Alex Linden Levy wrote: This change removes the config entries in .gitmodules and adds it. --- Signoff? git-submodule.sh | 62 +++- 1 file changed,

What's cooking in git.git (Nov 2012, #01; Sun, 4)

2012-11-04 Thread Jeff King
What's cooking in git.git (Nov 2012, #01; Sun, 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'. The third batch of topics has graduated

Re: git-archive submodule support

2012-11-04 Thread Jens Lehmann
Am 04.11.2012 15:53, schrieb Rotem Yaari: I was wondering if there are any plans to support inclusion of submodules in git-archive. This is very useful for quickly preparing ready-to-deploy archives of unstable branches etc., without the users' need to clone submodule dependencies each time.

git commit/push can fail silently when clone omits .git

2012-11-04 Thread Jeffrey S. Haemer
Ladies and Gentlemen, I'm running git 1.7.9.5 on Ubuntu 12.04.1 LTS I got bitten by what follows. Yes, it's an edge case. Yes I now understand why it does what it does. Yes the right answer is Don't do that, Jeff. :-) Still, it took me a little time to figure out what I'd done wrong because the

git svn problem, probably a regression

2012-11-04 Thread Joern Huxhorn
git svn failed on me with the following error while cloning an SVN repository: r1216 = fcf69d5102378ee41217d60384b96549bf2173cb (refs/remotes/svn/trunk) Found possible branch point: svn+ssh://repositoryName@IP address/trunk = svn+ssh://repositoryName@IP address/tags/_2008-10-22, 1216 Use of

[PATCH 14/13] wildmatch: fix tests that fail on Windows due to path mangling

2012-11-04 Thread Johannes Sixt
Patterns beginning with a slash are converted to Windows paths before test-wildmatch gets to see them. Use a different first character. This does change the meaning of the test because the slash is special. But: - The first pair of changed lines the test is about '*' matching an empty string,

[PATCH as/check-ignore] t0007: fix tests on Windows

2012-11-04 Thread Johannes Sixt
The value of $global_excludes is sometimes part of the output that is tested for. Since git on Windows only sees DOS style paths, we have to ensure that the expected values are constructed in the same manner. To account for this, use $(pwd) to set the value of global_excludes. Additionally, add a

[PATCH] git p4: RCS expansion should not span newlines

2012-11-04 Thread Pete Wyckoff
This bug was introduced in cb585a9 (git-p4: keyword flattening fixes, 2011-10-16). The newline character is indeed special, and $File$ expansions should not try to match across multiple lines. Based-on-patch-by: Chris Goard cgo...@gmail.com Signed-off-by: Pete Wyckoff p...@padd.com ---

Re: checkout-index: unable to create file foo (File exists)

2012-11-04 Thread Pete Wyckoff
br...@interlinx.bc.ca wrote on Thu, 01 Nov 2012 16:25 -0400: When we use git on a network filesystem, occasionally and sporadically we will see the following from a git checkout command: error: git checkout-index: unable to create file foo (File exists) Through a very basic grepping and

[PATCH v2 1/5] push: return reject reasons via a mask

2012-11-04 Thread Chris Rorvick
Pass all rejection reasons back from transport_push(). The logic is simpler and more flexible with regard to providing useful feedback. Signed-off-by: Chris Rorvick ch...@rorvick.com --- builtin/push.c | 13 - transport.c| 17 - transport.h|9

[PATCH v2 2/5] push: add advice for rejected tag reference

2012-11-04 Thread Chris Rorvick
Advising the user to fetch and merge only makes sense if the rejected reference is a branch. If none of the rejections were for branches, tell the user they need to force the update(s). Signed-off-by: Chris Rorvick ch...@rorvick.com --- builtin/push.c | 16 ++-- cache.h|

[PATCH v2 3/5] push: flag updates

2012-11-04 Thread Chris Rorvick
If the reference exists on the remote and the the update is not a delete, then mark as an update. This is in preparation for handling tags and branches differently when pushing. Signed-off-by: Chris Rorvick ch...@rorvick.com --- cache.h |1 + remote.c | 19 --- 2 files

[PATCH v2 5/5] push: update remote tags only with force

2012-11-04 Thread Chris Rorvick
References are allowed to update from one commit-ish to another if the former is a ancestor of the latter. This behavior is oriented to branches which are expected to move with commits. Tag references are expected to be static in a repository, though, thus an update to a tag (lightweight and