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
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
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
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
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
---
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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)
--
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
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.
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 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
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,
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
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
---
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
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
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|
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
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
32 matches
Mail list logo