Add strbuf_add_cwd(), which adds the current working directory to a
strbuf. Because it doesn't use a fixed-size buffer it supports
arbitrarily long paths, as long as the platform's getcwd() does as
well. At least on Linux and FreeBSD it handles paths longer than
PATH_MAX just fine.
Add the helper function xgetcwd(), which returns the current directory
or dies. The returned string has to be free()d after use.
Signed-off-by: Rene Scharfe l@web.de
---
git-compat-util.h | 1 +
wrapper.c | 8
2 files changed, 9 insertions(+)
diff --git a/git-compat-util.h
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.
Signed-off-by: Rene Scharfe l@web.de
---
builtin/init-db.c | 17 -
Am 20.07.2014 14:45, schrieb Duy Nguyen:
On Sun, Jul 20, 2014 at 6:22 PM, René Scharfe l@web.de wrote:
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain
Am 20.07.2014 14:33, schrieb Duy Nguyen:
On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote:
+int strbuf_add_cwd(struct strbuf *sb)
+{
+ size_t oldalloc = sb-alloc;
+ size_t guessed_len = 32;
For Linux, I think this is enough to succesfully get cwd in the first
pass
Am 20.07.2014 14:35, schrieb Duy Nguyen:
On Sun, Jul 20, 2014 at 6:21 PM, René Scharfe l@web.de wrote:
+char *xgetcwd(void)
+{
+ struct strbuf sb = STRBUF_INIT;
+ if (strbuf_add_cwd(sb))
+ die_errno(unable to get current working directory);
Wrap the string
getcwd() call in setup.c
René Scharfe (4):
strbuf: add strbuf_getcwd()
use strbuf_getcwd() to get the current working directory without
fixed-sized buffers
wrapper: add xgetcwd()
use xgetcwd() get the current directory or die
Documentation/technical/api-strbuf.txt | 4
builtin
Add strbuf_getcwd(), which puts the current working directory intto
a strbuf. Because it doesn't use a fixed-size buffer it supports
arbitrarily long paths, as long as the platform's getcwd() does as
well. At least on Linux and FreeBSD it handles paths longer than
PATH_MAX just fine.
Signed-off-by: Rene Scharfe l@web.de
---
builtin/init-db.c | 8
git.c | 6 --
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 56f85e2..c4958b6 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -535,10
Add the helper function xgetcwd(), which returns the current directory
or dies. The returned string has to be free()d after use.
Helped-by: Duy Nguyen pclo...@gmail.com
Signed-off-by: Rene Scharfe l@web.de
---
git-compat-util.h | 1 +
wrapper.c | 8
2 files changed, 9
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.
Signed-off-by: Rene Scharfe l@web.de
---
builtin/init-db.c | 17 -
Am 21.07.2014 04:33, schrieb Jeff King:
On Sun, Jul 20, 2014 at 06:49:54PM +0200, René Scharfe wrote:
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 56f85e2..c4958b6 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -535,10 +535,10 @@ int cmd_init_db(int argc, const char
Am 21.07.2014 16:13, schrieb Duy Nguyen:
This function tests if $PWD is the same as getcwd() using st_dev and
st_ino. But on Windows these fields are always zero
(mingw.c:do_lstat). If cwd is moved away, I think falling back to $PWD
is wrong. I don't understand the use of $PWD in the first
to handle longer working directory paths.
Changes in v3:
* all getcwd() calls are converted
* the two strbuf_getcwd() examples from last round use xgetcwd()
now, as suggested by Jeff
* strbuf_add_absolute_path() is introduced
René Scharfe (10):
strbuf: add strbuf_getcwd()
unix-sockets: use
Add strbuf_getcwd(), which puts the current working directory into a
strbuf. Because it doesn't use a fixed-size buffer it supports
arbitrarily long paths, provided the platform's getcwd() does as well.
At least on Linux and FreeBSD it handles paths longer than PATH_MAX
just fine.
Suggested-by:
Instead of using a PATH_MAX-sized buffer, which can be too small on some
file systems, use strbuf_getcwd(), which handles any path getcwd()
returns. Also preserve the errno set by strbuf_getcwd() instead of
setting it to ENAMETOOLONG; that way a more appropriate error message
can be shown based
Convert setup_git_directory_gently_1() and its helper functions
setup_explicit_git_dir(), setup_discovered_git_dir() and
setup_bare_git_dir() to use a struct strbuf to hold the current working
directory. Replacing the PATH_MAX-sized buffer used before removes a
path length limition on some file
Store the original working directory in a strbuf instead of in a
fixed-sized buffer, in order to be able to handle longer paths.
Signed-off-by: Rene Scharfe l@web.de
---
abspath.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/abspath.c b/abspath.c
index
Add the helper function xgetcwd(), which returns the current directory
or dies. The returned string has to be free()d after use.
Helped-by: Duy Nguyen pclo...@gmail.com
Signed-off-by: Rene Scharfe l@web.de
---
git-compat-util.h | 1 +
wrapper.c | 8
2 files changed, 9
Use strbuf instead of fixed-sized buffers in real_path() in order to
avoid the size limitations of the latter.
Signed-off-by: Rene Scharfe l@web.de
---
abspath.c | 69 +++
1 file changed, 25 insertions(+), 44 deletions(-)
diff
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.
Signed-off-by: Rene Scharfe l@web.de
---
builtin/init-db.c | 17 -
Instead of dying of a segmentation fault if getcwd() returns NULL, use
xgetcwd() to make sure to write a useful error message and then exit
in an orderly fashion.
Suggested-by: Jeff King p...@peff.net
Signed-off-by: Rene Scharfe l@web.de
---
builtin/init-db.c | 7 +++
git.c |
Move most of the code of absolute_path() into the new function
strbuf_add_absolute_path() and in the process transform it to use
struct strbuf and xgetcwd() instead of a PATH_MAX-sized buffer,
which can be too small on some file systems.
Signed-off-by: Rene Scharfe l@web.de
---
Signed-off-by: Rene Scharfe l@web.de
---
exec_cmd.c | 6 +-
sha1_file.c | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/exec_cmd.c b/exec_cmd.c
index 125fa6f..698e752 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -86,11 +86,7 @@ const char *git_exec_path(void)
Store the original working directory in a strbuf instead of in a
fixed-sized buffer, in order to be able to handle longer paths.
Signed-off-by: Rene Scharfe l@web.de
---
Resent with corrected subject.
abspath.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
Feeding the result of a real_path() call to real_path() again doesn't
change that result -- the returned path won't get any more real. Avoid
such a double call in set_git_dir_init() and for the same reason stop
calling real_path() before feeding paths to set_git_work_tree(), as the
latter already
Am 28.07.2014 um 21:09 schrieb Jeff King:
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
static const char *real_path_internal(const char *path, int die_on_error)
{
- static char bufs[2][PATH_MAX + 1], *buf = bufs[0], *next_buf = bufs[1];
+ static struct strbuf
Am 28.07.2014 um 21:15 schrieb Jeff King:
On Mon, Jul 28, 2014 at 08:33:55PM +0200, René Scharfe wrote:
const char *absolute_path(const char *path)
{
- static char buf[PATH_MAX + 1];
-
- if (!*path) {
- die(The empty string is not a valid path);
- } else
Am 28.07.2014 um 23:42 schrieb Junio C Hamano:
Jeff King p...@peff.net writes:
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
@@ -60,26 +58,22 @@ static const char *real_path_internal(const char *path, int
die_on_error)
goto error_out
Noticed-by: Jeff King p...@peff.net
---
abspath.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/abspath.c b/abspath.c
index cf9b404..5edb4e7 100644
--- a/abspath.c
+++ b/abspath.c
@@ -146,8 +146,8 @@ const char *real_path_if_valid(const char *path)
*/
const char
Noticed-by: Jeff King p...@peff.net
---
abspath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/abspath.c b/abspath.c
index 16e7fa2..6aa328f 100644
--- a/abspath.c
+++ b/abspath.c
@@ -58,7 +58,7 @@ static const char *real_path_internal(const char *path, int
die_on_error)
Am 31.07.2014 um 21:50 schrieb Nikolay Avdeev:
I've noticed something strange with git status when replacing a folder with
symlink to another folder.
There is a git repo with script with demo in the attachment.
Let's try and make this a bit easier for folks to follow along.
# Create test repo
Am 01.08.2014 um 18:23 schrieb Junio C Hamano:
René Scharfe l@web.de writes:
# Create test repo with two directories with two files each.
$ git init
Initialized empty Git repository in /tmp/.git/
$ mkdir a b
$ echo x a/equal
$ echo x b/equal
$ echo y a/different
$ echo z b/different
Am 03.08.2014 um 19:19 schrieb Junio C Hamano:
René Scharfe l@web.de writes:
How about the patch below? Before it checks if an index entry exists
in the work tree, it checks if its path includes a symlink.
Honestly, I didn't expect the fix to be in the refresh-index code
path, but doing
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 l@web.de
---
builtin/receive-pack.c | 2 +-
config.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff
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 l@web.de
---
builtin/fmt-merge-msg.c | 3 +--
notes-utils.c
Signed-off-by: Rene Scharfe l@web.de
---
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)
Signed-off-by: Rene Scharfe l@web.de
---
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
Signed-off-by: Rene Scharfe l@web.de
---
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,
Signed-off-by: Rene Scharfe l@web.de
---
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,
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 artag...@gmail.com
---
The idea is to introduce the community to this new toy I
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
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
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 strbuf always represents a valid
Use the standard function isxdigit() to make the intent clearer and
avoid using magic constants.
Signed-off-by: Rene Scharfe l@web.de
---
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
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 l@web.de
---
archive-zip.c | 2 --
builtin/index-pack.c | 1 -
builtin/pack-objects.c | 2 --
bulk-checkin.c | 1 -
diff.c
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
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
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
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
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
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
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
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
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-interface.h
static int zip_date;
static
Am 05.03.2015 um 03:16 schrieb Junio C Hamano:
René Scharfe l@web.de 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
does
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 if
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
Am 22.02.2015 um 21:00 schrieb Junio C Hamano:
René Scharfe l@web.de 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
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,
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 l@web.de
---
builtin/for-each-ref.c | 7 +++
1 file
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 l@web.de
---
pretty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pretty.c b/pretty.c
index
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 l@web.de
---
sha1_name.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git
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 l@web.de
---
connect.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/connect.c b/connect.c
index
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
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
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
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 21
real
Call file_exists() instead of open-coding it. That's shorter, simpler
and the intent becomes clearer.
Signed-off-by: Rene Scharfe l@web.de
---
builtin/blame.c | 15 +++
builtin/rm.c | 3 +--
merge-recursive.c | 3 +--
sha1_name.c | 7 +++
submodule.c |
Am 06.07.2015 um 14:42 schrieb Nguyễn Thái Ngọc Duy:
Noticed-by: Plamen Totev plamen.to...@abv.bg
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com
---
grep.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/grep.c b/grep.c
index b58c7c6..48db15a 100644
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
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.
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
Am 23.08.2015 um 07:54 schrieb Eric Sunshine:
On Sat, Aug 22, 2015 at 3:06 PM, René Scharfe l@web.de 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
+++ b/t/t5004-archive-corner
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
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
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 +-
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
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
Am 26.10.2015 um 20:23 schrieb Stefan Beller:
On Mon, Oct 26, 2015 at 11:43 AM, Junio C Hamano <gits...@pobox.com> wrote:
René Scharfe <l@web.de> writes:
Avoid duplication by moving the code to release allocated memory for
arguments and environment to its own function, child_p
Am 26.10.2015 um 22:33 schrieb Junio C Hamano:
René Scharfe <l@web.de> 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 <l@web.de>
---
builtin/fmt-merg
Am 01.11.2015 um 18:50 schrieb Junio C Hamano:
René Scharfe <l@web.de> 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
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
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(-)
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
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
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
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
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
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
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:
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
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
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
---
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 <kmcgui...@twitter.com>
During merges, we would previously free entries that we no longer need
in the destination
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
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
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 l@web.de
---
diff.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/diff.c
301 - 400 of 1163 matches
Mail list logo