Re: [PATCH v3 4/7] grep.c: display column number of first match

2018-04-23 Thread Eric Sunshine
On Tue, Apr 24, 2018 at 1:07 AM, Taylor Blau wrote: > To prepare for 'git grep' learning '--column-number', teach grep.c's > show_line() how to show the column of the first match on non-context > line. > > Signed-off-by: Taylor Blau > --- > diff --git

Re: [PATCH v3 7/7] contrib/git-jump/git-jump: jump to match column in addition to line

2018-04-23 Thread Eric Sunshine
On Tue, Apr 24, 2018 at 1:07 AM, Taylor Blau wrote: > Take advantage of 'git-grep(1)''s new option, '--column-number' in order > to teach Peff's 'git-jump' script how to jump to the correct column for > any given match. > > 'git-grep(1)''s output is in the correct format for

[PATCH 2/2] unpack_trees_options: free messages when done

2018-04-23 Thread Martin Ågren
The strings allocated in `setup_unpack_trees_porcelain()` are never freed. Provide a function `clear_unpack_trees_porcelain()` to do so and call it in the functions which use `setup_unpack_trees_porcelain()`. In all current callers, the pointers are about to go out of scope, so we do not need to

[PATCH 1/2] merge: setup `opts` later in `checkout_fast_forward()`

2018-04-23 Thread Martin Ågren
After we initialize the various fields in `opts` but before we actually use them, we might return early. Move the initialization further down, to immediately before we use `opts`. This limits the scope of `opts` and will help a subsequent commit fix a memory leak without having to worry about

Re: [PATCH v8 06/16] sequencer: introduce the `merge` command

2018-04-23 Thread Martin Ågren
Hi Phillip, On 23 April 2018 at 17:54, Phillip Wood wrote: > I'm fine with leaving it, I've might get round to doing a small series to > clean things up slightly in a few weeks. At the moment > setup_unpack_trees_porcelain() leaks memory as it is called for each merge

[PATCH v3 6/7] grep.c: add configuration variables to show matched option

2018-04-23 Thread Taylor Blau
To support git-grep(1)'s new option, '--column-number', document and teach grep.c how to interpret relevant configuration options, similar to those associated with '--line-number'. Signed-off-by: Taylor Blau --- Documentation/config.txt | 5 + Documentation/git-grep.txt

[PATCH v3 5/7] builtin/grep.c: add '--column-number' option to 'git-grep(1)'

2018-04-23 Thread Taylor Blau
Teach 'git-grep(1)' a new option, '--column-number', to show the column number of the first match on a non-context line. For example: $ ./git-grep -n --column-number foo | head -n3 .clang-format:51:14:# myFunction(foo, bar, baz); .clang-format:64:7:# int foo(); .clang-format:75:8:# void

[PATCH v3 7/7] contrib/git-jump/git-jump: jump to match column in addition to line

2018-04-23 Thread Taylor Blau
Take advantage of 'git-grep(1)''s new option, '--column-number' in order to teach Peff's 'git-jump' script how to jump to the correct column for any given match. 'git-grep(1)''s output is in the correct format for Vim's jump list, so no additional cleanup is necessary. Signed-off-by: Taylor Blau

[PATCH v3 4/7] grep.c: display column number of first match

2018-04-23 Thread Taylor Blau
To prepare for 'git grep' learning '--column-number', teach grep.c's show_line() how to show the column of the first match on non-context line. Signed-off-by: Taylor Blau --- grep.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git

[PATCH v3 3/7] grep.[ch]: extend grep_opt to allow showing matched column

2018-04-23 Thread Taylor Blau
To support showing the matched column when calling 'git-grep(1)', teach 'grep_opt' the normal set of options to configure the default behavior and colorization of this feature. Signed-off-by: Taylor Blau --- grep.c | 3 +++ grep.h | 2 ++ 2 files changed, 5 insertions(+)

[PATCH v3 2/7] grep.c: expose matched column in match_line()

2018-04-23 Thread Taylor Blau
When calling match_line(), callers presently cannot determine the relative offset of the match because match_line() discards the 'regmatch_t' that contains this information. Instead, teach match_line() to take in a 'regmatch_t *' so that callers can inspect the match's starting and ending offset

[PATCH v3 1/7] Documentation/config.txt: camel-case lineNumber for consistency

2018-04-23 Thread Taylor Blau
lineNumber has casing that is inconsistent with surrounding options, like color.grep.matchContext, and color.grep.matchSelected. Re-case this documentation in order to be consistent with the text around it, and to ensure that new entries are consistent, too. Signed-off-by: Taylor Blau

[PATCH v3 0/7] Teach '--column-number' to 'git-grep(1)'

2018-04-23 Thread Taylor Blau
Hi, Attached is v3 of my series to teach '--column-numbers' to 'git-grep(1)'. Since last time, I have: * Removed '-m' in a few places that I forgot to during v2 [1] [2]. * Expanded upon the definition of '--column-number' in 'git grep --help'. [3] * Initialized some new fields in

Re: [PATCH v8 09/16] rebase: introduce the --rebase-merges option

2018-04-23 Thread Junio C Hamano
"Philip Oakley" writes: >> +-r:: >> +--rebase-merges:: >> + By default, a rebase will simply drop merge commits and only rebase >> + the non-merge commits. With this option, it will try to preserve >> + the branching structure within the commits that are to be rebased, >> +

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Taylor Blau
On Mon, Apr 23, 2018 at 10:01:17AM +0200, Ævar Arnfjörð Bjarmason wrote: > > On Mon, Apr 23 2018, Taylor Blau wrote: > > > For your consideration: > > https://github.com/ttaylorr/git/compare/tb/grep-colno > > Looks good to me aside from two minor issues I noticed: > > * In "grep.c: display

Re: [PATCH v2 2/6] grep.c: take column number as argument to show_line()

2018-04-23 Thread Taylor Blau
On Mon, Apr 23, 2018 at 03:34:21AM -0400, Eric Sunshine wrote: > On Mon, Apr 23, 2018 at 3:27 AM, Ævar Arnfjörð Bjarmason > wrote: > > On Mon, Apr 23 2018, Eric Sunshine wrote: > >> One important issue I noticed is that patch 3/7 neglects to update > >>

Re: [PATCH v8 4/4] worktree: teach "add" to check out existing branches

2018-04-23 Thread Eric Sunshine
On Mon, Apr 23, 2018 at 3:38 PM, Thomas Gummerer wrote: > Currently 'git worktree add ' creates a new branch named after the > basename of the path by default. If a branch with that name already > exists, the command refuses to do anything, unless the '--force' option > is

Re: [PATCH v8 2/4] worktree: improve message when creating a new worktree

2018-04-23 Thread Eric Sunshine
On Mon, Apr 23, 2018 at 3:38 PM, Thomas Gummerer wrote: > Currently 'git worktree add' produces output like the following: > > Preparing ../foo (identifier foo) > HEAD is now at 26da330922 > > The '../foo' is the path where the worktree is created, which the user >

Re: [PATCH v8 1/4] worktree: remove extra members from struct add_opts

2018-04-23 Thread Eric Sunshine
On Mon, Apr 23, 2018 at 3:38 PM, Thomas Gummerer wrote: > There are two members of 'struct add_opts', which are only used inside > the 'add()' function, but being part of 'struct add_opts' they are > needlessly also passed to the 'add_worktree' function. > > Make them local

Re: [PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Junio C Hamano
Elijah Newren writes: > unpack-trees.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/unpack-trees.c b/unpack-trees.c > index e73745051e..08f6cab82e 100644 > --- a/unpack-trees.c > +++ b/unpack-trees.c > @@ -1284,9 +1284,20 @@ int

Re: [PATCH 2/2 v2] Makefile: quote $INSTLIBDIR when passing it to sed

2018-04-23 Thread Daniel Jacques
Good catch, thanks for doing this! -Dan On Mon, Apr 23, 2018 at 10:18 PM Jonathan Nieder wrote: > f6a0ad4b (Makefile: generate Perl header from template file, > 2018-04-10) moved some code for generating the 'use lib' lines at the > top of perl scripts from the

Re: [PATCH v2 0/3] Some add-on patches on top of dj/runtime-prefix

2018-04-23 Thread Junio C Hamano
Junio C Hamano writes: > Junio C Hamano writes: > >>> base-commit: b46fe60e1d7235603a29499822493bd3791195da >> >> Basing your work on the tip of 'next' is good for discussion, but >> not readily usable for final application. Let me see if I can >> untangle

Re: [PATCH v4 01/11] argv_array: offer to split a string by whitespace

2018-04-23 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> +void argv_array_split(struct argv_array *array, const char *to_split) >> +{ >> +while (isspace(*to_split)) >> +to_split++; >> +for (;;) { >> +const char *p =

[PATCH 2/2 v2] Makefile: quote $INSTLIBDIR when passing it to sed

2018-04-23 Thread Jonathan Nieder
f6a0ad4b (Makefile: generate Perl header from template file, 2018-04-10) moved some code for generating the 'use lib' lines at the top of perl scripts from the $(SCRIPT_PERL_GEN) rule to a separate GIT-PERL-HEADER rule. This rule first populates INSTLIBDIR and then substitutes it into the

Re: [PATCH 1/2] Makefile: remove unused @@PERLLIBDIR@@ substitution variable

2018-04-23 Thread Junio C Hamano
Jonathan Nieder writes: > Junio noticed that this variable is not quoted correctly when it is > passed to sed. As a shell-quoted string, it should be inside > single-quotes like $(perllibdir_relative_SQ), not outside them like > $INSTLIBDIR. Spreading credit is very much

Re: [PATCH 0/3] Colorful blame output

2018-04-23 Thread Junio C Hamano
Stefan Beller writes: > This is a revamp of > https://public-inbox.org/git/20180416220955.46163-1-sbel...@google.com/ > > Junio had some issue with that version, as it would collide config and command > line options. This is fixed now by introducing another option. Heh, that

Re: [PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Junio C Hamano
Elijah Newren writes: > Marked as PATCH v2, though I marked the previous one as "RFC PATCH v10 > 32.5/36" because I thought I was going to put it in my series. But it is > an independent fix that my series needs. Thanks. Let's take this before the remainder of the series ;-)

Re: [PATCH v2 0/3] Some add-on patches on top of dj/runtime-prefix

2018-04-23 Thread Junio C Hamano
Junio C Hamano writes: >> base-commit: b46fe60e1d7235603a29499822493bd3791195da > > Basing your work on the tip of 'next' is good for discussion, but > not readily usable for final application. Let me see if I can > untangle the dependents to come up with a reasonable base.

Re: [PATCH v2 0/3] Some add-on patches on top of dj/runtime-prefix

2018-04-23 Thread Junio C Hamano
Johannes Schindelin writes: > We carried a slightly different version of the git_setup_gettext() patch > (which took care of releasing the buffer allocated by system_path()), > and we carry two more patches that touch the same area, so now that > dj/runtime-prefix hit

Re: [PATCH v3 0/4] rebase -i: avoid stale "# This is a combination of" in commit messages

2018-04-23 Thread Junio C Hamano
Johannes Schindelin writes: > Eric Sunshine pointed out that I had such a commit message in > https://public-inbox.org/git/CAPig+cRrS0_nYJJY=o6cbov630snqhpv5qgrqdd8mw-syzn...@mail.gmail.com/ > and I went on a hunt to figure out how the heck this happened. > > Turns

Re: [PATCH v4 01/11] argv_array: offer to split a string by whitespace

2018-04-23 Thread Junio C Hamano
Johannes Schindelin writes: > +void argv_array_split(struct argv_array *array, const char *to_split) > +{ > + while (isspace(*to_split)) > + to_split++; > + for (;;) { > + const char *p = to_split; > + > + if (!*p) > +

Re: [PATCH 41/41] merge-one-file: compute empty blob object ID

2018-04-23 Thread brian m. carlson
On Tue, Apr 24, 2018 at 03:00:55AM +0200, SZEDER Gábor wrote: > > This script hard-codes the object ID of the empty tree. To avoid any > > s/tree/blob/ > > > problems when changing hashes, compute this value by calling git > > hash-object. > > Missing signoff. Thanks, will fix. -- brian m.

Re: [PATCH 41/41] merge-one-file: compute empty blob object ID

2018-04-23 Thread SZEDER Gábor
> This script hard-codes the object ID of the empty tree. To avoid any s/tree/blob/ > problems when changing hashes, compute this value by calling git > hash-object. Missing signoff. > --- > git-merge-one-file.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH 2/2] Makefile: quote $INSTLIBDIR when passing it to sed

2018-04-23 Thread Junio C Hamano
Jonathan Nieder writes: > diff --git a/Makefile b/Makefile > index 8f4cb506ff..727eca5d0a 100644 > --- a/Makefile > +++ b/Makefile > @@ -2108,7 +2108,7 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) > GIT-PERL-DEFINES Makefile > INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \

Re: [PATCH 9/9] cache.h: allow sha1_object_info to handle arbitrary repositories

2018-04-23 Thread Stefan Beller
On Mon, Apr 23, 2018 at 5:34 PM, brian m. carlson wrote: > On Mon, Apr 23, 2018 at 04:43:27PM -0700, Stefan Beller wrote: >> This involves also adapting sha1_object_info_extended and a some >> internal functions that are used to implement these. It all has to >>

Re: [PATCH 9/9] cache.h: allow sha1_object_info to handle arbitrary repositories

2018-04-23 Thread brian m. carlson
On Mon, Apr 23, 2018 at 04:43:27PM -0700, Stefan Beller wrote: > This involves also adapting sha1_object_info_extended and a some > internal functions that are used to implement these. It all has to > happen in one patch, because of a single recursive chain of calls visits > all these functions.

Re: [PATCH 2/9] cache.h: add repository argument to oid_object_info

2018-04-23 Thread brian m. carlson
On Mon, Apr 23, 2018 at 04:43:20PM -0700, Stefan Beller wrote: > Add a repository argument to allow the callers of oid_object_info > to be more specific about which repository to handle. This is a small > mechanical change; it doesn't change the implementation to handle > repositories other than

[PATCH v2] unpack_trees: fix breakage when o->src_index != o->dst_index

2018-04-23 Thread Elijah Newren
Currently, all callers of unpack_trees() set o->src_index == o->dst_index. The code in unpack_trees() does not correctly handle them being different. There are two separate issues: First, there is the possibility of memory corruption. Since unpack_trees() creates a temporary index in o->result

Re: [PATCH v10 00/36] Add directory rename detection to git

2018-04-23 Thread Elijah Newren
On Mon, Apr 23, 2018 at 4:46 PM, Junio C Hamano wrote: > Elijah Newren writes: > >> Out of 53288 merge commits with exactly two parents in linux.git: >> - 48491 merged identically >> - 4737 merged the same other than a few different "Auto-merging >> "

[PATCH 0/3] Colorful blame output

2018-04-23 Thread Stefan Beller
This is a revamp of https://public-inbox.org/git/20180416220955.46163-1-sbel...@google.com/ Junio had some issue with that version, as it would collide config and command line options. This is fixed now by introducing another option. Thanks, Stefan Stefan Beller (3): builtin/blame: dim

[PATCH 2/3] builtin/blame: highlight recently changed lines

2018-04-23 Thread Stefan Beller
Choose a different color for dates and imitate a 'temperature cool down' depending upon age. Originally I had planned to have the temperature cool down dependent on the age of the project or file for example, as that might scale better, but that can be added on top of this commit, e.g. instead of

[PATCH 3/3] builtin/blame: add new coloring scheme config

2018-04-23 Thread Stefan Beller
Add a config option that allows selecting the default color scheme for blame. The command line still takes precedence over the configuration. It is to be seen, how color.ui will integrate with blame coloring. Signed-off-by: Stefan Beller --- Documentation/config.txt | 5

[PATCH 1/3] builtin/blame: dim uninteresting metadata lines

2018-04-23 Thread Stefan Beller
When using git-blame lots of lines contain redundant information, for example in hunks that consist of multiple lines, the metadata (commit name, author, date) are repeated. A reader may not be interested in those, so offer an option to color the information that is repeated from the previous line

Re: [PATCH v10 00/36] Add directory rename detection to git

2018-04-23 Thread Junio C Hamano
Elijah Newren writes: > Out of 53288 merge commits with exactly two parents in linux.git: > - 48491 merged identically > - 4737 merged the same other than a few different "Auto-merging > " output lines (as expected due to patch 35/36) > - 53 merged the same other than

[PATCH 7/9] packfile: add repository argument to unpack_entry

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of unpack_entry to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch

[PATCH 4/9] packfile: add repository argument to packed_to_object_type

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of packed_to_object_type to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to

[PATCH 9/9] cache.h: allow sha1_object_info to handle arbitrary repositories

2018-04-23 Thread Stefan Beller
This involves also adapting sha1_object_info_extended and a some internal functions that are used to implement these. It all has to happen in one patch, because of a single recursive chain of calls visits all these functions. Signed-off-by: Jonathan Nieder Signed-off-by:

[PATCH 8/9] packfile: add repository argument to cache_or_unpack_entry

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of cache_or_unpack_entry to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to

[PATCH 5/9] packfile: add repository argument to packed_object_info

2018-04-23 Thread Stefan Beller
From: Jonathan Nieder Add a repository argument to allow callers of packed_object_info to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with

[PATCH 0/9] object store: oid_object_info is the next contender

2018-04-23 Thread Stefan Beller
This applies on top of origin/sb/object-store-replace and is available as https://github.com/stefanbeller/git/tree/oid_object_info This continues the work of sb/packfiles-in-repository, extending the layer at which we have to pass in an explicit repository object to oid_object_info. A test merge

[PATCH 1/9] cache.h: add repository argument to oid_object_info_extended

2018-04-23 Thread Stefan Beller
Add a repository argument to allow oid_object_info_extended callers to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. Signed-off-by: Stefan Beller

[PATCH 2/9] cache.h: add repository argument to oid_object_info

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of oid_object_info to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. In the expanded macro the identifier

[PATCH 3/9] packfile: add repository argument to retry_bad_packed_offset

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of retry_bad_packed_offset to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro

[PATCH 6/9] packfile: add repository argument to read_object

2018-04-23 Thread Stefan Beller
Add a repository argument to allow the callers of read_object to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch

[PATCH 08/41] packfile: abstract away hash constant values

2018-04-23 Thread brian m. carlson
There are several instances of the constant 20 and 20-based values in the packfile code. Abstract away dependence on SHA-1 by using the values from the_hash_algo instead. Use unsigned values for temporary constants to provide the compiler with more information about what kinds of values it

[PATCH 11/41] tree-walk: avoid hard-coded 20 constant

2018-04-23 Thread brian m. carlson
Use the_hash_algo to look up the length of our current hash instead of hard-coding the value 20. Signed-off-by: brian m. carlson --- tree-walk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-walk.c b/tree-walk.c index

[PATCH 12/41] tree-walk: convert get_tree_entry_follow_symlinks to object_id

2018-04-23 Thread brian m. carlson
Since the only caller of this function already uses struct object_id, update get_tree_entry_follow_symlinks to use it in parameters and internally. Signed-off-by: brian m. carlson --- sha1_name.c | 4 ++-- tree-walk.c | 16 tree-walk.h | 2 +- 3

[PATCH 10/41] pack-redundant: abstract away hash algorithm

2018-04-23 Thread brian m. carlson
Instead of using hard-coded instances of the constant 20, use the_hash_algo to look up the correct constant. Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

[PATCH 15/41] split-index: convert struct split_index to object_id

2018-04-23 Thread brian m. carlson
Convert the base_sha1 member of struct split_index to use struct object_id and rename it base_oid. Include cache.h to make the structure visible. Signed-off-by: brian m. carlson --- builtin/rev-parse.c | 4 ++-- read-cache.c | 22

[PATCH 18/41] index-pack: abstract away hash function constant

2018-04-23 Thread brian m. carlson
The code for reading certain pack v2 offsets had a hard-coded 5 representing the number of uint32_t words that we needed to skip over. Specify this value in terms of a value from the_hash_algo. Signed-off-by: brian m. carlson --- builtin/index-pack.c | 3 ++- 1

[PATCH 14/41] submodule-config: convert structures to object_id

2018-04-23 Thread brian m. carlson
Convert struct submodule and struct parse_config_parameter to use struct object_id. Adjust the functions which take members of these structures as arguments to also use struct object_id. Include cache.h into submodule-config.h to make struct object_id visible. Signed-off-by: brian m. carlson

[PATCH 19/41] commit: convert uses of get_sha1_hex to get_oid_hex

2018-04-23 Thread brian m. carlson
Signed-off-by: brian m. carlson --- commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index ca474a7c11..9617f85caa 100644 --- a/commit.c +++ b/commit.c @@ -331,7 +331,7 @@ int parse_commit_buffer(struct commit

[PATCH 05/41] packfile: convert has_sha1_pack to object_id

2018-04-23 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it has_object_pack for consistency with has_object_file. Signed-off-by: brian m. carlson --- builtin/count-objects.c | 2 +- builtin/fsck.c | 2 +- builtin/prune-packed.c | 2 +-

[PATCH 26/41] builtin/am: convert uses of EMPTY_TREE_SHA1_BIN to the_hash_algo

2018-04-23 Thread brian m. carlson
Convert several uses of EMPTY_TREE_SHA1_BIN to use the_hash_algo and struct object_id instead. Signed-off-by: brian m. carlson --- builtin/am.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index

[PATCH 24/41] diff: specify abbreviation size in terms of the_hash_algo

2018-04-23 Thread brian m. carlson
Instead of using hard-coded 40 constants, refer to the_hash_algo for the current hash size. Signed-off-by: brian m. carlson --- diff.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index

[PATCH 13/41] fsck: convert static functions to struct object_id

2018-04-23 Thread brian m. carlson
Convert two static functions to use struct object_id and parse_oid_hex, instead of relying on harcoded 20 and 40-based constants. Signed-off-by: brian m. carlson --- fsck.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git

Re: [RFC PATCH] checkout: Force matching mtime between files

2018-04-23 Thread Junio C Hamano
"Robin H. Johnson" writes: > On Fri, Apr 13, 2018 at 07:01:29PM +0200, Michał Górny wrote: >> Currently git does not control mtimes of files being checked out. This >> means that the only assumption you could make is that all files created >> or modified within a single

[PATCH 32/41] builtin/receive-pack: convert one use of EMPTY_TREE_SHA1_HEX

2018-04-23 Thread brian m. carlson
Convert one use of EMPTY_TREE_SHA1_HEX to use oid_to_hex and the_hash_algo to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 31/41] wt-status: convert two uses of EMPTY_TREE_SHA1_HEX

2018-04-23 Thread brian m. carlson
Convert two uses of EMPTY_TREE_SHA1_HEX to use oid_to_hex_r and the_hash_algo to avoid a dependency on a given hash algorithm. Use oid_to_hex_r in preference to oid_to_hex because the buffer needs to last through several function calls which might exhaust the limit of four static buffers.

[PATCH 41/41] merge-one-file: compute empty blob object ID

2018-04-23 Thread brian m. carlson
This script hard-codes the object ID of the empty tree. To avoid any problems when changing hashes, compute this value by calling git hash-object. --- git-merge-one-file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index

[PATCH 37/41] dir: use the_hash_algo for empty blob object ID

2018-04-23 Thread brian m. carlson
To ensure that we are hash algorithm agnostic, use the_hash_algo to look up the object ID for the empty blob instead of using the empty_tree_oid variable. Signed-off-by: brian m. carlson --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 27/41] builtin/merge: switch tree functions to use object_id

2018-04-23 Thread brian m. carlson
The read_empty and reset_hard functions are static and their callers have already changed to use struct object_id, so convert them as well. To avoid dependency on the hash algorithm in use, switch from using EMPTY_TREE_SHA1_HEX to using oid_to_hex with the_hash_algo. Signed-off-by: brian m.

[PATCH 33/41] builtin/reset: convert use of EMPTY_TREE_SHA1_BIN

2018-04-23 Thread brian m. carlson
Convert the last use of EMPTY_TREE_SHA1_BIN to use a direct copy from the_hash_algo->empty_tree to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- builtin/reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 35/41] cache-tree: use is_empty_tree_oid

2018-04-23 Thread brian m. carlson
When comparing an object ID against that of the empty tree, use the is_empty_tree_oid function to ensure that we abstract over the hash algorithm properly. In addition, this is more readable than a plain oidcmp. Signed-off-by: brian m. carlson --- cache-tree.c | 2

[PATCH 29/41] sequencer: convert one use of EMPTY_TREE_SHA1_HEX

2018-04-23 Thread brian m. carlson
Convert one use of EMPTY_TREE_SHA1_HEX to use oid_to_hex and the_hash_algo to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- sequencer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sequencer.c

[PATCH 23/41] upload-pack: replace use of several hard-coded constants

2018-04-23 Thread brian m. carlson
Update several uses of hard-coded 40-based constants to use either the_hash_algo or GIT_MAX_HEXSZ, as appropriate. Replace a combined use of oid_to_hex and memcpy with oid_to_hex_r, which not only avoids the need for a constant, but is more efficient. Make use of parse_oid_hex to eliminate the

[PATCH 17/41] pack-redundant: convert linked lists to use struct object_id

2018-04-23 Thread brian m. carlson
Convert struct llist_item and the rest of the linked list code to use struct object_id. Add a use of GIT_MAX_HEXSZ to avoid a dependency on a hard-coded constant. Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 50

[PATCH 36/41] sequencer: use the_hash_algo for empty tree object ID

2018-04-23 Thread brian m. carlson
To ensure that we are hash algorithm agnostic, use the_hash_algo to look up the object ID for the empty tree instead of using the empty_tree_oid variable. Signed-off-by: brian m. carlson --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 21/41] http: eliminate hard-coded constants

2018-04-23 Thread brian m. carlson
Use the_hash_algo to find the right size for parsing pack names. Signed-off-by: brian m. carlson --- http.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/http.c b/http.c index 3034d10b68..ec70676748 100644 --- a/http.c +++ b/http.c

[PATCH 39/41] Update shell scripts to compute empty tree object ID

2018-04-23 Thread brian m. carlson
Several of our shell scripts hard-code the object ID of the empty tree. To avoid any problems when changing hashes, compute this value on startup of the script. For performance, store the value in a variable and reuse it throughout the life of the script. Signed-off-by: brian m. carlson

[PATCH 04/41] packfile: remove unused member from struct pack_entry

2018-04-23 Thread brian m. carlson
The sha1 member in struct pack_entry is unused except for one instance in which we store a value in it. Since nobody ever reads this value, don't bother to compute it and remove the member from struct pack_entry. Signed-off-by: brian m. carlson --- cache.h| 1

[PATCH 07/41] packfile: convert find_pack_entry to object_id

2018-04-23 Thread brian m. carlson
Convert find_pack_entry and the static function fill_pack_entry to take pointers to struct object_id. Signed-off-by: brian m. carlson --- packfile.c | 12 ++-- packfile.h | 2 +- sha1_file.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-)

[PATCH 22/41] revision: replace use of hard-coded constants

2018-04-23 Thread brian m. carlson
Replace two uses of the hard-coded constant 40 with references to the_hash_algo. Signed-off-by: brian m. carlson --- revision.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/revision.c b/revision.c index ce0e7b71f2..daf7fe6ff4 100644 ---

[PATCH 28/41] merge: convert empty tree constant to the_hash_algo

2018-04-23 Thread brian m. carlson
To avoid dependency on a particular hash algorithm, convert a use of EMPTY_TREE_SHA1_HEX to use the_hash_algo->empty_tree instead. Since both branches now use oid_to_hex, condense the if statement into a ternary. Signed-off-by: brian m. carlson --- merge.c | 5

[PATCH 09/41] pack-objects: abstract away hash algorithm

2018-04-23 Thread brian m. carlson
Instead of using hard-coded instances of the constant 20, use the_hash_algo to look up the correct constant. Signed-off-by: brian m. carlson --- builtin/pack-objects.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff

[PATCH 20/41] dir: convert struct untracked_cache_dir to object_id

2018-04-23 Thread brian m. carlson
Convert the exclude_sha1 member of struct untracked_cache_dir and rename it to exclude_oid. Eliminate several hard-coded integral constants, and update a function name that referred to SHA-1. Signed-off-by: brian m. carlson --- dir.c

[PATCH 02/41] server-info: remove unused members from struct pack_info

2018-04-23 Thread brian m. carlson
The head member of struct pack_info is completely unused and the nr_heads member is used only in one place, which is an assignment. Since these structure members are not useful, remove them. Signed-off-by: brian m. carlson --- server-info.c | 3 --- 1 file changed,

[PATCH 03/41] Remove unused member in struct object_context

2018-04-23 Thread brian m. carlson
The tree member of struct object_context is unused except in one place where we write to it. Since there are no users of this member, remove it. Signed-off-by: brian m. carlson --- cache.h | 1 - sha1_name.c | 1 - 2 files changed, 2 deletions(-) diff --git

[PATCH 38/41] sha1_file: only expose empty object constants through git_hash_algo

2018-04-23 Thread brian m. carlson
There really isn't any case in which we want to expose the constants for empty trees and blobs outside of using the hash algorithm abstraction. Make these constants static and stop exposing the defines in cache.h. Remove the constants which are no longer in use. Signed-off-by: brian m. carlson

[PATCH 30/41] submodule: convert several uses of EMPTY_TREE_SHA1_HEX

2018-04-23 Thread brian m. carlson
Convert several uses of EMPTY_TREE_SHA1_HEX to use oid_to_hex and the_hash_algo to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- submodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submodule.c

[PATCH 25/41] builtin/receive-pack: avoid hard-coded constants for push certs

2018-04-23 Thread brian m. carlson
Use the GIT_SHA1_RAWSZ and GIT_SHA1_HEXSZ macros instead of hard-coding the constants 20 and 40. Switch one use of 20 with a format specifier for a hex value to use the hex constant instead, as the original appears to have been a typo. At this point, avoid converting the hard-coded use of SHA-1

[PATCH 16/41] Update struct index_state to use struct object_id

2018-04-23 Thread brian m. carlson
Adjust struct index_state to use struct object_id instead of unsigned char [20]. Signed-off-by: brian m. carlson --- cache.h | 2 +- read-cache.c | 16 t/helper/test-dump-split-index.c | 2 +-

[PATCH 34/41] sha1_file: convert cached object code to struct object_id

2018-04-23 Thread brian m. carlson
Convert the code that looks up cached objects to use struct object_id. Adjust the lookup for empty trees to use the_hash_algo. Note that we don't need to be concerned about the hard-coded object ID in the empty_tree object since we never use it. Signed-off-by: brian m. carlson

[PATCH 06/41] sha1_file: convert freshen functions to object_id

2018-04-23 Thread brian m. carlson
Convert the various functions for freshening objects and has_loose_object_nonlocal to use struct object_id. Signed-off-by: brian m. carlson --- builtin/pack-objects.c | 2 +- cache.h| 2 +- sha1_file.c| 36

[PATCH 40/41] add--interactive: compute the empty tree value

2018-04-23 Thread brian m. carlson
The interactive add script hard-codes the object ID of the empty tree. To avoid any problems when changing hashes, compute this value when used and cache it for any future uses. Signed-off-by: brian m. carlson --- git-add--interactive.perl | 11 +-- 1 file

[PATCH 00/41] object_id part 13

2018-04-23 Thread brian m. carlson
This is the thirteenth series of patches to convert to struct object_id and the_hash_algo. The series adds an oidread function to read object IDs from a buffer, removes unused structure members (which therefore don't require conversion), converts various functions to struct object_id, and

[PATCH 01/41] cache: add a function to read an object ID from a buffer

2018-04-23 Thread brian m. carlson
In various places throughout the codebase, we need to read data into a struct object_id from a pack or other unsigned char buffer. Add an inline function that does this based on the current hash algorithm in use, and use it in several places. Signed-off-by: brian m. carlson

Re: Is support for 10.8 dropped?

2018-04-23 Thread Perry Hutchison
Igor Korot wrote: > This laptop is old and doesn't have too big of a hard drive. > And I'm trying to create a big program Building OpenSSL via homebrew or MacPorts would likely take less space than building all of git that way, but if even that is too much perhaps it is time

[PATCH 2/2] Makefile: quote $INSTLIBDIR when passing it to sed

2018-04-23 Thread Jonathan Nieder
f6a0ad4b (Makefile: generate Perl header from template file, 2018-04-10) moved code for generating the 'use lib' lines at the top of perl scripts from the $(SCRIPT_PERL_GEN) rule to a separate GIT-PERL-HEADER rule. This rule first populates INSTLIBDIR and then substitutes it into the

[PATCH 1/2] Makefile: remove unused @@PERLLIBDIR@@ substitution variable

2018-04-23 Thread Jonathan Nieder
Junio noticed that this variable is not quoted correctly when it is passed to sed. As a shell-quoted string, it should be inside single-quotes like $(perllibdir_relative_SQ), not outside them like $INSTLIBDIR. In fact, this substitution variable is not used. Simplify by removing it.

  1   2   >