Re: [PATCH 1/5] add SWAP macro

2017-05-01 Thread René Scharfe
Am 30.04.2017 um 05:11 schrieb Jeff King: > On Sat, Apr 29, 2017 at 08:16:17PM +0200, René Scharfe wrote: > >>> I dunno. I could go either way. Or we could leave it as-is, and let >>> valgrind find the problem. That has zero run-time cost, but of course >>> nobody bothers to run valgrind outside

Re: [PATCH 1/5] submodule_move_head: fix leak of struct child_process

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 8:07 PM, Junio C Hamano wrote: > Brandon Williams writes: > >> On 05/01, Stefan Beller wrote: >>> While fixing the leak of `cp`, reuse it instead of having to declare >>> another struct child_process. >>> >>> Signed-off-by: Stefan

Re: [RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C

2017-05-01 Thread Junio C Hamano
Junio C Hamano writes: > "Daniel Ferreira (theiostream)" writes: > >> Reproducing either of these comparisons "natively" would simply >> require running run_diff_index() or run_diff_files() with >> DIFF_FORMAT_NUMSTAT and tweaking diff_flush() to format

Re: [PATCH 2/5] submodule_move_head: prepare env for child correctly

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 7:04 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> We forgot to prepare the submodule env, which is only a problem for >> nested submodules. See 2e5d6503bd (ls-files: fix recurse-submodules >> with nested submodules,

Re: [PATCH 0/5] Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 6:36 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> This applies to origin/master. >> >> For better readability and understandability for newcomers it is a good idea >> to not offer 2 APIs doing the same thing with on being

Re: [PATCH v2 09/25] mailinfo & mailsplit: check for EOF while parsing

2017-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > While POSIX states that it is okay to pass EOF to isspace() (and it seems > to be implied that EOF should *not* be treated as whitespace), and also to > pass EOF to ungetc() (which seems to be intended to fail without buffering > the

Re: [PATCH 0/5] Some submodule bugfixes and "reattaching detached HEADs"

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 6:35 PM, Junio C Hamano wrote: > Brandon Williams writes: > >> I don't know why submodules were originally designed to be in a >> detached HEAD state but I much prefer working on branches (as I'm sure >> many other developers do) so

[PATCH v3 3/6] rebase -i: add short command-name in --autosquash

2017-05-01 Thread Liam Beguin
teach `git rebase -i` to recognise short command-names when using the '--autosquash' option. This allows commit with titles beginning with "s! ..." and "f! ..." to be treated the same way as "squash! ..." and "fixup! ..." respectively. Signed-off-by: Liam Beguin ---

[PATCH v3 0/6] rebase -i: add config to abbreviate command-names

2017-05-01 Thread Liam Beguin
Add the 'rebase.abbreviateCommands' configuration option to allow `git rebase -i` to default to the single-letter command-names in the todo list. Using single-letter command-names can present two benefits. First, it makes it easier to change the action since you only need to replace a single

[PATCH v3 1/6] rebase -i: add abbreviated command-names handling

2017-05-01 Thread Liam Beguin
make sure 'add_exec_commands' and 'transform_todo_ids' also understand the abbreviated versions of the command-names. Signed-off-by: Liam Beguin --- git-rebase--interactive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 2/6] rebase -i: add abbreviate_commands function

2017-05-01 Thread Liam Beguin
Once the rest of the processing is done, the `abbreviate_commands` function is called. If the 'rebase.abbreviateCommands' option is set to true, the function will replace each command-name by its abbreviated form. Signed-off-by: Liam Beguin --- git-rebase--interactive.sh |

[PATCH v3 4/6] Documentation: move rebase.* config variables to a separate rebase-config.txt

2017-05-01 Thread Liam Beguin
Move configuration variables to a separate file in order to remove duplicates, and include it in config.txt and git-rebase.txt. The new descriptions are taken from config.txt as they are more verbose. Signed-off-by: Liam Beguin --- Documentation/config.txt| 31

[PATCH v3 5/6] Documentation: use preferred name for the 'todo list' script

2017-05-01 Thread Liam Beguin
Use "todo list" instead of "instruction list" or "todo-list" to reduce further confusion regarding the name of this script. Signed-off-by: Liam Beguin --- Documentation/rebase-config.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 6/6] Documentation: document the rebase.abbreviateCommands option

2017-05-01 Thread Liam Beguin
Signed-off-by: Liam Beguin --- Documentation/rebase-config.txt | 23 +++ 1 file changed, 23 insertions(+) diff --git a/Documentation/rebase-config.txt b/Documentation/rebase-config.txt index a9b1d496e63a..0f29b7d0b89a 100644 ---

Re: [PATCH v2 14/25] setup_discovered_git_dir(): help static analysis

2017-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > Coverity reported a memory leak in this function. However, it can only > be called once, as setup_git_directory() changes global state and hence > is not reentrant. > > Mark the variable as static to indicate that this is a singleton. > >

Re: [PATCH v2 23/25] name-rev: avoid leaking memory in the `deref` case

2017-05-01 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> When the `name_rev()` function is asked to dereference the tip name, it >> allocates memory. But when it turns out that another tip already >> described the commit better than the current

Re: [PATCH v2 23/25] name-rev: avoid leaking memory in the `deref` case

2017-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > When the `name_rev()` function is asked to dereference the tip name, it > allocates memory. But when it turns out that another tip already > described the commit better than the current one, we forgot to release > the memory. Very well

Re: [PATCH v2 24/25] show_worktree(): plug memory leak

2017-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > The buffer allocated by shorten_unambiguous_ref() needs to be released. Yes. Looks good. > > Discovered by Coverity. > > Signed-off-by: Johannes Schindelin > --- > builtin/worktree.c | 8 +--- > 1 file

Re: [PATCH v2 25/25] submodule_uses_worktrees(): plug memory leak

2017-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > There is really no reason why we would need to hold onto the allocated > string longer than necessary. Yup. The longer we make the duration between the allocation and the standard release, the more likely future code would add early

Re: [PATCH] credential doc: make multiple-helper behavior more prominent (Re: [PATCH] clone: handle empty config values in -c)

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 05:30:10PM -0700, Jonathan Nieder wrote: > > @@ -162,6 +152,16 @@ helper:: > > shell (so, for example, setting this to `foo --option=bar` will execute > > `git credential-foo --option=bar` via the shell. See the manual of > > specific helpers for examples of

Re: [PATCH] credential doc: make multiple-helper behavior more prominent (Re: [PATCH] clone: handle empty config values in -c)

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 05:21:14PM -0700, Jonathan Nieder wrote: > Subject: credential doc: make multiple-helper behavior more prominent > > Git's configuration system works by reading multiple configuration > files in order, from general to specific: > > - first, the system configuration

Re: [PATCH 1/5] submodule_move_head: fix leak of struct child_process

2017-05-01 Thread Junio C Hamano
Brandon Williams writes: > On 05/01, Stefan Beller wrote: >> While fixing the leak of `cp`, reuse it instead of having to declare >> another struct child_process. >> >> Signed-off-by: Stefan Beller > > This shouldn't be needed as 'finish_command' does the

Re: [PATCH] clone: handle empty config values in -c

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 05:05:15PM -0700, Jonathan Nieder wrote: > "git clone --config" uses the following incantation to add an item to > a config file, instead of replacing an existing value: > > git_config_set_multivar_gently(key, value, "^$", 0) > > As long as no existing value

Re: [PATCH v2] send-email: new options to walkaround email server limits

2017-05-01 Thread Junio C Hamano
xiaoqiang zhao writes: > Some email server(e.g. smtp.163.com) limits a fixed number emails to > be send per session(connection) and this will lead to a send faliure. > > With --batch-size= option, an auto reconnection will occur when > number of sent email reaches and the

Re: [PATCH 2/5] submodule_move_head: prepare env for child correctly

2017-05-01 Thread Junio C Hamano
Stefan Beller writes: > We forgot to prepare the submodule env, which is only a problem for > nested submodules. See 2e5d6503bd (ls-files: fix recurse-submodules > with nested submodules, 2017-04-13) for further explanation. > > Signed-off-by: Stefan Beller

Re: Proposal for missing blob support in Git repos

2017-05-01 Thread Junio C Hamano
Jonathan Tan writes: > On 05/01/2017 04:29 PM, Junio C Hamano wrote: >> Jonathan Tan writes: >> >>> Thanks for your comments. If you're referring to the codepath >>> involving write_sha1_file() (for example, builtin/hash-object -> >>> index_fd

Re: [PATCH 0/5] Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS

2017-05-01 Thread Junio C Hamano
Stefan Beller writes: > This applies to origin/master. > > For better readability and understandability for newcomers it is a good idea > to not offer 2 APIs doing the same thing with on being the #define of the > other. > > In the long run we may want to drop the macros

Re: [PATCH 0/5] Some submodule bugfixes and "reattaching detached HEADs"

2017-05-01 Thread Junio C Hamano
Brandon Williams writes: > I don't know why submodules were originally designed to be in a > detached HEAD state but I much prefer working on branches (as I'm sure > many other developers do) so the prospect of this becoming the norm is > exciting! :D The reason is because

Re: [PATCH v2 5/6] submodule: improve submodule_has_commits

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 6:02 PM, Brandon Williams wrote: > Teach 'submodule_has_commits()' to ensure that if a commit exists in a > submodule, that it is also reachable from a ref. > > This is a preparatory step prior to merging the logic which checks for > changed submodules

Re: [PATCH v2 1/6] submodule: rename add_sha1_to_array

2017-05-01 Thread Brandon Williams
On 05/01, Stefan Beller wrote: > On Mon, May 1, 2017 at 6:02 PM, Brandon Williams wrote: > > > Change-Id: Ia6d15f34cee4d0dc32f7a475c69f4cb3aa8ce5bf > > Uh? Oops! I forgot to run it through my scrubbing script... > > Maybe another side project for the long todo list: get

Re: [PATCH v2 1/6] submodule: rename add_sha1_to_array

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 6:02 PM, Brandon Williams wrote: > Change-Id: Ia6d15f34cee4d0dc32f7a475c69f4cb3aa8ce5bf Uh? Maybe another side project for the long todo list: get git-trailers into shape, such that it can be configured to yell at you upon formatting the patch or

[PATCH v2 6/6] submodule: refactor logic to determine changed submodules

2017-05-01 Thread Brandon Williams
There are currently two instances (fetch and push) where we want to determine if submodules have changed given some revision specification. These two instances don't use the same logic to generate a list of changed submodules and as a result there is a fair amount of code duplication. This patch

[PATCH v2 4/6] submodule: change string_list changed_submodule_paths

2017-05-01 Thread Brandon Williams
Eliminate a call to 'xstrdup()' by changing the string_list 'changed_submodule_paths' to duplicated strings added to it. Change-Id: Id4b53837a6e209c0c0837c9f5ba06c70df2ffe06 Signed-off-by: Brandon Williams --- submodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v2 2/6] submodule: rename free_submodules_sha1s

2017-05-01 Thread Brandon Williams
Rename 'free_submodules_sha1s()' to 'free_submodules_oids()' since the function frees a 'struct string_list' which has a 'struct oid_array' stored in the 'util' field. Change-Id: I0c52fa3af1b1492b196bcf52f8b8cc8f5daf085d Signed-off-by: Brandon Williams --- submodule.c | 5

[PATCH v2 3/6] submodule: remove add_oid_to_argv

2017-05-01 Thread Brandon Williams
The function 'add_oid_to_argv()' provides the same functionality as 'append_oid_to_argv()'. Remove this duplicate function and instead use 'append_oid_to_argv()' where 'add_oid_to_argv()' was previously used. Change-Id: Id0abea012707460cb7000df761e6557ba5cd88d9 Signed-off-by: Brandon Williams

[PATCH v2 1/6] submodule: rename add_sha1_to_array

2017-05-01 Thread Brandon Williams
Rename 'add_sha1_to_array()' to 'append_oid_to_array()' to more accurately describe what the function does since it handles 'struct object_id' and not sha1 character arrays. Change-Id: Ia6d15f34cee4d0dc32f7a475c69f4cb3aa8ce5bf Signed-off-by: Brandon Williams --- submodule.c |

[PATCH v2 5/6] submodule: improve submodule_has_commits

2017-05-01 Thread Brandon Williams
Teach 'submodule_has_commits()' to ensure that if a commit exists in a submodule, that it is also reachable from a ref. This is a preparatory step prior to merging the logic which checks for changed submodules when fetching or pushing. Change-Id: I4fed2acfa7e69a5fbbca534df165671e77a90f22

[PATCH v2 0/6] changed submodules

2017-05-01 Thread Brandon Williams
Changes in v2: - few tweaks in the commit messages of a couple of the commits - use 'GIT_MAX_HEXSZ + 1' as the hint size in [5/6] - added a comment in [5/6] better explaining the rational for having a quick, incorrect check for the existence of a commit in a submodule. Brandon Williams (6):

Re: Terrible bad performance for it blame --date=iso -C -C master --

2017-05-01 Thread Junio C Hamano
Samuel Lijin writes: > On Fri, Mar 31, 2017 at 10:52 AM, Junio C Hamano wrote: > >> It might not be a bad idea to teach "blame" not to pay attention to >> any path that is marked as "-diff" (e.g. binary files) when trying >> to see if remaining contents

Re: Proposal for missing blob support in Git repos

2017-05-01 Thread Brandon Williams
On 05/01, Jonathan Tan wrote: > On 05/01/2017 04:29 PM, Junio C Hamano wrote: > >Jonathan Tan writes: > > > >>Thanks for your comments. If you're referring to the codepath > >>involving write_sha1_file() (for example, builtin/hash-object -> > >>index_fd or

Re: Proposal for missing blob support in Git repos

2017-05-01 Thread Jonathan Tan
On 05/01/2017 04:29 PM, Junio C Hamano wrote: Jonathan Tan writes: Thanks for your comments. If you're referring to the codepath involving write_sha1_file() (for example, builtin/hash-object -> index_fd or builtin/unpack-objects), that is fine because

Re: [RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C

2017-05-01 Thread Junio C Hamano
"Daniel Ferreira (theiostream)" writes: > Reproducing either of these comparisons "natively" would simply > require running run_diff_index() or run_diff_files() with > DIFF_FORMAT_NUMSTAT and tweaking diff_flush() to format appropriately > for the "interactive--add case". A

Re: [PATCH] credential doc: make multiple-helper behavior more prominent (Re: [PATCH] clone: handle empty config values in -c)

2017-05-01 Thread Jonathan Nieder
Starting out the reviews: Jonathan Nieder wrote: [...] > configuration item to empty before giving it a new value. This is > already documented by the documentation is hard to find --- ^^ s/by/but/ Sorry for the confusion. [...] > +++ b/Documentation/gitcredentials.txt

Re: Bug Report: .gitignore behavior is not matching in git clean and git status

2017-05-01 Thread Junio C Hamano
Samuel Lijin writes: > After some more digging (and familiarizing myself with the > behind-the-scenes logic) the issue is that dir.c has this implicit > assumption that a directory which contains only untracked and ignored > files should itself be considered untracked. While

Re: [PATCH] credential doc: make multiple-helper behavior more prominent (Re: [PATCH] clone: handle empty config values in -c)

2017-05-01 Thread Brandon Williams
On 05/01, Jonathan Nieder wrote: > Subject: credential doc: make multiple-helper behavior more prominent > > Git's configuration system works by reading multiple configuration > files in order, from general to specific: > > - first, the system configuration /etc/gitconfig > - then the user's

[PATCH] credential doc: make multiple-helper behavior more prominent (Re: [PATCH] clone: handle empty config values in -c)

2017-05-01 Thread Jonathan Nieder
Subject: credential doc: make multiple-helper behavior more prominent Git's configuration system works by reading multiple configuration files in order, from general to specific: - first, the system configuration /etc/gitconfig - then the user's configuration (~/.gitconfig or

Re: [PATCH] clone: handle empty config values in -c

2017-05-01 Thread Brandon Williams
On 05/01, Jonathan Nieder wrote: > "git clone --config" uses the following incantation to add an item to > a config file, instead of replacing an existing value: > > git_config_set_multivar_gently(key, value, "^$", 0) > > As long as no existing value matches the regex ^$, that works as >

[PATCH] clone: handle empty config values in -c

2017-05-01 Thread Jonathan Nieder
"git clone --config" uses the following incantation to add an item to a config file, instead of replacing an existing value: git_config_set_multivar_gently(key, value, "^$", 0) As long as no existing value matches the regex ^$, that works as intended and adds to the config. When a value

Re: [PATCH v2 53/53] object: convert parse_object* to take struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: Make parse_object, parse_object_or_die, and parse_object_buffer take a pointer to struct object_id. Remove the temporary variables inserted earlier, since they are no longer necessary. Transform all of the callers using the following semantic

Re: git loses a commit after reordering.

2017-05-01 Thread Junio C Hamano
Nikita Orlov writes: >>On Sun, 30 Apr 2017, 1:56 +03:00 from Kevin Daudt : >>Not sure if this is the case here, but it at least confirms that rebase >>--preserve-merges was not meant to reorder commits. >> >>See [this][1] thread for more background on this

Re: Proposal for missing blob support in Git repos

2017-05-01 Thread Junio C Hamano
Jonathan Tan writes: > Thanks for your comments. If you're referring to the codepath > involving write_sha1_file() (for example, builtin/hash-object -> > index_fd or builtin/unpack-objects), that is fine because > write_sha1_file() invokes freshen_packed_object() and >

Re: [PATCHv2 0/3] Make diff plumbing commands respect the indentHeuristic.

2017-05-01 Thread Junio C Hamano
Jeff King writes: > PS Outside of our test scripts, I'd probably just have written: > > perl -lpe 'print "extra line" if $. == 2' > >I think we have traditionally preferred sed/awk to perl, but given >the heavy use of vanilla perl elsewhere in the test suite, I think

Re: [PATCH v2 39/53] refs/files-backend: convert many internals to struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: @@ -195,27 +195,18 @@ static const char PACKED_REFS_HEADER[] = * Return a pointer to the refname within the line (null-terminated), * or NULL if there was a problem. */ -static const char *parse_ref_line(struct strbuf *line, unsigned char

Re: What's cooking in git.git (May 2017, #01; Mon, 1)

2017-05-01 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> * ab/grep-pcre-v2 (2017-04-25) 20 commits >> - SQUASH??? >> - Makefile & configure: make PCRE v2 the default PCRE implementation >> - grep: remove support for concurrent use of both PCRE v1 & v2 >> - grep: add support for PCRE v2 >> -

[RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C

2017-05-01 Thread Daniel Ferreira (theiostream)
Hey there, So, in the GSoC proposal I sent about porting git-add--interactive to C[1], I expected I would be able to do a couple of small patches to git-add to familiarize myself with the Git API and have a better clue of how the porting process would go by. Due to the unexpected size my

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jonathan Tan
On 05/01/2017 03:27 PM, Jeff King wrote: On Mon, May 01, 2017 at 03:07:22PM -0700, Jonathan Tan wrote: @@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout( static uintmax_t change_note_fanout(struct tree_entry *root, unsigned char fanout) { - char

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 03:07:22PM -0700, Jonathan Tan wrote: > > @@ -2298,8 +2296,12 @@ static uintmax_t do_change_note_fanout( > > static uintmax_t change_note_fanout(struct tree_entry *root, > > unsigned char fanout) > > { > > - char hex_sha1[40], path[60]; > > - return

Re: [PATCHv3 3/4] diff: enable indent heuristic by default

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 06:13:44PM -0400, Marc Branchaud wrote: > From: Stefan Beller > > The feature was included in v2.11 (released 2016-11-29) and we got no > negative feedback. Quite the opposite, all feedback we got was positive. > > Turn it on by default. Users who

Re: [PATCHv3 0/4] Make diff plumbing commands respect the indentHeuristic.

2017-05-01 Thread Stefan Beller
> Changes since v2: > > Patch 1/4 : Unchanged. > > Patch 2/4 : Mentioned how the new behaviour matches the diff Porcelain. > > Patch 3/4 : Updated the tests. Thanks for picking up that patch and carrying it further! The whole series looks good to me. Thanks, Stefan

[PATCHv3 3/4] diff: enable indent heuristic by default

2017-05-01 Thread Marc Branchaud
From: Stefan Beller The feature was included in v2.11 (released 2016-11-29) and we got no negative feedback. Quite the opposite, all feedback we got was positive. Turn it on by default. Users who dislike the feature can turn it off by setting diff.indentHeuristic (which also

[PATCHv3 4/4] add--interactive: drop diff.indentHeuristic handling

2017-05-01 Thread Marc Branchaud
From: Jeff King Now that diff.indentHeuristic is handled automatically by the plumbing commands, there's no need to propagate it manually. Signed-off-by: Jeff King Signed-off-by: Marc Branchaud --- git-add--interactive.perl | 4 1 file

[PATCHv3 0/4] Make diff plumbing commands respect the indentHeuristic.

2017-05-01 Thread Marc Branchaud
On 2017-04-29 09:14 AM, Jeff King wrote: > On Sat, Apr 29, 2017 at 08:40:52AM -0400, Jeff King wrote: > >> On Fri, Apr 28, 2017 at 06:33:12PM -0400, Marc Branchaud wrote: >> >>> v2: Fixed up the commit messages and added tests. >>> >>> Marc Branchaud (2): >>> diff: make the indent heuristic

[PATCHv3 1/4] diff: make the indent heuristic part of diff's basic configuration

2017-05-01 Thread Marc Branchaud
This heuristic was originally introduced as an experimental feature, and therefore part of the UI configuration. But the user often sees diffs generated by plumbing commands like diff-tree. Moving the indent heuristic into diff's basic configuration prepares the way for diff plumbing commands to

[PATCHv3 2/4] diff: have the diff-* builtins configure diff before initializing revisions

2017-05-01 Thread Marc Branchaud
This matches how the diff Porcelain works. It makes the plumbing commands respect diff's configuration options, such as indentHeuristic, because init_revisions() calls diff_setup() which fills in the diff_options struct. Signed-off-by: Marc Branchaud ---

Re: [PATCH v2 11/53] fast-import: convert to struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: @@ -391,10 +391,8 @@ static void write_branch_report(FILE *rpt, struct branch *b) fputc('\n', rpt); fprintf(rpt, " tip commit : %s\n", oid_to_hex(>oid)); - fprintf(rpt, " old tree: %s\n", -

Re: [PATCH v2 09/53] builtin/rev-parse: convert to struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: @@ -340,7 +340,7 @@ static int try_parent_shorthands(const char *arg) } if (include_rev) - show_rev(NORMAL, sha1, arg); + show_rev(NORMAL, , arg); for (parents = commit->parents, parent_number =

Re: [PATCH] small memory leak fix

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 01:50:57PM -0700, Stefan Beller wrote: > > diff --git a/remote.c b/remote.c > > index 9f83fe2c4..2f8cb35a3 100644 > > --- a/remote.c > > +++ b/remote.c > > @@ -742,6 +742,8 @@ int for_each_remote(each_remote_fn fn, void *priv) > > r->push =

Re: [PATCH] cache-tree: reject entries with null sha1

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 11:00:58PM +0200, René Scharfe wrote: > Am 01.05.2017 um 21:22 schrieb Jeff King: > > On Mon, May 01, 2017 at 01:23:28PM +0200, René Scharfe wrote: > > > I can only get gcc and clang to call memcpy instead of inlining it by > > > specifying -fno-builtin. Do you use that

Re: [PATCH v2 00/53] object_id part 8

2017-05-01 Thread Stefan Beller
On Sun, Apr 30, 2017 at 7:28 PM, brian m. carlson wrote: > This is the eighth series of patches to convert unsigned char [20] to > struct object_id. This series converts lookup_commit, lookup_blob, > lookup_tree, lookup_tag, and finally parse_object to struct

Re: [PATCH] cache-tree: reject entries with null sha1

2017-05-01 Thread René Scharfe
Am 01.05.2017 um 21:22 schrieb Jeff King: On Mon, May 01, 2017 at 01:23:28PM +0200, René Scharfe wrote: I can only get gcc and clang to call memcpy instead of inlining it by specifying -fno-builtin. Do you use that option? If yes, why? (Just curious.) I do my normal edit-compile cycles

Re: [PATCH] small memory leak fix

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 1:40 PM, David CARLIER wrote: > Hi this is my first submission, a memory leak found in the maint branch > (might be in master as well). > > Kind regards. Hi and welcome to Git! > From d98f3944780730447f111a4178c9d99f5110c260 Mon Sep 17 00:00:00 2001 >

[PATCH] small memory leak fix

2017-05-01 Thread David CARLIER
Hi this is my first submission, a memory leak found in the maint branch (might be in master as well). Kind regards. 0001-memory-leaks-fixes-for-remote-lists.patch Description: Binary data

Re: What's cooking in git.git (May 2017, #01; Mon, 1)

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 04:25:14PM +0200, Ævar Arnfjörð Bjarmason wrote: > > * ab/grep-pcre-v2 (2017-04-25) 20 commits > [...] > > * ab/grep-threading-cleanup (2017-04-16) 8 commits > [...] > > > > Needs review. > > Between these two series there's 27 patches, and I understand it's a > bit of a

Re: [PATCH] cache-tree: reject entries with null sha1

2017-05-01 Thread Jeff King
On Mon, May 01, 2017 at 01:23:28PM +0200, René Scharfe wrote: > Am 24.04.2017 um 12:39 schrieb Duy Nguyen: > > BTW, I ran t7009 with valgrind and it reported this. Is it something > > we should be worried about? I vaguely recall you're doing something > > with prio-queue... > > > > ==4246==

Re: Proposal for missing blob support in Git repos

2017-05-01 Thread Jonathan Tan
On 04/30/2017 08:57 PM, Junio C Hamano wrote: One thing I wonder is what the performance impact of a change like this to the codepath that wants to see if an object does _not_ exist in the repository. When creating a new object by hashing raw data, we see if an object with the same name already

[PATCH 4/5] cache.h: drop read_cache_preload(pathspec)

2017-05-01 Thread Stefan Beller
coccinelle patch: @@ expression E; @@ -read_cache_preload(E) +read_index_preload(_index, E) Additionally manual editing: * drop the define from cache.h. * builtin/{commit,describe}.c were not picked up as we have NULL and the address of an expression. Converted them manually. *

[PATCH 1/5] cache.h: drop read_cache()

2017-05-01 Thread Stefan Beller
This patch is produced via coccinelle using this semantic patch: @@ @@ -read_cache() +read_index(_index) Additional manual editing: * drop define in cache.h * a comment in builtin/check-ignore.c and read-cache.c were converted * builtin/diff.c: fix error message referencing the function.

[PATCH 2/5] cache.h: drop active_* macros

2017-05-01 Thread Stefan Beller
Based on the coccinelle patch: @@ @@ -active_cache +the_index.cache @@ @@ -active_nr +the_index.cache_nr @@ @@ -active_alloc +the_index.cache_alloc @@ @@ -active_cache_changed +the_index.cache_changed @@ @@ -active_cache_tree +the_index.cache_tree Additional manual editing: * drop the macros

[PATCH 5/5] cache.h: drop read_cache_unmerged()

2017-05-01 Thread Stefan Beller
@@ @@ -read_cache_unmerged() +read_index_unmerged(_index) Additionally drop the define from cache.h manually. Signed-off-by: Stefan Beller --- builtin/am.c| 2 +- builtin/merge.c | 2 +- builtin/pull.c | 2 +- builtin/read-tree.c | 2 +- builtin/reset.c

[PATCH 3/5] cache.h: drop read_cache_from

2017-05-01 Thread Stefan Beller
coccinelle patch: @@ expression E; @@ -read_cache_from(E) +read_index_from(_index, E) additionally drop the define from cache.h manually Signed-off-by: Stefan Beller --- apply.c | 2 +- builtin/am.c | 4 ++-- builtin/commit.c | 6 +++--- cache.h | 1 -

[PATCH 0/5] Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS

2017-05-01 Thread Stefan Beller
This applies to origin/master. For better readability and understandability for newcomers it is a good idea to not offer 2 APIs doing the same thing with on being the #define of the other. In the long run we may want to drop the macros guarded by NO_THE_INDEX_COMPATIBILITY_MACROS. This converts

Re: [PATCH 07/26] http-backend: avoid memory leaks

2017-05-01 Thread Johannes Schindelin
Hi Junio, On Sun, 30 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> Hmph. I find a "leak" of a resource acquired inside the main > >> function and not released when the main function leaves a lot less > >> interesting than the other ones this

Re: [RFC PATCH 4/5] submodule--helper: reattach-HEAD

2017-05-01 Thread Stefan Beller
On Mon, May 1, 2017 at 11:36 AM, Brandon Williams wrote: > if (flags & REATTACH_HEAD_DIE_ON_ERROR) > die(...); > > return -1; > > It just feels weird to me to have the inverted logic, that's my opinion > though. Yeah, me too. But my feelings were not as important as

Re: [RFC PATCH 4/5] submodule--helper: reattach-HEAD

2017-05-01 Thread Brandon Williams
On 05/01, Stefan Beller wrote: > Add a new command, that reattaches a detached HEAD to its configured > branch in a submodule. > > In a later patch we will teach git-submodule as well as other submodule > worktree manipulators (git reset/checkout --recurse-submodules) to not > end up in a

Re: [PATCH 0/5] Some submodule bugfixes and "reattaching detached HEADs"

2017-05-01 Thread Brandon Williams
On 05/01, Stefan Beller wrote: > The first three patches fix bugs in existing submodule code, > sort of independent from the last 2 patches, which are RFCs. > > > > In submodules as of today you always end up with a detached HEAD, > which may be scary to people used to working on branches. (I

Re: [PATCH 1/5] submodule_move_head: fix leak of struct child_process

2017-05-01 Thread Brandon Williams
On 05/01, Stefan Beller wrote: > While fixing the leak of `cp`, reuse it instead of having to declare > another struct child_process. > > Signed-off-by: Stefan Beller This shouldn't be needed as 'finish_command' does the cleanup for you by calling 'child_prcoess_clear()'.

[PATCH 2/5] submodule_move_head: prepare env for child correctly

2017-05-01 Thread Stefan Beller
We forgot to prepare the submodule env, which is only a problem for nested submodules. See 2e5d6503bd (ls-files: fix recurse-submodules with nested submodules, 2017-04-13) for further explanation. Signed-off-by: Stefan Beller --- submodule.c | 1 + 1 file changed, 1

[RFC PATCH 4/5] submodule--helper: reattach-HEAD

2017-05-01 Thread Stefan Beller
Add a new command, that reattaches a detached HEAD to its configured branch in a submodule. In a later patch we will teach git-submodule as well as other submodule worktree manipulators (git reset/checkout --recurse-submodules) to not end up in a detached HEAD state in the submodules.

[PATCH 1/5] submodule_move_head: fix leak of struct child_process

2017-05-01 Thread Stefan Beller
While fixing the leak of `cp`, reuse it instead of having to declare another struct child_process. Signed-off-by: Stefan Beller --- submodule.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/submodule.c b/submodule.c index

[RFC PATCH 5/5] submodule_move_head: reattach submodule HEAD to branch if possible.

2017-05-01 Thread Stefan Beller
Side note: We also want to call this from git submodule update Signed-off-by: Stefan Beller --- submodule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/submodule.c b/submodule.c index 4e74e38829..66651ffa34 100644 --- a/submodule.c +++ b/submodule.c @@ -1483,6

[PATCH 3/5] submodule: avoid auto-discovery in new working tree manipulator code

2017-05-01 Thread Stefan Beller
All commands that are run in a submodule, are run in a correct setup, there is no need to prepare the environment without setting the GIT_DIR variable. By setting the GIT_DIR variable we fix issues as discussed in 10f5c52656 (submodule: avoid auto-discovery in prepare_submodule_repo_env(),

[PATCH 0/5] Some submodule bugfixes and "reattaching detached HEADs"

2017-05-01 Thread Stefan Beller
The first three patches fix bugs in existing submodule code, sort of independent from the last 2 patches, which are RFCs. In submodules as of today you always end up with a detached HEAD, which may be scary to people used to working on branches. (I myself enjoy working with a detached HEAD).

Re: Terrible bad performance for it blame --date=iso -C -C master --

2017-05-01 Thread Samuel Lijin
On Fri, Mar 31, 2017 at 10:52 AM, Junio C Hamano wrote: > "Ulrich Windl" writes: > >> I was running "vc-annotate" in Emacs for a file from a large >> repository (>4 files, a big percentage being binary, about 10 >> commits). For the first

Re: What's cooking in git.git (May 2017, #01; Mon, 1)

2017-05-01 Thread Ævar Arnfjörð Bjarmason
On Mon, May 1, 2017 at 6:21 PM, Brandon Williams wrote: > On 05/01, Ęvar Arnfjörš Bjarmason wrote: >> On Mon, May 1, 2017 at 7:35 AM, Junio C Hamano wrote: >> > * ab/clone-no-tags (2017-05-01) 3 commits >> > (merged to 'next' on 2017-04-30 at 601649896a)

Re: Bug: Git rename does not work if folder naming was changed from lower to upper case on OSX

2017-05-01 Thread Kevin Daudt
On Sun, Apr 30, 2017 at 06:47:29PM -0700, Junio C Hamano wrote: > Kevin Daudt writes: > > > Note that git does not store that files are renamed. So a remove + add > > is the same as a rename in git. Only git status shows it when you for > > example use git mv directly, but this

Re: [PATCH 5/6] submodule: improve submodule_has_commits

2017-05-01 Thread Brandon Williams
On 05/01, Stefan Beller wrote: > On Sun, Apr 30, 2017 at 4:14 PM, Brandon Williams wrote: > > > This hunk of logic is essentially a copy and paste from elsewhere in the > > file. Essentially both code paths were essentially doing the same thing > > (checking if a submodule

Re: [PATCH 5/6] submodule: improve submodule_has_commits

2017-05-01 Thread Stefan Beller
On Sun, Apr 30, 2017 at 4:14 PM, Brandon Williams wrote: > This hunk of logic is essentially a copy and paste from elsewhere in the > file. Essentially both code paths were essentially doing the same thing > (checking if a submodule has a commit) but one of the code paths

Re: [PATCH 6/6] submodule: refactor logic to determine changed submodules

2017-05-01 Thread Brandon Williams
On 04/28, Stefan Beller wrote: > + Heiko, who touched the pushing code end of last year. > > On Fri, Apr 28, 2017 at 4:54 PM, Brandon Williams wrote: > > There are currently two instances (fetch and push) where we want to > > determine if submodules have changed given some

Re: [PATCH 5/6] submodule: improve submodule_has_commits

2017-05-01 Thread Brandon Williams
On 04/30, Junio C Hamano wrote: > Brandon Williams writes: > > > oid_array_for_each_unique(commits, check_has_commit, _commit); > > + > > + if (has_commit) { > > + /* > > +* Even if the submodule is checked out and the commit is > > +*

Re: [PATCH 4/6] submodule: change string_list changed_submodule_paths

2017-05-01 Thread Brandon Williams
On 04/30, Junio C Hamano wrote: > Brandon Williams writes: > > > Eliminate a call to 'xstrdup()' by changing the string_list > > 'changed_submodule_paths' to duplicated strings added to it. > > > > Signed-off-by: Brandon Williams > > --- > > submodule.c |

  1   2   >