The short option -h is hard-wired in parseopt to list the options of
a command together with a short explanation. If -h is to be given a
different meaning then the flag PARSE_OPT_NO_INTERNAL_HELP has to be
specified, which turns off handling for -h, --help and --help-all
(except that --help handli
When a branch name is longer than four characters, memcmp() can read
past the end of the string literal "HEAD". Use strncmp() instead, which
stops at the end of a string. This fixes the following test failures
with AddressSanitizer:
t3203-branch-output.sh (Wstat: 256 Te
Am 01.11.2015 um 18:50 schrieb Junio C Hamano:
René Scharfe writes:
If we're on a detached HEAD then wt_shortstatus_print_tracking() takes
the string "HEAD (no branch)", translates it, skips the first eleven
characters and passes the result to branch_get(), which returns a b
Use argv_array instead of open-coding it.
Signed-off-by: Rene Scharfe
---
builtin/show-branch.c | 24
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index ac5141d..e17744b 100644
--- a/builtin/show-branch.c
++
Use the variable branch_name, which already has "refs/heads/" removed,
instead of blindly advancing in the ->branch string by 11 bytes. This
is safer and less magical.
Signed-off-by: Rene Scharfe
---
wt-status.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wt-status.c b/w
Signed-off-by: Rene Scharfe
---
wt-status.c | 36 +++-
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 42ea15e..435fc28 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -897,15 +897,15 @@ static void wt_status_print_verb
If we're on a detached HEAD then wt_shortstatus_print_tracking() takes
the string "HEAD (no branch)", translates it, skips the first eleven
characters and passes the result to branch_get(), which returns a bogus
result and accesses memory out of bounds in order to produce it.
Somehow stat_tracking_
Deduplicate printing the line terminator by jumping to the end of the
function.
Signed-off-by: Rene Scharfe
---
wt-status.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 3e3b8c0..083328f 100644
--- a/wt-status.c
+++ b/wt-status.
This test fails when run under Valgrind because branch_get() gets passed
a bogus branch name pointer:
==62831== Invalid read of size 1
==62831==at 0x4F76AE: branch_get (remote.c:1650)
==62831==by 0x53499E: wt_shortstatus_print_tracking (wt-status.c:1654)
==62831==by 0x53499E: wt_shorts
Memory is accessed out-of-bounds when try to show --branch info in a
repo with a detached HEAD. Add a test in patch 1 and a fix in patch
3, as well as some cleanups.
Rene Scharfe (5):
t7060: add test for status --branch on a detached HEAD
wt-status: exit early using goto in wt_shortstatus_pri
Call child_process_clear() when a child ends to release the memory
allocated for its environment. This is necessary because unlike all
other users of start_command() we don't call finish_command(), which
would have taken care of that for us.
This leak was introduced by f063d38b (daemon: use cld->
Make the API symmetric by including a cleanup function as a counterpart
to child_process_init().
Signed-off-by: Rene Scharfe
---
Documentation/technical/api-run-command.txt | 7 +++
run-command.c | 2 +-
run-command.h | 1 +
3 files
Rename child_process_deinit() to child_process_clear() in order to stay
consistent with similar cleanup functions like argv_array_clear(),
string_list_clear() etc.
Signed-off-by: Rene Scharfe
---
run-command.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/run-c
Changes since v1:
- Rebased on next, which already has a cleanup function.
- Added first patch for renaming it.
Rene Scharfe (3):
run-command: name the cleanup function child_process_clear()
run-command: export child_process_clear()
daemon: plug memory leak
Documentation/technical/api-run
Am 26.10.2015 um 20:23 schrieb Stefan Beller:
On Mon, Oct 26, 2015 at 11:43 AM, Junio C Hamano wrote:
René Scharfe writes:
Avoid duplication by moving the code to release allocated memory for
arguments and environment to its own function, child_process_clear().
Export it to provide a
Am 26.10.2015 um 22:33 schrieb Junio C Hamano:
René Scharfe writes:
Instead of open-coding the function pop_commit() just call it. This
makes the intent clearer and reduces code size.
Signed-off-by: Rene Scharfe
---
builtin/fmt-merge-msg.c | 9 +++--
builtin/merge.c | 12
Instead of open-coding the function pop_commit() just call it. This
makes the intent clearer and reduces code size.
Signed-off-by: Rene Scharfe
---
builtin/fmt-merge-msg.c | 9 +++--
builtin/merge.c | 12 +---
builtin/reflog.c| 6 +-
builtin/rev-parse.c |
Call child_process_clear() when a child ends to release the memory
allocated for its environment. This is necessary because unlike all
other users of start_command() we don't call finish_command(), which
would have taken care of that for us.
This leak was introduced by f063d38b (daemon: use cld->
Avoid duplication by moving the code to release allocated memory for
arguments and environment to its own function, child_process_clear().
Export it to provide a counterpart to child_process_init().
Signed-off-by: Rene Scharfe
---
Documentation/technical/api-run-command.txt | 7 +++
run-com
Am 15.10.2015 um 21:02 schrieb David Turner:
On Thu, 2015-10-15 at 05:35 +0200, René Scharfe wrote:
Am 15.10.2015 um 00:07 schrieb David Turner:
From: Keith McGuigan
During merges, we would previously free entries that we no longer need
in the destination index. But those entries might also
Am 15.10.2015 um 00:07 schrieb David Turner:
From: Keith McGuigan
During merges, we would previously free entries that we no longer need
in the destination index. But those entries might also be stored in
the dir_entry cache, and when a later call to add_to_index found them,
they would be used
Am 27.09.2015 um 15:13 schrieb René Scharfe:
Am 27.09.2015 um 15:06 schrieb Torsten Bögershausen:
On 2015-09-27 13.19, René Scharfe wrote:
Am 24.09.2015 um 23:08 schrieb Jeff King:
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to
Am 27.09.2015 um 15:06 schrieb Torsten Bögershausen:
On 2015-09-27 13.19, René Scharfe wrote:
Am 24.09.2015 um 23:08 schrieb Jeff King:
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more ob
Am 24.09.2015 um 23:08 schrieb Jeff King:
When we already know the length of a string (e.g., because
we just malloc'd to fit it), it's nicer to use memcpy than
strcpy, as it makes it more obvious that we are not going to
overflow the buffer (because the size we pass matches the
size in the alloca
Eric, hope you see this reply on the list. Direct replies to
sunsh...@sunshineco.com are rejected by my mail provider on submit in
Thunderbird with the following message:
Requested action not taken: mailbox unavailable
invalid DNS MX or A/ resource record.
And with this one when us
Am 23.08.2015 um 07:54 schrieb Eric Sunshine:
> On Sat, Aug 22, 2015 at 3:06 PM, René Scharfe wrote:
>> diff --git a/t/t5004-archive-corner-cases.sh
>> b/t/t5004-archive-corner-cases.sh
>> index 654adda..c6bd729 100755
>> --- a/t/t5004-archive-corner-cases.sh
>
A ZIP file directory has a 16-bit field for the number of entries it
contains. There are 64-bit extensions to deal with that. Demonstrate
that git archive --format=zip currently doesn't use them and instead
overflows the field.
InfoZIP's unzip doesn't care about this field and extracts all files
Support more than 65535 entries cleanly by writing a "zip64 end of
central directory record" (with a 64-bit field for the number of
entries) before the usual "end of central directory record" (which
contains only a 16-bit field). InfoZIP's zip does the same.
Archives with 65535 or less entries are
Use a simpler conditional right next to the code which makes a higher
creator version necessary -- namely symlink handling and support for
executable files -- instead of a long line with a ternary operator.
The resulting code has more lines but is simpler and allows reuse of
the value easily.
Sign
Am 11.08.2015 um 12:40 schrieb Johannes Schauer:
Hi,
for repositories with more than 16k files and folders, git-archive will create
zip files which store the wrong number of entries. That is, it stores the
number of entries modulo 16k. This will break unpackers that do not include
code to suppor
Check if a matched token is followed by a delimiter before advancing the
pointer arg. This avoids accepting composite words like "allnew" or
"defaultcontext".
Signed-off-by: Rene Scharfe
---
diff.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/diff.c b/diff.c
index 8
Am 10.07.2015 um 22:50 schrieb Jeff King:
Thanks, this definitely is a problem, but we already have a fix in the
sb/p5310-and-chain topic. I thought that had been merged-up, but it
looks like it is only in "next" right now.
All the better. And I see it's in master now.
René
--
To unsubscribe
Signed-off-by: Rene Scharfe
---
GIT_TEST_CHAIN_LINT complains about the missing &&s and is enabled
by default now.
t/perf/p5310-pack-bitmaps.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/perf/p5310-pack-bitmaps.sh b/t/perf/p5310-pack-bitmaps.sh
index f8ed857..de2
Am 06.07.2015 um 14:42 schrieb Nguyễn Thái Ngọc Duy:
Noticed-by: Plamen Totev
Signed-off-by: Nguyễn Thái Ngọc Duy
---
grep.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/grep.c b/grep.c
index b58c7c6..48db15a 100644
--- a/grep.c
+++ b/grep.c
@@ -378,7 +
Am 21.05.2015 um 19:06 schrieb Heiko Voigt:
diff --git a/submodule-config.h b/submodule-config.h
index 9061e4e..58afc83 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -24,6 +24,6 @@ const struct submodule *submodule_from_name(const unsigned
char *commit_sha1,
const c
Call file_exists() instead of open-coding it. That's shorter, simpler
and the intent becomes clearer.
Signed-off-by: Rene Scharfe
---
builtin/blame.c | 15 +++
builtin/rm.c | 3 +--
merge-recursive.c | 3 +--
sha1_name.c | 7 +++
submodule.c | 3 +--
5 fil
Looping in Pat (git-gui maintainer).
Am 15.04.2015 um 09:22 schrieb Olaf Hering:
Ping?
On Tue, Feb 10, Olaf Hering wrote:
Ping?
On Mon, Jan 26, Olaf Hering wrote:
ALL_LIBFILES uses wildcard, which provides the result in directory
order. This order depends on the underlying filesystem on th
Am 05.04.2015 um 20:59 schrieb Jeff King:
Still, the numbers are promising. Here's are comparisons
against for-each-ref on torvalds/linux, which has a 218M
packed-refs file:
$ time git for-each-ref \
--format='%(objectname) %(refname)' \
refs/remotes/2325298/ |
wc -c
4
Am 05.04.2015 um 20:52 schrieb Jeff King:
On Sun, Apr 05, 2015 at 03:41:39PM +0200, René Scharfe wrote:
I wonder if pluggable reference backends could help here. Storing refs
in a database table indexed by refname should simplify things.
...this. I think that effort might be better spent on
Am 05.04.2015 um 03:06 schrieb Jeff King:
> As I've mentioned before, I have some repositories with rather large
> numbers of refs. The worst one has ~13 million refs, for a 1.6GB
> packed-refs file. So I was saddened by this:
>
>$ time git.v2.0.0 rev-parse refs/heads/foo >/dev/null 2>&1
>
Am 24.03.2015 um 17:06 schrieb Michael Haggerty:
Parsing numbers is not rocket science, but there are a lot of pitfalls,
especially around overflow. It's even harder to write such code via
macros and the result is less readable.
This patch series is mostly about finding a reasonable API and whip
Use the standard function isxdigit() to make the intent clearer and
avoid using magic constants.
Signed-off-by: Rene Scharfe
---
sha1_name.c | 2 +-
transport.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sha1_name.c b/sha1_name.c
index 95f9f8f..6d10f05 100644
--- a/sh
Convert hostname, canon_hostname, ip_address and tcp_port to strbuf.
This allows to get rid of the helpers strbuf_addstr_or_null() and STRARG
because a strbuf always represents a valid (initially empty) string.
sanitize_client() is not needed anymore and sanitize_client_strbuf()
takes its place an
Move the variables related to the client-supplied hostname into its own
struct, let execute() own an instance of that instead of storing the
information in global variables and pass the struct to any function that
needs to access it as a parameter.
The lifetime of the variables is easier to see th
Am 07.03.2015 um 02:08 schrieb Jeff King:
On Sat, Mar 07, 2015 at 01:20:22AM +0100, René Scharfe wrote:
Not a big deal, but do we want to rename sanitize_client_strbuf to
sanitize_client? It only had the unwieldy name to distinguish it from
this one.
A patch would look like this. The result
Am 06.03.2015 um 22:06 schrieb Jeff King:
On Fri, Mar 06, 2015 at 09:57:22AM +0100, René Scharfe wrote:
if (port) {
- free(tcp_port);
- tcp_port = sanitize_client(port
Am 06.03.2015 um 22:06 schrieb Jeff King:
> On Fri, Mar 06, 2015 at 09:57:22AM +0100, René Scharfe wrote:
>
>> Convert hostname, canon_hostname, ip_address and tcp_port to strbuf.
>> This allows to get rid of the helpers strbuf_addstr_or_null() and STRARG
>> because a st
Am 06.03.2015 um 09:55 schrieb Dongcan Jiang:
Because --graph is about connected history while --no-walk is about discrete
points.
revision.c: Judge whether --graph and --no-walk come together when running
git-log.
buildin/log.c: Set git-log cmd flag.
Documentation/rev-list-options.txt: Add sp
Convert hostname, canon_hostname, ip_address and tcp_port to strbuf.
This allows to get rid of the helpers strbuf_addstr_or_null() and STRARG
because a strbuf always represents a valid (initially empty) string.
sanitize_client() becomes unused and is removed as well.
Signed-off-by: Rene Scharfe
-
Clear the git_zstream variable at the start of git_deflate_init() etc.
so that callers don't have to do that.
Signed-off-by: Rene Scharfe
---
archive-zip.c | 2 --
builtin/index-pack.c | 1 -
builtin/pack-objects.c | 2 --
bulk-checkin.c | 1 -
diff.c | 1 -
fa
Set the text flag for ZIP archive entries that look like text files so
that unzip -a can be used to perform end-of-line conversions. Info-ZIP
zip does the same.
Detect binary files the same way as git diff and git grep do, namely by
checking for the attribute "diff" and its negation "-diff", and
Am 05.03.2015 um 03:16 schrieb Junio C Hamano:
René Scharfe writes:
No sign-off, yet, because I'm not sure we really need another option.
E.g. --text=all doesn't seem to be actually useful, but it was easy to
implement. Info-ZIP's zip always creates archives like --text=auto
d
Am 04.03.2015 um 22:13 schrieb René Scharfe:
diff --git a/archive-zip.c b/archive-zip.c
index 4bde019..3767940 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -5,6 +5,7 @@
#include "archive.h"
#include "streaming.h"
#include "utf8.h"
+#include "xdiff-
Entries in a ZIP file can be marked as text files. Extractors can use
that flag to apply end-of-line conversions. An example is unzip -a.
git archive currently marks all ZIP file entries as binary files. This
patch adds the new option --text that can be used to mark non-binary
files or all file
Am 23.02.2015 um 20:30 schrieb René Scharfe:
Am 23.02.2015 um 14:58 schrieb Ulrike Fischer:
The zip contained four text files and a pdf.
The CTAN maintainers informed me that all files in the zip are
flagged as binaries and this makes it difficult for them to process
them further (they want to
Am 24.02.2015 um 13:34 schrieb Guilherme:
This is just an email to all the people i have written in private
about relicensing the files in need in TSS so they can reply to this
email and it be recorded in the mailing list.
The files are part of ctypes.c hex.c git-compat-util.h.
On Tue, Feb 24,
Am 23.02.2015 um 14:58 schrieb Ulrike Fischer:
I'm using git on windows 7.
$ git --version
git version 1.9.4.msysgit.0
Git's code for ZIP file creation hasn't changed since then.
Some days ago I uploaded a latex package to CTAN (www.ctan.org).
I created the zip-file with
git archive --forma
Am 22.02.2015 um 21:00 schrieb Junio C Hamano:
René Scharfe writes:
Use strlcpy() instead of calling strncpy() and then setting the last
byte of the target buffer to NUL explicitly. This shortens and
simplifies the code a bit.
Thanks. It makes me wonder if the longer term direction should
Use strlcpy() instead of calling strncpy() and then setting the last
byte of the target buffer to NUL explicitly. This shortens and
simplifies the code a bit.
Signed-of-by: Rene Scharfe
---
sha1_name.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sha1_name.c b/sha
Simplify the code and avoid duplication by using starts_with() instead
of strlen() and strncmp() to check if a line starts with "encoding ".
Signed-off-by: Rene Scharfe
---
pretty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pretty.c b/pretty.c
index 9d34d02..7b49304 100
Use skip_prefix() to get the part after "color:" (if present) and only
compare it with "reset" instead of comparing the whole string again.
This gets rid of the duplicate "color:" part of the string constant.
Signed-off-by: Rene Scharfe
---
builtin/for-each-ref.c | 7 +++
1 file changed, 3 i
Get rid of magic string length constants and simply compare the strings
using strcmp(). This makes the intent of the code a bit clearer.
Signed-off-by: Rene Scharfe
---
connect.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/connect.c b/connect.c
index 062e133..2a5c400 1
Provide a callback function for strbuf_expand() instead of using the
helper strbuf_expand_dict_cb(). While the resulting code is longer, it
only looks up the canonical hostname and IP address if at least one of
the placeholders %CH and %IP are used with --interpolated-path.
Use a struct for passi
Look up canonical hostname and IP address using getaddrinfo(3) or
gethostbyname(3) only if --interpolated-path or --access-hook were
specified.
Do that by introducing getter functions for canon_hostname and
ip_address and using them for all read accesses. These wrappers call
the new helper lookup
Am 17.01.2015 um 22:30 schrieb Ramkumar Ramachandra:
Instead of manually eyeballing style in reviews, just ask all
contributors to run their patches through [git-]clang-format.
Signed-off-by: Ramkumar Ramachandra
---
The idea is to introduce the community to this new toy I found called
clan
Am 08.01.2015 um 18:57 schrieb Alexander Kuleshov:
git remote show doesn't use -v/--verbose option
Hmm, but it does?
$ git version
git version 2.2.1
$ git remote show
origin
$ git remote -v show
origin git://git.kernel.org/pub/scm/git/git.git (f
Signed-off-by: Rene Scharfe
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 5fcacc6..ed3b2cb 100644
--- a/refs.c
+++ b/refs.c
@@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char
*refname,
struct
Signed-off-by: Rene Scharfe
---
builtin/commit-tree.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 8a66c74..25aa2cd 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -66,10 +66,8 @@ int cmd_commit_tree(i
Signed-off-by: Rene Scharfe
---
transport.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/transport.c b/transport.c
index 70d38e4..08bcd3a 100644
--- a/transport.c
+++ b/transport.c
@@ -971,9 +971,7 @@ struct transport *transport_get(struct remote *remote,
const char *ur
Signed-off-by: Rene Scharfe
---
builtin/merge.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/builtin/merge.c b/builtin/merge.c
index 215d485..d722889 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -894,6 +894,7 @@ static int suggest_conflicts(void)
append_conflicts_hint(&m
Call strbuf_complete_line() instead of open-coding it. Also remove
surrounding comments indicating the intent to complete a line since
this information is already included in the function name.
Signed-off-by: Rene Scharfe
---
builtin/fmt-merge-msg.c | 3 +--
notes-utils.c | 3 +--
tra
Using abs() on long values can cause truncation, so use labs() instead.
Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall).
Signed-off-by: Rene Scharfe
---
builtin/receive-pack.c | 2 +-
config.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/built
Explicitly declare that git_atexit_dispatch() and git_atexit_clear()
take no parameters instead of leaving their parameter list empty and
thus unspecified.
Signed-off-by: Rene Scharfe
---
run-command.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/run-command.c b/run-co
Am 29.10.2014 um 18:21 schrieb Jeff King:
> On Tue, Oct 28, 2014 at 09:52:34PM +0100, René Scharfe wrote:
>> diff --git a/trailer.c b/trailer.c
>> index 8514566..7ff036c 100644
>> --- a/trailer.c
>> +++ b/trailer.c
>> @@ -237,7 +237,7 @@ static const char *
Am 20.10.2014 um 11:19 schrieb Jeff King:
> On Sun, Oct 19, 2014 at 01:14:20PM +0200, René Scharfe wrote:
>
>> --- a/wt-status.c
>> +++ b/wt-status.c
>> @@ -726,14 +726,14 @@ static void wt_status_print_changed(struct wt_status
>> *s)
>> static void wt_s
Signed-off-by: Rene Scharfe
---
Documentation/technical/api-run-command.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/technical/api-run-command.txt
b/Documentation/technical/api-run-command.txt
index 3f12fcd..a9fdb45 100644
--- a/Documentation/technical/ap
Call child_process_init() instead of zeroing the memory of variables of
type struct child_process by hand before use because the former is both
clearer and shorter.
Signed-off-by: Rene Scharfe
---
bundle.c | 2 +-
column.c | 2 +-
trailer.c | 2 +-
transport-helper.c
If the asynchronous start of copy_to_sideband() fails, then any
env_array entries added to struct child_process proc by
prepare_push_cert_sha1() are leaked. Call the latter function only
after start_async() succeeded so that the allocated entries are
cleaned up automatically by start_command() or
Am 28.10.2014 um 00:32 schrieb Zoltan Klinger:
> I like René's approach, too. It's more flexible, supports the old
> behaviour and it scratches my itch as well.
> Don't mind if you dropped my patch and used René's instead.
Good. :) And here's the t/ part of your patch, slightly changed to
exerci
The config option color.grep.match can be used to specify the highlighting
color for matching strings. Add the options matchContext and matchSelected
to allow different colors to be specified for matching strings in the
context vs. in selected lines. This is similar to the ms and mc specifiers
in
Am 23.10.2014 um 03:09 schrieb brian m. carlson:
On Wed, Oct 22, 2014 at 11:42:48AM +0200, Michael J Gruber wrote:
Junio C Hamano schrieb am 21.10.2014 um 20:14:
Michael J Gruber writes:
Unfortunately, the git archive doc clearly says that the umask is
applied to all archive entries.
Is an
Am 21.10.2014 um 07:56 schrieb Zoltan Klinger:
When git grep is run with combined patterns such as '-e p1 --and -e p2'
and surrounding context lines are requested, the output contains
incorrectly highlighted matches.
Consider the following output (highlighted matches are surrounded by '*'
charac
Convert users of struct child_process to using the managed env_array for
specifying environment variables instead of supplying an array on the
stack or bringing their own argv_array. This shortens and simplifies
the code and ensures automatically that the allocated memory is freed
after use.
Sign
Similar to args, add a struct argv_array member to struct child_process
that simplifies specifying the environment for children. It is freed
automatically by finish_command() or if start_command() encounters an
error.
Suggested-by: Jeff King
Signed-off-by: Rene Scharfe
---
Documentation/techni
Am 14.10.2014 um 11:16 schrieb Jeff King:
On Mon, Oct 13, 2014 at 12:08:09PM -0700, Junio C Hamano wrote:
I wonder if run-command should provide a managed env array similar
to the "args" array.
That's a good idea.
I took a look at a few of them:
I took a brief look, too.
I had hoped we
The argv_array used in unpack() is never freed. Instead of adding
explicit calls to argv_array_clear() use the args member of struct
child_process and let run_command() and friends clean up for us.
Signed-off-by: Rene Scharfe
---
builtin/receive-pack.c | 18 --
1 file changed, 8
Am 07.10.2014 um 20:23 schrieb Junio C Hamano:
> René Scharfe writes:
>
>> @@ -335,20 +337,18 @@ static int append_ref(const char *refname, const
>> unsigned char *sha1, int flags,
>> static struct {
>> int kind;
>> const char
Am 05.10.2014 um 00:22 schrieb Junio C Hamano:
Jeff King writes:
There's quite a lot of patches here, but most of them are preparatory
cleanups. The meat is in patches 13, 15, and 16.
[01/16]: foreach_alt_odb: propagate return value from callback
[02/16]: isxdigit: cast input to unsigne
Am 03.10.2014 um 22:41 schrieb Jeff King:
When we try to write a loose object file, we first check
whether that object already exists. If so, we skip the
write as an optimization. However, this can interfere with
prune's strategy of using mtimes to mark files in progress.
For example, if a branc
Am 03.10.2014 um 22:32 schrieb Jeff King:
We typically iterate over the reachable objects in a
repository by starting at the tips and walking the graph.
There's no easy way to iterate over all of the objects,
including unreachable ones. Let's provide a way of doing so.
Signed-off-by: Jeff King
Continue where ae021d87 (use skip_prefix to avoid magic numbers) left off
and use skip_prefix() in more places for determining the lengths of prefix
strings to avoid using dependent constants and other indirect methods.
Signed-off-by: Rene Scharfe
---
builtin/apply.c | 2 +-
builtin
The output file hasn't been created at this point, yet, so there is no
need to delete it when exiting early.
Suggested-by: Jeff King
Signed-off-by: Rene Scharfe
---
Original thread: http://thread.gmane.org/gmane.comp.version-control.git/255140
builtin/mailsplit.c | 1 -
1 file changed, 1 delet
Am 03.10.2014 um 22:21 schrieb Jeff King:
We check the return value of the callback and stop iterating
if it is non-zero. However, we do not make the non-zero
return value available to the caller, so they have no way of
knowing whether the operation succeeded or not (technically
they can keep the
Free the buffer returned by read_sha1_file() even if no valid tagger
line is found.
Signed-off-by: Rene Scharfe
---
bundle.c | 16 ++--
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/bundle.c b/bundle.c
index b2b89fe..9ed865c 100644
--- a/bundle.c
+++ b/bundle.c
@@ -2
If the first 18 bytes of the SHA1's of all entries are the same then
sha1_pos() dies and reports that the lower and upper limits of the
binary search were the same that this wasn't supposed to happen. This
is wrong because the remaining two bytes could still differ.
Furthermore: It wouldn't be a
Helped-by: Jeff King
Helped-by: Eric Sunshine
Signed-off-by: Rene Scharfe
---
Added a test for looking up a non-existing entry in an array that
contains duplicates, as suggested by Jeff. Changed echo20() to add
a space after the prefix as needed, as suggested by Eric.
.gitignore|
Am 01.10.2014 um 16:11 schrieb Eric Sunshine:
On Wed, Oct 1, 2014 at 5:40 AM, René Scharfe wrote:
Signed-off-by: Rene Scharfe
---
diff --git a/t/t0064-sha1-array.sh b/t/t0064-sha1-array.sh
new file mode 100755
index 000..bd68789
--- /dev/null
+++ b/t/t0064-sha1-array.sh
@@ -0,0 +1,64
Am 01.10.2014 um 12:28 schrieb Michael Haggerty:
The purpose of this patch is to make the state diagram for lock_file
objects simpler and deterministic.
If locking fails, lock_file() sometimes leaves the lock_file object
partly initialized, but sometimes not. It sometimes registers the
object in
Am 01.10.2014 um 12:50 schrieb Jeff King:
On Wed, Oct 01, 2014 at 11:43:21AM +0200, René Scharfe wrote:
If the first 18 bytes of the SHA1's of all entries are the same then
sha1_pos() dies and reports that the lower and upper limits of the
binary search were the same that this wasn'
It became unused when 6573faff (NO_IPV6 support for git daemon) replaced
select() with poll().
Signed-off-by: Rene Scharfe
---
daemon.c | 4
1 file changed, 4 deletions(-)
diff --git a/daemon.c b/daemon.c
index 090f6a4..54a03bd 100644
--- a/daemon.c
+++ b/daemon.c
@@ -815,7 +815,6 @@ stati
901 - 1000 of 1338 matches
Mail list logo