Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread David Kastrup
Junio C Hamano writes: > Taking two random examples from an early and a late parts of the > patch: > > --- a/builtin/cat-file.c > +++ b/builtin/cat-file.c > @@ -82,7 +82,7 @@ static int cat_one_file(int opt, const char *exp_type, > const char *obj_name) > enum objec

[PATCH v3 1/2] fsck.c: Change the type of fsck_ident()'s first argument

2014-03-12 Thread Yuxuan Shui
Since fsck_ident doesn't change the content of **ident, the type of ident could be const char **. This change is required to rewrite fsck_commit() to use skip_prefix(). Signed-off-by: Yuxuan Shui --- fsck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsck.c b/fsck.c

[PATCH v3 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-12 Thread Yuxuan Shui
Currently we use memcmp() in fsck_commit() to check if buffer start with a certain prefix, and skip the prefix if it does. This is exactly what skip_prefix() does. And since skip_prefix() has a self-explaintory name, this could make the code more readable. Signed-off-by: Yuxuan Shui --- fsck.c |

[PATCH v3 0/2] GSoC micro project, rewrite fsck_commit() to use skip_prefix()

2014-03-12 Thread Yuxuan Shui
Improved commit message, and added a missing hunk to the second commit. Yuxuan Shui (2): fsck.c: Change the type of fsck_ident()'s first argument fsck.c: Rewrite fsck_commit() to use skip_prefix() fsck.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) --

Re: [PATCH v2 1/2] fsck.c: Change the type of fsck_ident()'s first argument

2014-03-12 Thread Yuxuan Shui
Hi, On Thu, Mar 13, 2014 at 4:22 AM, Jeff King wrote: > On Thu, Mar 13, 2014 at 02:51:29AM +0800, Yuxuan Shui wrote: > >> Since fsck_ident doesn't change the content of **ident, the type of >> ident could be const char **. > > Unfortunately, const double-pointers in C are a bit tricky, and a > po

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Quint Guvernator
>From what I can gather, there seems to be opposition to specific pieces of this patch. The following area is clearly the most controversial: > static inline int standard_header_field(const char *field, size_t len) > { > -return ((len == 4 && !memcmp(field, "tree ", 5)) || > -(l

[no subject]

2014-03-12 Thread Archana KC
Hello Dear, This is a personal email directed to you. My wife and I won the Euro Millions Jackpot Lottery of £148 million (Pounds) on August 10, 2012. We just commenced our Charity Donation and we will be giving out a cash donation of £7,000.000.00 GBP(Seven Million great Britain pounds) to five

Re: Re: [PATCH] implement submodule config cache for lookup of submodule names

2014-03-12 Thread Jonathan Nieder
Heiko Voigt wrote: > On Tue, Mar 11, 2014 at 07:28:52PM -0700, Jonathan Nieder wrote: >> Heiko Voigt wrote: >>> +static unsigned int hash_sha1_string(const unsigned char *sha1, const char >>> *string) >>> +{ >>> + return memhash(sha1, 20) + strhash(string); >>> +} >> >> Feels a bit unconvention

No progress from push when using bitmaps

2014-03-12 Thread Shawn Pearce
Today I tried pushing a copy of linux.git from a client that had bitmaps into a JGit server. The client stalled for a long time with no progress, because it reused the existing pack. No progress appeared while it was sending the existing file on the wire: $ git push git://localhost/linux.git mas

Re: Re: [PATCH] implement submodule config cache for lookup of submodule names

2014-03-12 Thread Heiko Voigt
Hi, On Tue, Mar 11, 2014 at 07:28:52PM -0700, Jonathan Nieder wrote: > Heiko Voigt wrote: > > > This submodule configuration cache allows us to lazily read .gitmodules > > configurations by commit into a runtime cache which can then be used to > > easily lookup values from it. Currently only the

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Duy Nguyen
On Thu, Mar 13, 2014 at 12:22 AM, Jens Lehmann wrote: > That spot uses memcmp() because ce->name may > not be 0-terminated. ce->name is 0-terminated (at least if it's created the normal way, I haven't checked where this "ce" in submodule.c comes from). ce_namelen() is just an optimization because

[PATCH v5] install_branch_config: simplify verbose messages logic

2014-03-12 Thread Paweł Wawruch
Replace the chain of if statements with table of strings. Signed-off-by: Paweł Wawruch --- Thanks to Eric Sunshine and Junio C Hamano. Simplified printing logic. The name moved to a table. v4: http://thread.gmane.org/gmane.comp.version-control.git/243914 v3: http://thread.gmane.org/gmane.comp.ve

Re: [PATCH] mv: prevent mismatched data when ignoring errors.

2014-03-12 Thread brian m. carlson
On Tue, Mar 11, 2014 at 02:45:59PM -0700, Junio C Hamano wrote: > Thanks. Neither this nor John's seems to describe the user-visible > way to trigger the symptom. Can we have tests for them? I'll try to get to writing some test today or tomorrow. I just noticed the bugginess by looking at the c

Re: Microproject idea: new OPT_* macros for PARSE_OPT_NONEG

2014-03-12 Thread Duy Nguyen
On Sat, Mar 8, 2014 at 2:20 AM, Junio C Hamano wrote: > Looking at "git grep -B3 OPT_NONEG" output, it seems that NONEG is > associated mostly with OPTION_CALLBACK and OPTION_SET_INT in the > existing code. > > Perhaps OPT_SET_INT should default to not just OPT_NOARG but also > OPT_NONEG? There a

Re: Re* [RFC PATCH 2/1] Make request-pull able to take a refspec of form local:remote

2014-03-12 Thread Eric Sunshine
On Wed, Mar 12, 2014 at 2:04 PM, Junio C Hamano wrote: > Subject: [PATCH] request-pull: documentation updates > > The original description talked only about what it does. Instead, > start it with the purpose of the command, i.e. what it is used for, > and then mention what it does to achieve that

Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-12 Thread Eric Sunshine
On Wed, Mar 12, 2014 at 6:02 PM, Junio C Hamano wrote: > Eric Sunshine writes: > >>> + if (origin && remote_is_branch) >>> + >>> printf_ln(_(message[!remote_is_branch][!origin][!rebasing]), >>> + local, name, origin); >>>

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Junio C Hamano
Jeff King writes: > So I think the whole function could use some refactoring to handle > corner cases better. I'll try to take a look tomorrow, but please > feel free if somebody else wants to take a crack at it. Yup, thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Junio C Hamano
Jeff King writes: > Thanks, I think this is a real readability improvement in most cases. > ... > > I tried: > > perl -i -lpe ' > s/memcmp\(([^,]+), "(.*?)", (\d+)\)/ > length($2) == $3 ? >qq{!starts_with($1, "$2")} : >$& > /ge > ' $(git ls-files '*.c') > > That c

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 05:14:15PM -0400, Jeff King wrote: > One thing that bugs me about the current code is that the sub-function > looks one past the end of the length given to it by the caller. > Switching it to pass "eof - line + 1" resolves that, but is it right? > > The character pointed a

Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-12 Thread Junio C Hamano
Eric Sunshine writes: >> + if (origin && remote_is_branch) >> + >> printf_ln(_(message[!remote_is_branch][!origin][!rebasing]), >> + local, name, origin); >> else >> - die("BUG: impossible com

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread René Scharfe
Am 12.03.2014 22:16, schrieb David Kastrup: René Scharfe writes: Am 12.03.2014 20:39, schrieb Junio C Hamano: Jeff King writes: static inline int standard_header_field(const char *field, size_t len) { - return ((len == 4 && !memcmp(field, "tree ", 5)) || - (len ==

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 05:14:15PM -0400, Jeff King wrote: > I also think that "eof = next" (which I retained here) is off-by-one. > "next" here is not the newline, but the start of the next line. And I'm > guessing the code actually wanted the newline (otherwise "it->key" ends > up with the newli

[PATCH][GSOC2014] install_branch_config: change logical chain to lookup table

2014-03-12 Thread TamerTas
Signed-off-by: TamerTas -- Thanks for the feedback. Comments below. I've made the suggested changes [1] to patch [2] but, since there are different number of format specifiers, an if-else clause is necessary. Removing the if-else chain completely doesn't seem to be possible. So making the f

[PATCH v2 4/4] wt-status: lift the artificual "at least 20 columns" floor

2014-03-12 Thread Junio C Hamano
When we show unmerged paths, we had an artificial 20 columns floor for the width of labels (e.g. "both deleted:") shown next to the pathnames. Depending on the locale, this may result in a label that is too wide when all the label strings are way shorter than 20 columns, or no-op when a label stri

[PATCH v2 3/4] wt-status: i18n of section labels

2014-03-12 Thread Junio C Hamano
From: Jonathan Nieder From: Jonathan Nieder Date: Thu, 19 Dec 2013 11:43:19 -0800 The original code assumes that: (1) the number of bytes written is the width of a string, so they can line up; (2) the "how" string is always <= 19 bytes. Neither of which we should assume. Using the sa

[PATCH v2 2/4] wt-status: extract the code to compute width for labels

2014-03-12 Thread Junio C Hamano
From: Jonathan Nieder From: Jonathan Nieder Date: Thu, 19 Dec 2013 11:43:19 -0800 Signed-off-by: Junio C Hamano --- wt-status.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/wt-status.c b/wt-status.c index 9cf7028..db98c52 100644 --- a/wt-status.c

[PATCH v2 1/4] wt-status: make full label string to be subject to l10n

2014-03-12 Thread Junio C Hamano
Earlier in 3651e45c (wt-status: take the alignment burden off translators, 2013-11-05), we assumed that it is OK to make the string before the colon in a label string we give as the section header of various kinds of changes (e.g. "new file:") translatable. This assumption apparently does not hold

[PATCH v2 0/4] status: allow label strings to be translated

2014-03-12 Thread Junio C Hamano
So here is my attempt to clean-up what Jonathan posted in $gmane/239537 as "how about this?" patch. The first one (full label string) fixes up 3651e45c (wt-status: take the alignment burden off translators, 2013-11-05) to include colon back to translatable string again, while retaining its label a

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread David Kastrup
René Scharfe writes: > Am 12.03.2014 20:39, schrieb Junio C Hamano: >> Jeff King writes: >> static inline int standard_header_field(const char *field, size_t len) { - return ((len == 4 && !memcmp(field, "tree ", 5)) || - (len == 6 && !memcmp(field, "parent ", 7)

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 01:08:03PM -0700, Junio C Hamano wrote: > Jeff King writes: > > >> Blindly replacing starts_with() with !memcmp() in the above part is > >> a readability regression otherwise. > > > > I actually think the right solution is: > > > > static inline int standard_header_fiel

Re: New GSoC microproject ideas

2014-03-12 Thread David Kastrup
Jeff King writes: > On Wed, Mar 12, 2014 at 09:37:41PM +0100, David Kastrup wrote: > >> > Try: >> > >> > zippo() { >> > echo $XXX >> > } >> > XXX=8 zippo >> > zippo >> > >> > XXX remains set after the first call under dash (but not bash). I >> > believe "ash" has the same behavior. >>

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread René Scharfe
Am 12.03.2014 20:39, schrieb Junio C Hamano: Jeff King writes: static inline int standard_header_field(const char *field, size_t len) { - return ((len == 4 && !memcmp(field, "tree ", 5)) || - (len == 6 && !memcmp(field, "parent ", 7)) || - (len == 6 && !me

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread David Kastrup
Junio C Hamano writes: > Jeff King writes: > >>> static inline int standard_header_field(const char *field, size_t len) >>> { >>> - return ((len == 4 && !memcmp(field, "tree ", 5)) || >>> - (len == 6 && !memcmp(field, "parent ", 7)) || >>> - (len == 6 && !memcmp(field, "a

Re: New GSoC microproject ideas

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 09:37:41PM +0100, David Kastrup wrote: > > Try: > > > > zippo() { > > echo $XXX > > } > > XXX=8 zippo > > zippo > > > > XXX remains set after the first call under dash (but not bash). I > > believe "ash" has the same behavior. > > Yes. I would lean towards con

Re: [PATCH v2] status merge: guarentee space between msg and path

2014-03-12 Thread Junio C Hamano
Sandy Carter writes: > Seems fine except for the bit about returning _("bug"), which I brought up. > > Seems to do the same thing as my proposal without changing the > alignment of paths in of regular status output. No changes to tests > necessary, less noisy. > > It works for me. Thanks. I'll

Re: New GSoC microproject ideas

2014-03-12 Thread David Kastrup
Jeff King writes: > On Wed, Mar 12, 2014 at 08:16:53PM +0100, David Kastrup wrote: > >> Junio C Hamano writes: >> >> > Here is another, as I seem to have managed to kill another one ;-) >> > >> > -- >8 -- >> > >> > "VAR=VAL command" is sufficient to run 'command' with environment >> > variable

Re: [PATCH v2 1/2] fsck.c: Change the type of fsck_ident()'s first argument

2014-03-12 Thread Jeff King
On Thu, Mar 13, 2014 at 02:51:29AM +0800, Yuxuan Shui wrote: > Since fsck_ident doesn't change the content of **ident, the type of > ident could be const char **. Unfortunately, const double-pointers in C are a bit tricky, and a pointer to "char *" cannot automatically be passed as a pointer to "

Re: [PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Junio C Hamano
Orgad Shaneh writes: > +--verbose:: > + This option is valid for add and update commands. Display the progress > + of the actual submodule checkout. Hmm, is the "valid for add and update" part we want to keep? I do not think it is a crime if some other subcommand accepted --verbose opti

Re: [PATCH] wt-status: i18n of section labels

2014-03-12 Thread Sandy Carter
Le 2014-03-12 16:12, Junio C Hamano a écrit : Sandy Carter writes: Le 2014-03-12 15:22, Junio C Hamano a écrit : static const char *wt_status_diff_status_string(int status) { switch (status) { case DIFF_STATUS_ADDED: - return _("new file"); +

Re: [PATCH] wt-status: i18n of section labels

2014-03-12 Thread Junio C Hamano
Sandy Carter writes: > Le 2014-03-12 15:22, Junio C Hamano a écrit : >> static const char *wt_status_diff_status_string(int status) >> { >> switch (status) { >> case DIFF_STATUS_ADDED: >> -return _("new file"); >> +return _("new file:"); >> case DIFF_STA

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Junio C Hamano
Jeff King writes: >> Blindly replacing starts_with() with !memcmp() in the above part is >> a readability regression otherwise. > > I actually think the right solution is: > > static inline int standard_header_field(const char *field, size_t len) > { > return mem_equals(field, len,

Re: [PATCH v2] status merge: guarentee space between msg and path

2014-03-12 Thread Sandy Carter
Le 2014-03-12 15:28, Junio C Hamano a écrit : Sandy Carter writes: Add space between how and one when printing status of unmerged data. This fixes an appending of the how message when it is longer than 20, such is the case in some translations such as the french one where the colon gets appe

[PATCH 2/2] rev-list: disable object/refname ambiguity check with --stdin

2014-03-12 Thread Jeff King
This is the "rev-list" analogue to 25fba78 (cat-file: disable object/refname ambiguity check for batch mode, 2013-07-12). Like cat-file, "rev-list --stdin" may read a large number of sha1 object names, and the warning check introduces a significant slow-down. Signed-off-by: Jeff King --- revisi

[PATCH 1/2] cat-file: restore warn_on_object_refname_ambiguity flag

2014-03-12 Thread Jeff King
Commit 25fba78 turned off the object/refname ambiguity check during "git cat-file --batch" operations. However, this is a global flag, so let's restore it when we are done. This shouldn't make any practical difference, as cat-file exits immediately afterwards, but is good code hygeine and would pr

Re: What's cooking in git.git (Mar 2014, #02; Tue, 11)

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 03:35:09PM -0400, Jeff King wrote: > On Tue, Mar 11, 2014 at 03:12:11PM -0700, Junio C Hamano wrote: > > > * jk/warn-on-object-refname-ambiguity (2014-01-09) 6 commits > [...] > Having looked at it again, I really think it is not worth pursuing. The > end goal is not that

Re: [PATCH] wt-status: i18n of section labels

2014-03-12 Thread Sandy Carter
Le 2014-03-12 15:22, Junio C Hamano a écrit : static const char *wt_status_diff_status_string(int status) { switch (status) { case DIFF_STATUS_ADDED: - return _("new file"); + return _("new file:"); case DIFF_STATUS_COPIED: -

[PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Orgad Shaneh
Add the verbose flag to add and update which displays the progress of the actual submodule checkout when given. This is useful for checkouts that take a long time, as the user can then see the progress. Signed-off-by: Orgad Shaneh --- Documentation/git-submodule.txt | 7 +-- git-submodule.s

Re: [PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Orgad Shaneh
On Wed, Mar 12, 2014 at 6:15 PM, Jens Lehmann wrote: > > Am 12.03.2014 14:42, schrieb Orgad Shaneh: > > From: Orgad Shaneh > > You don't need the line above when you are the sender ;-) > > > Executes checkout without -q > > That's a bit terse. What about: > > "Add the verbose flag to add and upda

Re: What's cooking in git.git (Mar 2014, #02; Tue, 11)

2014-03-12 Thread Junio C Hamano
Jeff King writes: > On Tue, Mar 11, 2014 at 03:12:11PM -0700, Junio C Hamano wrote: > >> * jk/warn-on-object-refname-ambiguity (2014-01-09) 6 commits >> - get_sha1: drop object/refname ambiguity flag >> - get_sha1: speed up ambiguous 40-hex test >> - FIXUP: teach DO_FOR_EACH_NO_RECURSE to prim

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 12:39:01PM -0700, Junio C Hamano wrote: > Jeff King writes: > > >> static inline int standard_header_field(const char *field, size_t len) > >> { > >> - return ((len == 4 && !memcmp(field, "tree ", 5)) || > >> - (len == 6 && !memcmp(field, "parent ", 7)) || > >

Re: [PATCH v2 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-12 Thread Junio C Hamano
Yuxuan Shui writes: > The purpose of skip_prefix() is much clearer than memcmp(). Also > skip_prefix() takes one less argument and its return value makes > more sense. Instead of justifying the change with a subjective-sounding and vague "much clearer" and "makes more sense", perhaps you can st

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Junio C Hamano
Jeff King writes: >> static inline int standard_header_field(const char *field, size_t len) >> { >> -return ((len == 4 && !memcmp(field, "tree ", 5)) || >> -(len == 6 && !memcmp(field, "parent ", 7)) || >> -(len == 6 && !memcmp(field, "author ", 7)) || >> -

Re: What's cooking in git.git (Mar 2014, #02; Tue, 11)

2014-03-12 Thread Jeff King
On Tue, Mar 11, 2014 at 03:12:11PM -0700, Junio C Hamano wrote: > * jk/warn-on-object-refname-ambiguity (2014-01-09) 6 commits > - get_sha1: drop object/refname ambiguity flag > - get_sha1: speed up ambiguous 40-hex test > - FIXUP: teach DO_FOR_EACH_NO_RECURSE to prime_ref_dir() > - refs: teac

Re: [PATCH v2] status merge: guarentee space between msg and path

2014-03-12 Thread Junio C Hamano
Sandy Carter writes: > Add space between how and one when printing status of unmerged data. > This fixes an appending of the how message when it is longer than 20, > such is the case in some translations such as the french one where the > colon gets appended to the file: > supprimé par nous

[PATCH] wt-status: i18n of section labels

2014-03-12 Thread Junio C Hamano
From: Jonathan Nieder Date: Thu, 19 Dec 11:43:19 2013 -0800 The original code assumes that: (1) the number of bytes written is the width of a string, so they can line up; (2) the "how" string is always <= 19 bytes. Also a recent change to a similar codepath by 3651e45c (wt-status: take

Re: New GSoC microproject ideas

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 08:16:53PM +0100, David Kastrup wrote: > Junio C Hamano writes: > > > Here is another, as I seem to have managed to kill another one ;-) > > > > -- >8 -- > > > > "VAR=VAL command" is sufficient to run 'command' with environment > > variable VAR set to value VAL without af

Re: New GSoC microproject ideas

2014-03-12 Thread David Kastrup
Junio C Hamano writes: > Here is another, as I seem to have managed to kill another one ;-) > > -- >8 -- > > "VAR=VAL command" is sufficient to run 'command' with environment > variable VAR set to value VAL without affecting the environment of > the shell itself, but we cannot do the same with a

Re: New GSoC microproject ideas

2014-03-12 Thread Junio C Hamano
Here is another, as I seem to have managed to kill another one ;-) -- >8 -- "VAR=VAL command" is sufficient to run 'command' with environment variable VAR set to value VAL without affecting the environment of the shell itself, but we cannot do the same with a shell function (most notably, "test_m

Re: [PATCH][GSoC] parse-options: Add OPT_SET_INT_NONEG.

2014-03-12 Thread Junio C Hamano
Yuxuan Shui writes: > On Thu, Mar 13, 2014 at 2:30 AM, Junio C Hamano wrote: >> Duy Nguyen writes: >> >>> By convention, no full stop in the subject line. The subject should >>> summarize your changes and "add ..NONEG" is just one part of it. The >>> other is "convert to use ...NONEG". So I sug

Re: git: problematic git status output with some translations (such as fr_FR)

2014-03-12 Thread Junio C Hamano
Jonathan Nieder writes: > @@ -292,6 +291,48 @@ static const char *wt_status_diff_status_string(int > status) > } > } > > +static int maxwidth(const char *(*label)(int), int minval, int maxval) > +{ > + const char *s; > + int result = 0, i; > + > + for (i = minval; i <= maxva

[PATCH v2 1/2] fsck.c: Change the type of fsck_ident()'s first argument

2014-03-12 Thread Yuxuan Shui
Since fsck_ident doesn't change the content of **ident, the type of ident could be const char **. This change is required to rewrite fsck_commit() to use skip_prefix(). Signed-off-by: Yuxuan Shui --- fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck.c b/fsck.c inde

[PATCH v2 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-12 Thread Yuxuan Shui
The purpose of skip_prefix() is much clearer than memcmp(). Also skip_prefix() takes one less argument and its return value makes more sense. Signed-off-by: Yuxuan Shui --- fsck.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fsck.c b/fsck.c index

[PATCH v2 0/2] GSoC micro project, use skip_prefix() in fsck_commit()

2014-03-12 Thread Yuxuan Shui
I'm sorry for resending these patches, but the previous ones miss the sign-offs. Yuxuan Shui (2): fsck.c: Change the type of fsck_ident()'s first argument fsck.c: Rewrite fsck_commit() to use skip_prefix() fsck.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions

Re: [PATCH] status merge: guarentee space between msg and path

2014-03-12 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Mar 12, 2014 at 3:26 AM, Junio C Hamano wrote: >> Sandy Carter writes: >> >>> 3651e45c takes the colon out of the control of the translators. >> >> That is a separate bug we would need to address, then. Duy Cc'ed. > > We went through this before > > http://thread.g

Re: [PATCH][GSoC] parse-options: Add OPT_SET_INT_NONEG.

2014-03-12 Thread Yuxuan Shui
Hi, On Thu, Mar 13, 2014 at 2:30 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> By convention, no full stop in the subject line. The subject should >> summarize your changes and "add ..NONEG" is just one part of it. The >> other is "convert to use ...NONEG". So I suggest "parse-options: >>

Re: What's cooking in git.git (Mar 2014, #02; Tue, 11)

2014-03-12 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Mar 12, 2014 at 5:12 AM, Junio C Hamano wrote: >> * nd/log-show-linear-break (2014-02-10) 1 commit >> - log: add --show-linear-break to help see non-linear history >> >> Attempts to show where a single-strand-of-pearls break in "git log" >> output. >> >> Will mer

Re: An idea for "git bisect" and a GSoC enquiry

2014-03-12 Thread Junio C Hamano
Jacopo Notarstefano writes: > On Mon, Mar 3, 2014 at 7:34 PM, Junio C Hamano wrote: >> I think you fundamentally cannot use two labels that are merely >> "distinct" and bisect correctly. You need to know which ones >> (i.e. good) are to be excluded and the other (i.e. bad) are to be >> included

Re: [PATCH][GSoC] parse-options: Add OPT_SET_INT_NONEG.

2014-03-12 Thread Junio C Hamano
Duy Nguyen writes: > By convention, no full stop in the subject line. The subject should > summarize your changes and "add ..NONEG" is just one part of it. The > other is "convert to use ...NONEG". So I suggest "parse-options: > convert to use new macro OPT_SET_INT_NONEG()" or something like that

[PATCH 2/2] fsck.c: Rewrite fsck_commit() to use skip_prefix()

2014-03-12 Thread Yuxuan Shui
The purpose of skip_prefix() is much clearer than memcmp(). Also skip_prefix() takes one less argument and its return value makes more sense. --- fsck.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fsck.c b/fsck.c index 1789c34..7e6b829 100644 ---

[PATCH 1/2] fsck.c: Change the type of fsck_ident()'s first argument

2014-03-12 Thread Yuxuan Shui
Since fsck_ident doesn't change the content of **ident, the type of ident could be const char **. This change is required to rewrite fsck_commit() to use skip_prefix(). --- fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck.c b/fsck.c index 99c0497..1789c34 100644 ---

[PATCH 0/2] GSoC micro project, use skip_prefix() in fsck_commit()

2014-03-12 Thread Yuxuan Shui
Yuxuan Shui (2): fsck.c: Change the type of fsck_ident()'s first argument fsck.c: Rewrite fsck_commit() to use skip_prefix() fsck.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe git"

Re: Re* [RFC PATCH 2/1] Make request-pull able to take a refspec of form local:remote

2014-03-12 Thread Junio C Hamano
Junio C Hamano writes: > Sorry for back-burnering this topic so long. > > I think the following does what you suggested in the message I am > responding to. > > Now, hopefully the only thing we need is a documentation update and > the series should be ready to go. ... and here it is, to be sanit

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 06:22:24PM +0100, Jens Lehmann wrote: > > Let me know if you still think the hunk should be dropped there. > > Yes, I think so. That spot uses memcmp() because ce->name may > not be 0-terminated. If that assumption isn't correct, it should > be replaced with a plain strcmp

Re: [PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Jeff King
On Wed, Mar 12, 2014 at 10:43:54AM -0400, Quint Guvernator wrote: > memcmp() is replaced with negated starts_with() when comparing strings > from the beginning. starts_with() looks nicer and it saves the extra > argument of the length of the comparing string. Thanks, I think this is a real readab

Re: [PATCH][GSoC] parse-options: Add OPT_SET_INT_NONEG.

2014-03-12 Thread Yuxuan Shui
On Wed, Mar 12, 2014 at 6:47 PM, Duy Nguyen wrote: > By convention, no full stop in the subject line. The subject should > summarize your changes and "add ..NONEG" is just one part of it. The > other is "convert to use ...NONEG". So I suggest "parse-options: > convert to use new macro OPT_SET_INT_

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Jens Lehmann
Am 12.03.2014 17:46, schrieb Quint Guvernator: > 2014-03-12 11:47 GMT-04:00 Jens Lehmann : >> I think this hunk should be dropped as the memcmp() here doesn't mean >> "starts with" but "is identical" (due to the "ce_namelen(ce) == 11" in >> the line above). > > There is an issue with negation in t

Re: Re: [PATCH] implement submodule config cache for lookup of submodule names

2014-03-12 Thread Heiko Voigt
On Tue, Mar 11, 2014 at 05:58:08PM -0400, Jeff King wrote: > On Mon, Mar 10, 2014 at 10:24:12PM +0100, Heiko Voigt wrote: > > > I have also moved all functions into the new submodule-config-cache > > module. I am not completely satisfied with the naming since it is quite > > long. If someone comes

Re: [PATCH] rev-parse --parseopt: option argument name hints

2014-03-12 Thread Junio C Hamano
Ilya Bobyr writes: > I though that an example just to describe `argh' while useful would > look a bit disproportional, compared to the amount of text on > --parseopt. > > But now that I've added a "Usage text" section to looks quite in place. Good thinking. > I was also wondering about the poss

Re: egit vs. git behaviour (was: [RFC/WIP] Pluggable reference backends)

2014-03-12 Thread Shawn Pearce
On Wed, Mar 12, 2014 at 3:26 AM, Andreas Krey wrote: > On Mon, 10 Mar 2014 19:39:00 +, Shawn Pearce wrote: >> Yes, this was my real concern. Eclipse users using EGit expect EGit to >> be compatible with git-core at the filesystem level so they can do >> something in EGit then switch to a shell

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Quint Guvernator
2014-03-12 11:47 GMT-04:00 Jens Lehmann : > I think this hunk should be dropped as the memcmp() here doesn't mean > "starts with" but "is identical" (due to the "ce_namelen(ce) == 11" in > the line above). There is an issue with negation in this patch. I've submitted a new one [1] to the mailing l

Re: [PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Jens Lehmann
Am 12.03.2014 14:42, schrieb Orgad Shaneh: > From: Orgad Shaneh You don't need the line above when you are the sender ;-) > Executes checkout without -q That's a bit terse. What about: "Add the verbose flag to add and update which displays the progress of the actual submodule checkout when gi

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Jens Lehmann
Am 12.03.2014 14:44, schrieb Quint Guvernator: > memcmp() is replaced with starts_with() when comparing strings from the > beginning. starts_with() looks nicer and it saves the extra argument of > the length of the comparing string. > > Signed-off-by: Quint Guvernator > --- ... > diff --git a/s

[PATCH] general style: replaces memcmp() with proper starts_with()

2014-03-12 Thread Quint Guvernator
memcmp() is replaced with negated starts_with() when comparing strings from the beginning. starts_with() looks nicer and it saves the extra argument of the length of the comparing string. note: this commit properly handles negation in starts_with() Signed-off-by: Quint Guvernator --- builtin/ap

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Quint Guvernator
2014-03-12 9:51 GMT-04:00 Duy Nguyen : > starts_with(..) == !memcmp(...). So > you need to negate every replacement. My apologies--it doesn't look like the tests caught it either. I will fix this and submit a new patch. -- To unsubscribe from this list: send the line "unsubscribe git" in the body

Re: [PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Duy Nguyen
On Wed, Mar 12, 2014 at 8:44 PM, Quint Guvernator wrote: > diff --git a/builtin/apply.c b/builtin/apply.c > index a7e72d5..8f21957 100644 > --- a/builtin/apply.c > +++ b/builtin/apply.c > @@ -846,8 +846,8 @@ static int has_epoch_timestamp(const char *nameline) > * -MM-DD hh:mm:ss must

[PATCH] general style: replaces memcmp() with starts_with()

2014-03-12 Thread Quint Guvernator
memcmp() is replaced with starts_with() when comparing strings from the beginning. starts_with() looks nicer and it saves the extra argument of the length of the comparing string. Signed-off-by: Quint Guvernator --- builtin/apply.c | 10 +- builtin/cat-file.c

[PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Orgad Shaneh
From: Orgad Shaneh Executes checkout without -q Signed-off-by: Orgad Shaneh --- Documentation/git-submodule.txt | 7 +-- git-submodule.sh| 24 +++- t/t7406-submodule-update.sh | 9 + 3 files changed, 33 insertions(+), 7 deletions(-) diff -

Re: What's cooking in git.git (Mar 2014, #01; Tue, 4)

2014-03-12 Thread Duy Nguyen
On Wed, Mar 5, 2014 at 7:10 AM, Junio C Hamano wrote: > [Graduated to "master"] > * jk/pack-bitmap (2014-02-12) 26 commits > (merged to 'next' on 2014-02-25 at 5f65d26) And it's finally in! Shall we start thinking about the next on-disk format? It was put aside last time to focus on getting thi

Re: [GSoC14][RFC] Proposal Draft: Refactor tempfile handling

2014-03-12 Thread Brian Gesiak
> Currently the linked list of lockfiles only grows, never shrinks. Once > an object has been linked into the list, there is no way to remove it > again even after the lock has been released. So if a lock needs to be > created dynamically at a random place in the code, its memory is > unavoidably

New GSoC microproject ideas

2014-03-12 Thread Michael Haggerty
Hi, I just added a few microproject suggestions to the list for newly-arriving students [1]. A couple of them are weak, but I think number 17 has enough aspects to keep a whole crew of students busy for a while. Michael [1] http://git.github.io/SoC-2014-Microprojects.html -- Michael Haggerty

Re: [RFC/WIP] Pluggable reference backends

2014-03-12 Thread Michael Haggerty
Karsten, Thanks for your feedback! On 03/11/2014 11:56 AM, Karsten Blees wrote: > Am 10.03.2014 12:00, schrieb Michael Haggerty: >> >> Reference transactions -- > > Very cool ideas indeed. > > However, I'm concerned a bit that transactions are conceptual > overkill. How man

Re: [PATCH][GSoC] parse-options: Add OPT_SET_INT_NONEG.

2014-03-12 Thread Duy Nguyen
By convention, no full stop in the subject line. The subject should summarize your changes and "add ..NONEG" is just one part of it. The other is "convert to use ...NONEG". So I suggest "parse-options: convert to use new macro OPT_SET_INT_NONEG()" or something like that. You should also explain in

egit vs. git behaviour (was: [RFC/WIP] Pluggable reference backends)

2014-03-12 Thread Andreas Krey
On Mon, 10 Mar 2014 19:39:00 +, Shawn Pearce wrote: > Yes, this was my real concern. Eclipse users using EGit expect EGit to > be compatible with git-core at the filesystem level so they can do > something in EGit then switch to a shell and bang out a command, or > run a script provided by thei

Re: [PATCH] install_branch_config(): switch from 'else-if' series to 'nested if-else'

2014-03-12 Thread Matthieu Moy
Nishhal Gaba writes: > From: Nishchal Set user.email/user.name and sendemail.from to the same address to avoid this inline From:. > I am Nishchal Gaba, a GSOC 2014 aspirant, submitting patch in response to > microproject(8) This part of your message is the commit message. It should justify w

Re: [PATCH] SoC 2014 MicroProject No.8:change multiple if-else statement to table-driven approach

2014-03-12 Thread Eric Sunshine
Thanks for the submission. Comments below to give you a taste of the Git review process... On Tue, Mar 11, 2014 at 11:47 PM, Yao Zhao wrote: > Subject: SoC 2014 MicroProject No.8:change multiple if-else statement to > table-driven approach The email subject is extracted automatically by "git am

Re: [PATCH] submodule: add verbose mode for add/update

2014-03-12 Thread Eric Sunshine
On Mar 12, 2014, at 2:38 AM, Orgad Shaneh wrote: > Executes checkout without -q > — Missing sign-off. See Documentation/SubmittingPatches. Your patch is badly whitespace-damaged, as if it was pasted into your email client. “git send-email” can avoid this problem. As I’m not a submodule user, I

[PATCH] install_branch_config(): switch from 'else-if' series to 'nested if-else'

2014-03-12 Thread Nishhal Gaba
From: Nishchal I am Nishchal Gaba, a GSOC 2014 aspirant, submitting patch in response to microproject(8) Similar Execution Time, but increased readability Alternate Solution Discarded: Table driven code using commonanilty of the statements to be printed due to _() Signed-off-by: Nishchal Gaba

GSoC proposal: port pack bitmap support to libgit2.

2014-03-12 Thread Yuxuan Shui
Hi, I'm Yuxuan Shui, a undergraduate student from China. I'm applying for GSoC 2014, and here is my proposal: I found this idea on the ideas page, and did some research about it. The pack bitmap patchset add a new .bitmap file for every pack file which contains the reachability information of sel

Re: [PATCH] rev-parse --parseopt: option argument name hints

2014-03-12 Thread Ilya Bobyr
On 3/11/2014 12:10 PM, Junio C Hamano wrote: Junio C Hamano writes: Documentation on the whole argument parsing is quite short, so, I though, adding an example just to show how usage is generated would look like I am trying to make this feature look important than it is :) You already are by

[PATCH] Add grep.fullName config variable

2014-03-12 Thread Andreas Schwab
This configuration variable sets the default for the --full-name option. Signed-off-by: Andreas Schwab --- Documentation/git-grep.txt | 3 +++ grep.c | 5 + 2 files changed, 8 insertions(+) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index f83733

  1   2   >