Re: [PATCH] gc: remove redundant check for gc_auto_threshold

2018-10-10 Thread Brandon Casey
On Wed, Oct 10, 2018 at 4:38 PM Junio C Hamano wrote: > > Brandon Casey writes: > > > ... Again, I don't feel strongly about it, but I'm not > > sure this change actually improves the code. > > Yeah, in the context of the current caller, this is a safe cha

Re: [PATCH] gc: remove redundant check for gc_auto_threshold

2018-10-10 Thread Brandon Casey
On Wed, Oct 10, 2018 at 12:32 PM Ævar Arnfjörð Bjarmason wrote: > > Checking gc_auto_threshold in too_many_loose_objects() was added in > 17815501a8 ("git-gc --auto: run "repack -A -d -l" as necessary.", > 2007-09-17) when need_to_gc() itself was also reliant on > gc_auto_pack_limit before its ear

Re: Shawn Pearce has died

2018-01-30 Thread Brandon Casey
On Mon, Jan 29, 2018 at 2:55 PM, Christian Couder wrote: > On Mon, Jan 29, 2018 at 6:21 PM, Jeff King wrote: >> On Mon, Jan 29, 2018 at 10:33:08AM +0100, Johannes Schindelin wrote: >> >>> I found these sad news in my timeline today: >>> >>> https://twitter.com/cdibona/status/957822400518696960 >>

[PATCH 2/3] parse-options: write blank line to correct output stream

2017-09-24 Thread Brandon Casey
When commit 54e6dc7 added translation support to parse-options, an fprintf was mistakenly replaced by a call to putchar(). Let's use fputc instead. Fixes t0040.11, t0040.12, t0040.33, and t1502.8. Signed-off-by: Brandon Casey --- parse-options.c | 2 +- t/t0040-parse-optio

[PATCH 3/3] parse-options: only insert newline in help text if needed

2017-09-24 Thread Brandon Casey
trailing blank lines instead of one. Let's defer emitting the blank line between the usage text and the options text until it is clear that the options section will not be empty. Fixes t1502.5, t1502.6. Signed-off-by: Brandon Casey --- parse-options.c | 10 -- t/t1502-rev-

[PATCH 1/3] t0040,t1502: Demonstrate parse_options bugs

2017-09-24 Thread Brandon Casey
blank lines within the usage string to stdout instead of stderr. Update t/helper/test-parse-options.c to have a description body in the usage string to exercise this second bug and mark tests as failing in t0040. Add tests to t1502 to demonstrate both of these problems. Signed-off-by: Brandon Casey

[PATCH 1/4] t1502: demonstrate rev-parse --parseopt option mis-parsing

2017-09-17 Thread Brandon Casey
eters produced on the command line. The only side-effect is misalignment in the help text. Signed-off-by: Brandon Casey --- t/t1502-rev-parse-parseopt.sh | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parse

[PATCH 2/4] rev-parse parseopt: do not search help text for flag chars

2017-09-17 Thread Brandon Casey
--exclame -- instead of this one: set -- --exclame this does something -- Mark t1502.4 and t1502.5 as fixed. Signed-off-by: Brandon Casey --- builtin/rev-parse.c | 6 -- t/t1502-rev-parse-parseopt.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --gi

[PATCH 3/4] rev-parse parseopt: interpret any whitespace as start of help text

2017-09-17 Thread Brandon Casey
e the following set expression when --frotz is used: set -- --frotz -- instead of this: set -- --frotz enable -- Mark t1502.2 as fixed. Signed-off-by: Brandon Casey --- builtin/rev-parse.c | 12 ++-- t/t1502-rev-parse-parseopt.sh | 2 +- 2 files changed, 11 insertions(

[PATCH 4/4] git-rebase: don't ignore unexpected command line arguments

2017-09-17 Thread Brandon Casey
7;t be ignoring unexpected arguments. Let's not. Signed-off-by: Brandon Casey --- git-rebase.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-rebase.sh b/git-rebase.sh index ad8415e..6344e8d 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -350,6 +350,9 @@ do shift

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-24 Thread Brandon Casey
On Thu, Aug 24, 2017 at 9:52 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> Ah, you probably meant something like this: >> >>const char strbuf_slopbuf = '\0'; >> >> which gcc will apparently place in the read-only segment. I did not kn

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-23 Thread Brandon Casey
On Wed, Aug 23, 2017 at 3:24 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> On Wed, Aug 23, 2017 at 2:04 PM, Junio C Hamano wrote: >>> Brandon Casey writes: >>> >>>> So is there any reason why didn't do something like the following in &g

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-23 Thread Brandon Casey
On Wed, Aug 23, 2017 at 2:54 PM, Brandon Casey wrote: > On Wed, Aug 23, 2017 at 2:20 PM, Brandon Casey wrote: >> On Wed, Aug 23, 2017 at 2:04 PM, Junio C Hamano wrote: >>> Brandon Casey writes: >>> >>>> So is there any reason why didn't do somethin

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-23 Thread Brandon Casey
On Wed, Aug 23, 2017 at 2:20 PM, Brandon Casey wrote: > On Wed, Aug 23, 2017 at 2:04 PM, Junio C Hamano wrote: >> Brandon Casey writes: >> >>> So is there any reason why didn't do something like the following in >>> the first place? >> >> My gue

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-23 Thread Brandon Casey
On Wed, Aug 23, 2017 at 2:04 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> So is there any reason why didn't do something like the following in >> the first place? > > My guess is that we didn't bother; if we cared, we would have used a > single

Re: [PATCH v2 3/4] strbuf_setlen: don't write to strbuf_slopbuf

2017-08-23 Thread Brandon Casey
On Mon, Aug 21, 2017 at 10:43 AM, Martin Ågren wrote: > strbuf_setlen(., 0) writes '\0' to sb.buf[0], where buf is either > allocated and unique to sb, or the global slopbuf. The slopbuf is meant > to provide a guarantee that buf is not NULL and that a freshly > initialized buffer contains the emp

Re: requesting permission to use some Git for Windows code

2017-07-27 Thread Brandon Casey
> >> The chunks of code we would like to reuse are from these Git for Windows >> files: >> git-compat-util.h > > This file is quite large, maybe you can cut down on the authors to contact > by restricting the `git annotate`/`git log`/`git shortlog` calls to > specific p

Re: [PATCH] gnome-keyring: Don't hard-code pkg-config executable

2016-06-16 Thread Brandon Casey
On Thu, Jun 16, 2016 at 2:50 AM, Jeff King wrote: > On Tue, Jun 14, 2016 at 01:27:05PM +0200, Heiko Becker wrote: > >> Helpful if your pkg-config executable has a prefix based on the >> architecture, for example. >> >> Signed-off-by: Heiko Becker > > Sounds like a reasonable thing to want to do..

Re: [PATCH 1/2] git-send-email.perl: support no- prefix with older GetOptions

2015-02-15 Thread Brandon Casey
On Sun, Feb 15, 2015 at 1:51 AM, Kyle J. McKay wrote: > On Feb 14, 2015, at 22:32, Brandon Casey wrote: > >> On Fri, Feb 13, 2015 at 12:19 PM, Junio C Hamano >> wrote: >>> >>> From: "Kyle J. McKay" >>> >>> Only Perl version 5.8

Re: [PATCH 1/2] git-send-email.perl: support no- prefix with older GetOptions

2015-02-14 Thread Brandon Casey
On Fri, Feb 13, 2015 at 12:19 PM, Junio C Hamano wrote: > From: "Kyle J. McKay" > > Only Perl version 5.8.0 or later is required, but that comes with > an older Getopt::Long (2.32) that does not support the 'no-' > prefix. Support for that was added in Getopt::Long version 2.33. > > Since the he

Re: [PATCH 0/2] Getopt::Long workaround in send-email

2015-02-14 Thread Brandon Casey
[apparently it is impossible to send a plain text email using Google Inbox, maybe people on this list know someone to talk to about that? Sorry for the dup for those on cc] On Fri, Feb 13, 2015 at 12:19 PM, Junio C Hamano wrote: > The first one is a replay of Kyle's workaround for older versions

Re: [PATCH 1/2] sequencer.c: check for lock failure and bail early in fast_forward_to

2014-04-15 Thread Brandon Casey
On Tue, Apr 15, 2014 at 4:46 PM, Ronnie Sahlberg wrote: > Signed-off-by: Ronnie Sahlberg > --- > sequencer.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/sequencer.c b/sequencer.c > index bde5f04..6aa3b50 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -281,8 +281,15 @@

Re: [PATCH] Documentation/config.txt: denyDeleteCurrent applies to bare repos too

2013-10-17 Thread Brandon Casey
On Thu, Oct 17, 2013 at 3:23 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> From: Brandon Casey >> >> The setting of denyDeleteCurrent applies to both bare and non-bare >> repositories. Correct the description on this point, and expand it to >> provi

[PATCH] Documentation/config.txt: denyDeleteCurrent applies to bare repos too

2013-10-15 Thread Brandon Casey
From: Brandon Casey The setting of denyDeleteCurrent applies to both bare and non-bare repositories. Correct the description on this point, and expand it to provide some background justification for the current behavior and describe the full suite of settings. Signed-off-by: Brandon Casey

Re: [PATCH v2 00/16] Make Gnome Credential helper more Gnome-y and support ancient distros

2013-10-15 Thread Brandon Casey
On 10/15/2013 3:40 PM, Junio C Hamano wrote: > This seems to post-date what Jonathan has kept in his 'pu'; is this > the latest (I have a huge backlog to wade through, so I'd rather > skip it if another reroll is coming and move on to other topics). > > Thanks. This is the latest. I didn't have

Re: return of the maintainer

2013-10-14 Thread Brandon Casey
For some reason, I have the theme for Star Wars in my head. :) On Mon, Oct 14, 2013 at 10:37 AM, Junio C Hamano wrote: > I am physically back to work, but I'll have to coordinate the > hand-off of topic branches updated during my absence with Jonathan > before resuming to update my git.git reposi

[PATCH v2 05/16] contrib/git-credential-gnome-keyring.c: exit non-zero when called incorrectly

2013-09-23 Thread Brandon Casey
From: Brandon Casey If the correct arguments were not specified, this program should exit non-zero. Let's do so. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/co

[PATCH v2 04/16] contrib/git-credential-gnome-keyring.c: add static where applicable

2013-09-23 Thread Brandon Casey
From: Brandon Casey Mark global variable and functions as static. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential

[PATCH v2 16/16] contrib/git-credential-gnome-keyring.c: support really ancient gnome-keyring

2013-09-23 Thread Brandon Casey
From: Brandon Casey The gnome-keyring lib (0.4) distributed with RHEL 4.X is really ancient and does not provide most of the synchronous functions that even ancient releases do. Thankfully, we're only using one function that is missing. Let's emulate gnome_keyring_item_delete_sync()

[PATCH v2 08/16] contrib/git-credential-gnome-keyring.c: set Gnome application name

2013-09-23 Thread Brandon Casey
From: Brandon Casey Since this is a Gnome application, let's set the application name to something reasonable. This will be displayed in Gnome dialog boxes e.g. the one that prompts for the user's keyring password. We add an include statement for glib.h and add the glib-2.0 cflags a

[PATCH v2 09/16] contrib/git-credential-gnome-keyring.c: use gnome helpers in keyring_object()

2013-09-23 Thread Brandon Casey
From: Brandon Casey Rather than carefully allocating memory for sprintf() to write into, let's make use of the glib helper function g_strdup_printf(), which makes things a lot easier and less error-prone. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyr

[PATCH v2 13/16] contrib/git-credential-gnome-keyring.c: use glib messaging functions

2013-09-23 Thread Brandon Casey
From: Brandon Casey Rather than roll our own, let's use the messaging functions provided by glib. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 33 +++--- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/contrib/crede

[PATCH v2 01/16] contrib/git-credential-gnome-keyring.c: remove unnecessary pre-declarations

2013-09-23 Thread Brandon Casey
From: Brandon Casey These are all defined before they are used, so it is not necessary to pre-declare them. Remove the pre-declarations. Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c | 13 - 1 file changed, 13 deletions(-) diff

[PATCH v2 07/16] contrib/git-credential-gnome-keyring.c: ensure buffer is non-empty before accessing

2013-09-23 Thread Brandon Casey
From: Brandon Casey Ensure buffer length is non-zero before attempting to access the last element. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/credential/gnome

[PATCH v2 12/16] contrib/git-credential-gnome-keyring.c: use glib memory allocation functions

2013-09-23 Thread Brandon Casey
From: Brandon Casey Rather than roll our own, let's use the memory allocation/free routines provided by glib. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 48 -- 1 file changed, 16 insertions(+), 32 deletions(-) diff --

[PATCH v2 11/16] contrib/git-credential-gnome-keyring.c: use secure memory for reading passwords

2013-09-23 Thread Brandon Casey
From: Brandon Casey gnome-keyring provides functions to allocate non-pageable memory (if possible). Let's use them to allocate memory that may be used to hold secure data read from the keyring. Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c

[PATCH v2 14/16] contrib/git-credential-gnome-keyring.c: report failure to store password

2013-09-23 Thread Brandon Casey
From: Brandon Casey Produce an error message when we fail to store a password to the keyring. Signed-off-by: Brandon Casey --- Difference from v1: Additionally interpret GNOME_KEYRING_RESULT_CANCELLED as a successful exit status, since that means that the user intentionally cancelled the

[PATCH v2 06/16] contrib/git-credential-gnome-keyring.c: strlen() returns size_t, not ssize_t

2013-09-23 Thread Brandon Casey
From: Brandon Casey Also, initialization is not necessary since it is assigned before it is used. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/credential/gnome

[PATCH v2 15/16] contrib/git-credential-gnome-keyring.c: support ancient gnome-keyring

2013-09-23 Thread Brandon Casey
From: Brandon Casey The gnome-keyring lib distributed with RHEL 5.X is ancient and does not provide a few of the functions/defines that more recent versions do, but mostly the API is the same. Let's provide the missing bits via macro definitions and function implementation. Signed-o

[PATCH v2 02/16] contrib/git-credential-gnome-keyring.c: remove unused die() function

2013-09-23 Thread Brandon Casey
From: Brandon Casey Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c| 10 -- 1 file changed, 10 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential

[PATCH v2 10/16] contrib/git-credential-gnome-keyring.c: use secure memory functions for passwds

2013-09-23 Thread Brandon Casey
From: Brandon Casey gnome-keyring provides functions for allocating non-pageable memory (if possible) intended to be used for storing passwords. Let's use them. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c| 21 ++--- 1 file chang

[PATCH v2 03/16] contrib/git-credential-gnome-keyring.c: *style* use "if ()" not "if()" etc.

2013-09-23 Thread Brandon Casey
From: Brandon Casey Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome

[PATCH v2 00/16] Make Gnome Credential helper more Gnome-y and support ancient distros

2013-09-23 Thread Brandon Casey
From: Brandon Casey Mostly unchanged. Inserts a patch to fix the style issues for block statements. i.e. use "if ()" instead of "if()" A couple early patches were reordered to improve logical flow. Updated the comment in the last patch to hopefully improve clarity wr

Re: [PATCH 00/15] Make Gnome Credential helper more Gnome-y and support ancient distros

2013-09-23 Thread Brandon Casey
On Mon, Sep 23, 2013 at 3:20 AM, John Szakmeister wrote: > On Sun, Sep 22, 2013 at 10:07:56PM -0700, Brandon Casey wrote: >> A few cleanups, followed by improved usage of the glib library (no need >> to reinvent the wheel when glib provides the necessary functionality), and >&

Re: [PATCH 07/15] contrib/git-credential-gnome-keyring.c: ensure buffer is non-empty before accessing

2013-09-23 Thread Brandon Casey
Thanks. On Sun, Sep 22, 2013 at 10:43 PM, Felipe Contreras wrote: > Brandon Casey wrote: >> Ensure buffer length is non-zero before attempting to access the last >> element. >> >> Signed-off-by: Brandon Casey >> --- >> contrib/credential/gnome-key

[PATCH 03/15] contrib/git-credential-gnome-keyring.c: add static where applicable

2013-09-22 Thread Brandon Casey
Mark global variable and functions as static. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib

[PATCH 11/15] contrib/git-credential-gnome-keyring.c: use glib memory allocation functions

2013-09-22 Thread Brandon Casey
Rather than roll our own, let's use the memory allocation/free routines provided by glib. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 48 -- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/contrib/credential/

[PATCH 13/15] contrib/git-credential-gnome-keyring.c: report failure to store password

2013-09-22 Thread Brandon Casey
Produce an error message when we fail to store a password to the keyring. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/credential/gnome-keyring/git-credential

[PATCH 05/15] contrib/git-credential-gnome-keyring.c: set Gnome application name

2013-09-22 Thread Brandon Casey
ompilation arguments, but both of these are really noops since glib is already a dependency of gnome-keyring. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/Makefile | 4 ++-- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 3 +++ 2 files

[PATCH 02/15] contrib/git-credential-gnome-keyring.c: remove unused die() function

2013-09-22 Thread Brandon Casey
Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c| 10 -- 1 file changed, 10 deletions(-) diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c index

[PATCH 12/15] contrib/git-credential-gnome-keyring.c: use glib messaging functions

2013-09-22 Thread Brandon Casey
Rather than roll our own, let's use the messaging functions provided by glib. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 33 +++--- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/contrib/credential/gnome-keyrin

[PATCH 14/15] contrib/git-credential-gnome-keyring.c: support ancient gnome-keyring

2013-09-22 Thread Brandon Casey
The gnome-keyring lib distributed with RHEL 5.X is ancient and does not provide a few of the functions/defines that more recent versions do, but mostly the API is the same. Let's provide the missing bits via macro definitions and function implementation. Signed-off-by: Brandon

[PATCH 07/15] contrib/git-credential-gnome-keyring.c: ensure buffer is non-empty before accessing

2013-09-22 Thread Brandon Casey
Ensure buffer length is non-zero before attempting to access the last element. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/credential/gnome-keyring/git-credential

[PATCH 15/15] contrib/git-credential-gnome-keyring.c: support really ancient gnome-keyring

2013-09-22 Thread Brandon Casey
ynchronous function and then triggering the event loop processing until our callback is called. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c | 39 ++ 1 file changed, 39 insertions(+) diff --git a/contrib/credential/gnome-keyring/git-creden

[PATCH 09/15] contrib/git-credential-gnome-keyring.c: use secure memory functions for passwds

2013-09-22 Thread Brandon Casey
gnome-keyring provides functions for allocating non-pageable memory (if possible) intended to be used for storing passwords. Let's use them. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c| 21 ++--- 1 file changed, 6 insertions(+

[PATCH 10/15] contrib/git-credential-gnome-keyring.c: use secure memory for reading passwords

2013-09-22 Thread Brandon Casey
gnome-keyring provides functions to allocate non-pageable memory (if possible). Let's use them to allocate memory that may be used to hold secure data read from the keyring. Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c | 12 +--- 1

[PATCH 08/15] contrib/git-credential-gnome-keyring.c: use gnome helpers in keyring_object()

2013-09-22 Thread Brandon Casey
Rather than carefully allocating memory for sprintf() to write into, let's make use of the glib helper function g_strdup_printf(), which makes things a lot easier and less error-prone. Signed-off-by: Brandon Casey --- .../gnome-keyring/git-credential-gnome-keyring.c

[PATCH 01/15] contrib/git-credential-gnome-keyring.c: remove unnecessary pre-declarations

2013-09-22 Thread Brandon Casey
These are all defined before they are used, so it is not necessary to pre-declare them. Remove the pre-declarations. Signed-off-by: Brandon Casey --- .../credential/gnome-keyring/git-credential-gnome-keyring.c | 13 - 1 file changed, 13 deletions(-) diff --git a/contrib/credential

[PATCH 00/15] Make Gnome Credential helper more Gnome-y and support ancient distros

2013-09-22 Thread Brandon Casey
A few cleanups, followed by improved usage of the glib library (no need to reinvent the wheel when glib provides the necessary functionality), and then the addition of support for RHEL 4.x and 5.x. Brandon Casey (15): contrib/git-credential-gnome-keyring.c: remove unnecessary pre

[PATCH 04/15] contrib/git-credential-gnome-keyring.c: exit non-zero when called incorrectly

2013-09-22 Thread Brandon Casey
If the correct arguments were not specified, this program should exit non-zero. Let's do so. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/credential/gnome-keyrin

[PATCH 06/15] contrib/git-credential-gnome-keyring.c: strlen() returns size_t, not ssize_t

2013-09-22 Thread Brandon Casey
Also, initialization is not necessary since it is assigned before it is used. Signed-off-by: Brandon Casey --- contrib/credential/gnome-keyring/git-credential-gnome-keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/credential/gnome-keyring/git-credential

[PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

2013-08-21 Thread Brandon Casey
From: Brandon Casey Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, do not have a printf that supports -v. Neither does Zsh (which is already handled in the code). As suggested by Junio, let's test whether printf supports the -v o

[PATCH] contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

2013-08-21 Thread Brandon Casey
From: Brandon Casey Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, do not have a printf that supports -v. Neither does Zsh (which is already handled in the code). As suggested by Junio, let's test whether printf supports the -v o

Re: [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring"

2013-08-21 Thread Brandon Casey
On Wed, Aug 21, 2013 at 5:22 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> On Wed, Aug 21, 2013 at 2:47 PM, Junio C Hamano wrote: >>> # on load... >>> printf -v __git_printf_supports_v -- "%s" yes >/dev/null 2>

Re: [PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring"

2013-08-21 Thread Brandon Casey
On Wed, Aug 21, 2013 at 2:47 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> From: Brandon Casey >> >> This reverts commit 69a8141a5d81925b7e08cb228535e9ea4a7a02e3. >> >> Old Bash (3.0) which is distributed with RHEL 4.X and other ancient >> plat

[PATCH 3/3] Revert "bash prompt: avoid command substitution when finalizing gitstring"

2013-08-21 Thread Brandon Casey
From: Brandon Casey This reverts commit 69a8141a5d81925b7e08cb228535e9ea4a7a02e3. Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, does not have a printf that supports -v. Let's revert this patch and go back to using printf i

[PATCH 2/3] t9902-completion.sh: old Bash still does not support array+=('') notation

2013-08-21 Thread Brandon Casey
From: Brandon Casey Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, does not understand the array+=() notation. Let's use an explicit assignment to the new array element which works everywhere, like: array[${#array[@]}+1]=&#

[PATCH 1/3] git-completion.bash: use correct Bash/Zsh array length syntax

2013-08-21 Thread Brandon Casey
From: Brandon Casey The syntax for retrieving the number of elements in an array is: ${#name[@]} Signed-off-by: Brandon Casey --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib

Re: [PATCH v3] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-02 Thread Brandon Casey
On Fri, Aug 2, 2013 at 9:26 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> +/* >> + * The LRU pack is the one with the oldest MRU window, preferring packs >> + * with no used windows, or the oldest mtime if it has no windows allocated. >> + */ >&g

Re: [regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces

2013-08-02 Thread Brandon Casey
On Fri, Aug 2, 2013 at 8:27 AM, Joey Hess wrote: > Jeff King wrote: >> By the way, Joey, I am not sure how safe "git cat-file --batch-check" is >> for arbitrary filenames. In particular, I don't know how it would react >> to a filename with an embedded newline (and I do not think it will undo >> q

[PATCH v3] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
e windows are in use * pack with the least-recently-used windows Signed-off-by: Brandon Casey --- Here's the version that leaves the mmap windows open after closing the pack file descriptor. -Brandon sha1_file.c | 79 - 1 file cha

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 1:02 PM, Junio C Hamano wrote: > Brandon Casey writes: > >> On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: >>> That makes me feel somewhat uneasy. Yes, you can open/mmap/close >>> and hold onto the contents of a file still mapped in-

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 12:16 PM, Brandon Casey wrote: > On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: >> Brandon Casey writes: >> >>> I've been looking closer at uses of p->windows everywhere, and it >>> seems that we always open_packed_git(

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 11:39 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> I've been looking closer at uses of p->windows everywhere, and it >> seems that we always open_packed_git() before we try to create new >> windows. There doesn't seem to

Re: [PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-08-01 Thread Brandon Casey
On Thu, Aug 1, 2013 at 10:12 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> If the refs are loose, then upload-pack will read each ref from the >> pack (allocating one or more mmap windows) so it can peel tags and >> advertise the underlying object. If the re

Re: [PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
On Wed, Jul 31, 2013 at 2:21 PM, Fredrik Gustafsson wrote: > On Wed, Jul 31, 2013 at 11:08:21PM +0200, Antoine Pelisse wrote: >> On Wed, Jul 31, 2013 at 9:51 PM, Brandon Casey wrote: >> > --- >&

Re: [PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
On Wed, Jul 31, 2013 at 2:08 PM, Antoine Pelisse wrote: > On Wed, Jul 31, 2013 at 9:51 PM, Brandon Casey wrote: >> --- >> This email message is for the sole use of the intended recipient(s) and

[PATCH v2 1/2] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-31 Thread Brandon Casey
From: Brandon Casey When the number of open packs exceeds pack_max_fds, unuse_one_window() is called repeatedly to attempt to release the least-recently-used pack windows, which, as a side-effect, will also close a pack file after closing its last open window. If a pack file has been opened

[PATCH 2/2] Don't close pack fd when free'ing pack windows

2013-07-31 Thread Brandon Casey
From: Brandon Casey Now that close_one_pack() has been introduced to handle file descriptor pressure, it is not strictly necessary to close the pack file descriptor in unuse_one_window() when we're under memory pressure. Jeff King provided a justification for leaving the pack file open:

Re: [PATCH] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-30 Thread Brandon Casey
On Tue, Jul 30, 2013 at 12:52 PM, Jeff King wrote: > On Tue, Jul 30, 2013 at 08:39:48AM -0700, Junio C Hamano wrote: > >> Brandon Casey writes: >> >> > From: Brandon Casey >> > >> > When the number of open packs exceeds pack_max_fds, unuse_one_win

[PATCH] sha1_file: introduce close_one_pack() to close packs on fd pressure

2013-07-29 Thread Brandon Casey
From: Brandon Casey When the number of open packs exceeds pack_max_fds, unuse_one_window() is called repeatedly to attempt to release the least-recently-used pack windows, which, as a side-effect, will also close a pack file after closing its last open window. If a pack file has been opened

Re: [PATCHv3 10/10] pack-revindex: radix-sort the revindex

2013-07-11 Thread Brandon Casey
> timings. Very nice. For what it's worth: Reviewed-by: Brandon Casey > The interdiff is: > > diff --git a/pack-revindex.c b/pack-revindex.c > index 9365bc2..b4d2b35 100644 > --- a/pack-revindex.c > +++ b/pack-revindex.c > @@ -61,6 +61,10 @@ static void

Re: [PATCH 10/10] pack-revindex: radix-sort the revindex

2013-07-10 Thread Brandon Casey
On Wed, Jul 10, 2013 at 4:55 AM, Jeff King wrote: > The pack revindex stores the offsets of the objects in the > pack in sorted order, allowing us to easily find the on-disk > size of each object. To compute it, we populate an array > with the offsets from the sha1-sorted idx file, and then use >

Re: [PATCH 4/4] pack-revindex: radix-sort the revindex

2013-07-08 Thread Brandon Casey
On Mon, Jul 8, 2013 at 1:50 PM, Brandon Casey wrote: > On Sun, Jul 7, 2013 at 3:14 AM, Jeff King wrote: >> diff --git a/pack-revindex.c b/pack-revindex.c >> index 77a0465..d2adf36 100644 >> --- a/pack-revindex.c >> +++ b/pack-revindex.c >> @@ -59,11 +59,78 @@

Re: [PATCH 4/4] pack-revindex: radix-sort the revindex

2013-07-08 Thread Brandon Casey
On Sun, Jul 7, 2013 at 3:14 AM, Jeff King wrote: > The pack revindex stores the offsets of the objects in the > pack in sorted order, allowing us to easily find the on-disk > size of each object. To compute it, we populate an array > with the offsets from the sha1-sorted idx file, and then use > q

[PATCH v2 w/prune index] remote.c: avoid O(m*n) behavior in match_push_refs

2013-07-08 Thread Brandon Casey
smaller. A similar operation is performed in the reverse direction when pruning using a matching or pattern refspec. Let's avoid O(m*n) behavior in the same way by lazily preparing an index on the local refs. Signed-off-by: Brandon Casey --- On Mon, Jul 8, 2013 at 12:50 AM, Jeff King wr

[PATCH v2] remote.c: avoid O(m*n) behavior in match_push_refs

2013-07-08 Thread Brandon Casey
uned and n is the number of local refs), so the overhead of creating the search index would likely exceed the benefit of using it. Signed-off-by: Brandon Casey --- Here is the reroll with an updated commit message that hopefully provides a little more detail to justify this change. I removed the

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 12:00 PM, Jeff King wrote: > On Wed, Jul 03, 2013 at 11:40:12AM -0700, Junio C Hamano wrote: > >> Brandon Casey writes: >> >>> Right. For repos with few refs on either side, I don't think there >>> will be any measurable difference. When

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 11:40 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> Right. For repos with few refs on either side, I don't think there >> will be any measurable difference. When pushing a single ref to a >> repo with a very large number of refs, we will see

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On Tue, Jul 2, 2013 at 11:23 PM, Jeff King wrote: > On Tue, Jul 02, 2013 at 04:53:48PM -0700, Brandon Casey wrote: > >> From: Brandon Casey >> >> When pushing, each ref in the local repository must be paired with a >> ref advertised by the remote server. Currently,

[PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-02 Thread Brandon Casey
From: Brandon Casey When pushing, each ref in the local repository must be paired with a ref advertised by the remote server. Currently, this is performed by first applying the refspec to the local ref to transform the local ref into the name of the remote ref, and then performing a linear

Re: How to still kill git fetch with too many refs

2013-07-02 Thread Brandon Casey
On Mon, Jul 1, 2013 at 10:01 PM, Jeff King wrote: > On Tue, Jul 02, 2013 at 12:41:51AM -0400, Jeff King wrote: > >> I replicated your test setup, and the problem is that we have many >> common objects on both sides during the ref negotiation. So we end up in >> rev_list_push for each one, which ha

[PATCH v2] http.c: don't rewrite the user:passwd string multiple times

2013-06-18 Thread Brandon Casey
From: Brandon Casey Curl older than 7.17 (RHEL 4.X provides 7.12 and RHEL 5.X provides 7.15) requires that we manage any strings that we pass to it as pointers. So, we really shouldn't be modifying this strbuf after we have passed it to curl. Our interaction with curl is currently safe (b

Re: [PATCH] http.c: don't rewrite the user:passwd string multiple times

2013-06-18 Thread Brandon Casey
On Tue, Jun 18, 2013 at 3:13 PM, Jeff King wrote: > On Tue, Jun 18, 2013 at 12:29:03PM -0700, Brandon Casey wrote: >> > It could be a problem when we have multiple handles in play >> > simultaneously (we invalidate the pointer that another simultaneous >> &g

Re: [PATCH] http.c: don't rewrite the user:passwd string multiple times

2013-06-18 Thread Brandon Casey
On Mon, Jun 17, 2013 at 10:19 PM, Jeff King wrote: > On Mon, Jun 17, 2013 at 07:00:40PM -0700, Brandon Casey wrote: > >> Curl requires that we manage any strings that we pass to it as pointers. >> So, we should not be overwriting this strbuf after we've passed it to >&g

[PATCH] http.c: don't rewrite the user:passwd string multiple times

2013-06-17 Thread Brandon Casey
From: Brandon Casey Curl requires that we manage any strings that we pass to it as pointers. So, we should not be overwriting this strbuf after we've passed it to curl. Additionally, it is unnecessary since we only prompt for the user name and password once, so we end up overwriting the s

[PATCH 2/2] t/t9802: explicitly name the upstream branch to use as a base

2013-06-17 Thread Brandon Casey
From: Brandon Casey Prior to commit fa83a33b, the 'git checkout' DWIMery would create a new local branch if the specified branch name did not exist and it matched exactly one ref in the "remotes" namespace. It searched the "remotes" namespace for matching refs us

[PATCH 1/2] builtin/checkout.c: don't leak memory in check_tracking_name

2013-06-17 Thread Brandon Casey
From: Brandon Casey remote_find_tracking() populates the query struct with an allocated string in the dst member. So, we do not need to xstrdup() the string, since we can transfer ownership from the query struct (which will go out of scope at the end of this function) to our callback struct

Re: [PATCH] Documentation/CommunityGuidelines

2013-06-11 Thread Brandon Casey
On Tue, Jun 11, 2013 at 7:40 AM, Michael Haggerty wrote: > At the risk of being > presumptuous myself, I suggest that you show a copy of your email to > somebody whom you know and respect in the real world, somebody who is > not immersed in the Git community meltdown. For example, somebody like

Re: [Resend PATCH] t3903 (stash): add failing test for ref of form ^{/message}

2013-04-16 Thread Brandon Casey
On Tue, Apr 16, 2013 at 1:11 PM, Ramkumar Ramachandra wrote: > Brandon Casey wrote: >> # Save another stash here >> >> echo bash >file >> git add file >> git stash save "something" >> >>

  1   2   3   >