Re: [PATCH] strbuf_read_file(): preserve errno across close() call

2018-02-23 Thread René Scharfe
Am 23.02.2018 um 23:17 schrieb Junio C Hamano: > René Scharfe writes: > >> +#define IGNORE_ERROR(expr) do { int e_ = errno; expr; errno = e_; } while >> (0) > > The macro certainly is a cute idea, but ... > >> @@ -391,7 +393,7 @@ ssize_t strbuf_read(struct strbuf *sb, int fd,

Re: [PATCH v3 12/35] serve: introduce git-serve

2018-02-23 Thread Brandon Williams
On 02/22, Jeff King wrote: > On Tue, Feb 06, 2018 at 05:12:49PM -0800, Brandon Williams wrote: > > > +In protocol v2 communication is command oriented. When first contacting a > > +server a list of capabilities will advertised. Some of these capabilities > > +will be commands which a client can

Re: [PATCH 13/27] sha1_file: add repository argument to prepare_alt_odb

2018-02-23 Thread Stefan Beller
>> --- a/sha1_file.c >> +++ b/sha1_file.c >> @@ -23,6 +23,7 @@ >> #include "sha1-lookup.h" >> #include "bulk-checkin.h" >> #include "repository.h" >> +#include "object-store.h" > > Should this #include have been added in an earlier patch, since the > file both uses and defines prepare_alt_odb,

Re: [PATCH 16/27] sha1_file: add repository argument to sha1_file_name

2018-02-23 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Wed, Feb 21, 2018 at 4:51 PM, Brandon Williams wrote: > > On 02/20, Stefan Beller wrote: > >> Add a repository argument to allow sha1_file_name callers to be more > >> specific about which repository to handle. This is a small mechanical > >>

Re: [GSoC][PATCH v2] ref-filter: Make "--contains " less chatty if is invalid

2018-02-23 Thread Junio C Hamano
Junio C Hamano writes: > Paul-Sebastian Ungureanu writes: > >> Basically, the option parser only parses strings that represent >> commits and the ref-filter performs the commit look-up. If an >> error occurs during the option parsing, then it

Re: [PATCH v3 13/35] ls-refs: introduce ls-refs server command

2018-02-23 Thread Brandon Williams
On 02/22, Brandon Williams wrote: > On 02/22, Jeff King wrote: > > On Tue, Feb 06, 2018 at 05:12:50PM -0800, Brandon Williams wrote: > > > > > +ls-refs takes in the following parameters wrapped in packet-lines: > > > + > > > +symrefs > > > + In addition to the object pointed by it, show the

Re: Issue in switching branches with different submodules

2018-02-23 Thread Stefan Beller
On Thu, Feb 22, 2018 at 4:10 AM, wrote: > Hello, > I've found an issue in git when working with submodules. > My Project is set up using hundreds of components by submodules (and > nested submodules), that are independent created in central

Re: [PATCH] Call timegm and timelocal with 4-digit year

2018-02-23 Thread Junio C Hamano
"Bernhard M. Wiedemann" writes: > amazingly timegm(gmtime(0)) is only 0 before 2020 > because perl's timegm deviates from GNU timegm(3) in how it handles years. > > man Time::Local says > > Whenever possible, use an absolute four digit year instead. > > with a detailed

Re: [PATCH 0/2] Fix initializing the_hash_algo

2018-02-23 Thread brian m. carlson
On Fri, Feb 23, 2018 at 04:56:38PM +0700, Nguyễn Thái Ngọc Duy wrote: > I can certainly try! I start to remember all the hairy details in that > setup code. > > The first step may be something like this, which identifies all the > "repo init" entry points. This is basically a revert of e26f7f19b6

Re: [PATCH 2/3] t: teach 'test_must_fail' to save the command's stderr to a file

2018-02-23 Thread SZEDER Gábor
On Fri, Feb 9, 2018 at 3:21 PM, Jeff King wrote: > On Fri, Feb 09, 2018 at 03:42:34AM +0100, SZEDER Gábor wrote: > >> To check that a git command fails and to inspect its error message we >> usually execute a command like this throughout our test suite: >> >> test_must_fail git

Re: Git "branch properties"-- thoughts?

2018-02-23 Thread Junio C Hamano
Phillip Wood writes: > It would certainly be nice to be able to share branch descriptions so > that if I clone a repository I can get a bit more detail about the ideas > behind each branch. Shared descriptions could be displayed in web uis. I One thing to note is that

Re: [PATCH v3 12/35] serve: introduce git-serve

2018-02-23 Thread Brandon Williams
On 02/21, Jonathan Tan wrote: > On Tue, 6 Feb 2018 17:12:49 -0800 > Brandon Williams wrote: > > > .gitignore | 1 + > > Documentation/technical/protocol-v2.txt | 114 +++ > > Makefile| 2 + > >

Re: [PATCH 05/27] object-store: move packed_git and packed_git_mru to object store

2018-02-23 Thread Stefan Beller
>> 2. Applying the semantic patch >> contrib/coccinelle/refactoring/packed_git.cocci to adjust callers. >> This semantic patch is placed in a sub directory of the coccinelle >> contrib dir, as this semantic patch is not expected to be of general >> usefulness; it is only useful

Re: [PATCH 1/2] setup.c: initialize the_repository correctly in all cases

2018-02-23 Thread brian m. carlson
On Fri, Feb 23, 2018 at 04:56:39PM +0700, Nguyễn Thái Ngọc Duy wrote: > [3] the reason server side is still running ok with no hash algo > before [2] is because the programs that use enter_repo() do very > little then spawn a new program (like pack-objects or > upload-archive) to do

Re: [PATCH] strbuf_read_file(): preserve errno across close() call

2018-02-23 Thread Junio C Hamano
René Scharfe writes: > +#define IGNORE_ERROR(expr) do { int e_ = errno; expr; errno = e_; } while (0) The macro certainly is a cute idea, but ... > @@ -391,7 +393,7 @@ ssize_t strbuf_read(struct strbuf *sb, int fd, size_t > hint) > > if (got < 0) { >

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread brian m. carlson
On Fri, Feb 23, 2018 at 04:56:40PM +0700, Nguyễn Thái Ngọc Duy wrote: > diff --git a/builtin/index-pack.c b/builtin/index-pack.c > index 7e3e1a461c..8ee935504e 100644 > --- a/builtin/index-pack.c > +++ b/builtin/index-pack.c > @@ -1673,6 +1673,11 @@ int cmd_index_pack(int argc, const char **argv,

Re: [PATCH v3 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-02-23 Thread Brandon Williams
On 02/23, Stefan Beller wrote: > On Fri, Feb 23, 2018 at 1:30 PM, Brandon Williams wrote: > > On 02/22, Stefan Beller wrote: > >> > +static enum protocol_version discover_version(struct packet_reader > >> > *reader) > >> > +{ > >> ... > >> > + > >> > + /* Maybe process

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread Brandon Williams
On 02/23, brian m. carlson wrote: > On Fri, Feb 23, 2018 at 04:56:40PM +0700, Nguyễn Thái Ngọc Duy wrote: > > diff --git a/builtin/index-pack.c b/builtin/index-pack.c > > index 7e3e1a461c..8ee935504e 100644 > > --- a/builtin/index-pack.c > > +++ b/builtin/index-pack.c > > @@ -1673,6 +1673,11 @@

Re: What's cooking in git.git (Feb 2018, #03; Wed, 21)

2018-02-23 Thread Elijah Newren
On Wed, Feb 21, 2018 at 4:31 PM, Junio C Hamano wrote: > * en/rename-directory-detection (2018-02-14) 29 commits > - merge-recursive: ensure we write updates for directory-renamed file > - merge-recursive: avoid spurious rename/rename conflict from dir renames > - directory

Re: [PATCH v3 04/35] upload-pack: convert to a builtin

2018-02-23 Thread Brandon Williams
On 02/22, Jeff King wrote: > On Thu, Feb 22, 2018 at 03:19:40PM -0500, Jeff King wrote: > > > > To be clear, which of the following are you (most) worried about? > > > > > > 1. being invoked with --help and spawning a pager > > > 2. receiving and acting on options between 'git' and

Re: [PATCH v3 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-02-23 Thread Brandon Williams
On 02/22, Stefan Beller wrote: > > +static enum protocol_version discover_version(struct packet_reader *reader) > > +{ > ... > > + > > + /* Maybe process capabilities here, at least for v2 */ > > + switch (version) { > > + case protocol_v1: > > + /* Read the peeked

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Feb 23, 2018 at 11:50 AM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> I wonder if there is yet another missing case in the enumeration of >>> the previous patch: >>> Some commands are able to

Re: [PATCH 16/27] sha1_file: add repository argument to sha1_file_name

2018-02-23 Thread Stefan Beller
On Wed, Feb 21, 2018 at 4:51 PM, Brandon Williams wrote: > On 02/20, Stefan Beller wrote: >> Add a repository argument to allow sha1_file_name callers to be more >> specific about which repository to handle. This is a small mechanical >> change; it doesn't change the

Re: [PATCH v3 11/35] test-pkt-line: introduce a packet-line test helper

2018-02-23 Thread Brandon Williams
On 02/22, Stefan Beller wrote: > On Tue, Feb 6, 2018 at 5:12 PM, Brandon Williams wrote: > > > +static void pack_line(const char *line) > > +{ > > + if (!strcmp(line, "") || !strcmp(line, "\n")) > > From our in-office discussion: > v1/v0 packs pktlines twice in

Re: [PATCH v3 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-02-23 Thread Stefan Beller
On Fri, Feb 23, 2018 at 1:30 PM, Brandon Williams wrote: > On 02/22, Stefan Beller wrote: >> > +static enum protocol_version discover_version(struct packet_reader >> > *reader) >> > +{ >> ... >> > + >> > + /* Maybe process capabilities here, at least for v2 */ >> > +

Re: [PATCH 22/27] sha1_file: allow sha1_file_name to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
On Wed, Feb 21, 2018 at 4:44 PM, Jonathan Tan wrote: > On Tue, 20 Feb 2018 17:54:25 -0800 > Stefan Beller wrote: > >> Signed-off-by: Stefan Beller >> Signed-off-by: Jonathan Nieder > > Reviewed-by: Jonathan

Re: [PATCH 15/27] sha1_file: allow prepare_alt_odb to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
On Wed, Feb 21, 2018 at 4:35 PM, Jonathan Tan wrote: > On Tue, 20 Feb 2018 17:54:18 -0800 > Stefan Beller wrote: > >> -void prepare_alt_odb_the_repository(void) >> +void prepare_alt_odb(struct repository *r) >> { >> - const char *alt; >> - >> -

Re: [PATCH v5 00/17] document & test fetch pruning & add fetch.pruneTags

2018-02-23 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> Let's see how others find it useful and/or if the changed code gets >> in the way of others (I am not absolutely sure if the changes are >> free of regression to existing users who do not use the new >> feature). > > I think if you're on the

Re: [PATCH 08/27] pack: move approximate object count to object store

2018-02-23 Thread Stefan Beller
On Wed, Feb 21, 2018 at 4:47 PM, Brandon Williams wrote: > On 02/20, Stefan Beller wrote: >> The approximate_object_count() function maintains a rough count of >> objects in a repository to estimate how long object name abbreviates >> should be. Object names are scoped to a

Re: [PATCH v2] subtree: fix add and pull for GPG-signed commits

2018-02-23 Thread Junio C Hamano
Stephen R Guglielmo writes: > If log.showsignature is true (or --show-signature is passed) while > performing a `subtree add` or `subtree pull`, the command fails. > > toptree_for_commit() calls `log` and passes the output to `commit-tree`. > If this output shows the GPG

[PATCH 01/11] t: prevent '-x' tracing from interfering with test helpers' stderr

2018-02-23 Thread SZEDER Gábor
Running a test script with '-x' turns on 'set -x' tracing, the output of which is normally sent to stderr. This causes a lot of test failures, because many tests redirect and verify the stderr of shell functions, most frequently that of 'test_must_fail'. These issues were worked around somewhat

[PATCH 02/11] t: add means to disable '-x' tracing for individual test scripts

2018-02-23 Thread SZEDER Gábor
The previous patch resolved most of the test failures caused by running our test suite with '-x' tracing and /bin/sh, and the following patches in this series will resolve almost all of the remaining failures. Unfortunately, not yet all. Add means to disable '-x' tracing for individual test

[PATCH 00/11] Make the test suite pass with '-x' and /bin/sh

2018-02-23 Thread SZEDER Gábor
This patch series makes '-x' tracing of tests work reliably even when running them with /bin/sh, and setting TEST_SHELL_PATH=bash will be unnecessary. make GIT_TEST_OPTS='-x --verbose-log' test passes on my setup and on all Travis CI build jobs (though neither me nor Travis CI run all tests,

[PATCH 05/11] t5500-fetch-pack: don't check the stderr of a subshell

2018-02-23 Thread SZEDER Gábor
Three "missing reference" tests in 't5500-fetch-pack.sh' fail when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason for those failures is that the tests check a subshell's stderr, which includes the trace of executing

[PATCH 07/11] t5570-git-daemon: don't check the stderr of a subshell

2018-02-23 Thread SZEDER Gábor
The test 'no-op fetch without "-v" is quiet' in 't5570-git-daemon.sh' fails when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason for the failure is that the test checks the emptiness of a subshell's stderr, which includes

[PATCH 06/11] t5526: use $TRASH_DIRECTORY to specify the path of GIT_TRACE log file

2018-02-23 Thread SZEDER Gábor
The test 'fetch --recurse-submodules -j2 has the same output behaviour' in 't5526-fetch-submodules.sh' fails when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason of that failure is the following command:

[PATCH 10/11] t/README: add a note about don't saving stderr of compound commands

2018-02-23 Thread SZEDER Gábor
Explain in 't/README' why it is a bad idea to redirect and verify the stderr of compound commands, in the hope that future contributions will follow this advice and the test suite will keep working with '-x' tracing and /bin/sh. While at it, since we can now run the test suite with '-x' without

[PATCH 03/11] t1507-rev-parse-upstream: don't check the stderr of a shell function

2018-02-23 Thread SZEDER Gábor
Three tests in 't1507-rev-parse-upstream.sh' fail when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason for those failures is that the tests check the stderr of the function 'error_message', which includes the trace of

[PATCH 11/11] travis-ci: run tests with '-x' tracing

2018-02-23 Thread SZEDER Gábor
Now that the test suite runs successfully with '-x' tracing even with /bin/sh, enable it on Travis CI in order to - get more information about test failures, and - catch constructs breaking '-x' with /bin/sh sneaking into our test suite. Signed-off-by: SZEDER Gábor

[PATCH 09/11] t1510-repo-setup: mark as untraceable with '-x'

2018-02-23 Thread SZEDER Gábor
't1510-repo-setup.sh' checks the stderr of nested function calls way too many times, resulting in several failures when using '-x' tracing, unless it's executed with a Bash version supporting BASH_XTRACEFD. Maybe someday we will clear up this test script, but until then mark it as

[PATCH 04/11] t3030-merge-recursive: don't check the stderr of a subshell

2018-02-23 Thread SZEDER Gábor
The two test checking 'git mmerge-recursive' in an empty worktree in 't3030-merge-recursive.sh' fail when the test script is run with '-x' tracing (and using a shell other than a Bash version supporting BASH_XTRACEFD). The reason for those failures is that the tests check the emptiness of a

[PATCH 08/11] t9903-bash-prompt: don't check the stderr of __git_ps1()

2018-02-23 Thread SZEDER Gábor
A test in 't9903-bash-prompt.sh' fails when the test script is run with '-x' tracing and a Bash version not yet supporting BASH_XTRACEFD, notably the default Bash version shipped in OSX. The reason for the failure is that the test checks the emptiness of __git_ps1()'s stderr, which includes the

Git 2.16.2: Build failure linking static libcurl / static SSL

2018-02-23 Thread Paul Smith
I'm compiling Git with my own static libcurl and my own static LibreSSL. They live in two different locations. Building Curl with a pointer to my LibreSSL works fine, and compiling Git works fine: the correct -I options are added to the compile line when I configure with

[PATCHv4 08/27] pack: move approximate object count to object store

2018-02-23 Thread Stefan Beller
The approximate_object_count() function maintains a rough count of objects in a repository to estimate how long object name abbreviates should be. Object names are scoped to a repository and the appropriate length may differ by repository, so the object count should not be global. Signed-off-by:

[PATCHv4 15/27] sha1_file: allow prepare_alt_odb to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller --- object-store.h | 3 +-- sha1_file.c| 12 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/object-store.h b/object-store.h index 08cd48ade11..24b9a750aef 100644 --- a/object-store.h +++ b/object-store.h @@ -24,8

[PATCHv4 10/27] sha1_file: add repository argument to link_alt_odb_entry

2018-02-23 Thread Stefan Beller
Add a repository argument to allow the link_alt_odb_entry caller 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. Since the implementation does not yet work with

[PATCHv4 26/27] sha1_file: allow map_sha1_file to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 3 +-- sha1_file.c| 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/object-store.h b/object-store.h index 8b38330d256..afe2f93459b 100644 ---

[PATCHv4 16/27] sha1_file: add repository argument to sha1_file_name

2018-02-23 Thread Stefan Beller
Add a repository argument to allow sha1_file_name callers 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 catch callers

[PATCHv4 03/27] object-store: move alt_odb_list and alt_odb_tail to object store

2018-02-23 Thread Stefan Beller
In a process with multiple repositories open, alternates should be associated to a single repository and not shared globally. Move alt_odb_list and alt_odb_tail into the_repository and adjust callers to reflect this. Now that the alternative object data base is per repository, we're leaking its

[PATCH v2 1/2] t4151: consolidate multiple calls to test_i18ngrep

2018-02-23 Thread Ramsay Jones
Attempting to grep the output of test_i18ngrep will not work under a poison build, since the output is (almost) guaranteed not to have the string you are looking for. In this case, we have a test_i18ngrep call which attempts to filter the contents of a file, which was itself the result of a call

[PATCHv4 04/27] object-store: free alt_odb_list

2018-02-23 Thread Stefan Beller
Free the memory and reset alt_odb_{list, tail} to NULL. Signed-off-by: Stefan Beller --- object.c | 17 + 1 file changed, 17 insertions(+) diff --git a/object.c b/object.c index a2acdee1405..920dc4463fa 100644 --- a/object.c +++ b/object.c @@ -446,7 +446,24

[PATCHv4 05/27] object-store: move packed_git and packed_git_mru to object store

2018-02-23 Thread Stefan Beller
In a process with multiple repositories open, packfile accessors should be associated to a single repository and not shared globally. Move packed_git and packed_git_mru into the_repository and adjust callers to reflect this. Patch generated by 1. Moving the struct packed_git declaration to

[PATCHv4 14/27] sha1_file: allow link_alt_odb_entries to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Actually this also allows read_info_alternates and link_alt_odb_entry to handle arbitrary repositories, but link_alt_odb_entries is the most interesting function in this set of functions, hence the commit subject. These functions span a strongly connected component in the function graph, i.e. the

[PATCH v2 2/2] t5536: simplify checking of messages output to stderr

2018-02-23 Thread Ramsay Jones
From: SZEDER Gábor Commit 2071e05ed2 ("t5536: new test of refspec conflicts when fetching", 2013-10-30), introduced the verify_stderr() function which was used to verify that certain fatal/warning messages were issued by a given git command. In addition, verify_stderr()

Re: [PATCH v3 13/35] ls-refs: introduce ls-refs server command

2018-02-23 Thread Jeff King
On Thu, Feb 22, 2018 at 04:45:14PM -0800, Brandon Williams wrote: > > This kind of tail matching can't quite implement all of the current > > behavior. Because we actually do the normal dwim_ref() matching, which > > includes stuff like "refs/remotes/%s/HEAD". > > > > The other problem with

Re: [PATCH v3 13/35] ls-refs: introduce ls-refs server command

2018-02-23 Thread Jeff King
On Fri, Feb 23, 2018 at 04:19:54PM -0800, Brandon Williams wrote: > > We always have the ability to extend the patterns accepted via a feature > > (or capability) to ls-refs, so maybe the best thing to do now would only > > support a few patterns with specific semantics. Something like if you >

Re: [PATCH v3 21/35] fetch-pack: perform a fetch using v2

2018-02-23 Thread Jonathan Tan
On Tue, 6 Feb 2018 17:12:58 -0800 Brandon Williams wrote: > + while ((oid = get_rev())) { > + packet_buf_write(req_buf, "have %s\n", oid_to_hex(oid)); > + if (++haves_added >= INITIAL_FLUSH) > + break; > + }; Unnecessary

[PATCH v2 0/2] test_i18ngrep

2018-02-23 Thread Ramsay Jones
Since 'sg/test-i18ngrep' has now graduated to master, unlike v1, these patches are built on top of current master (@e3a80781f). In addition, the second patch has been replaced with the patch from SZEDER Gábor[1]. [Hopefully, I have included that patch correctly! If not, please amend as required.

Re: [PATCH 1/2] setup.c: initialize the_repository correctly in all cases

2018-02-23 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 5:17 AM, brian m. carlson wrote: > On Fri, Feb 23, 2018 at 04:56:39PM +0700, Nguyễn Thái Ngọc Duy wrote: >> [3] the reason server side is still running ok with no hash algo >> before [2] is because the programs that use enter_repo() do

[PATCH v2 1/5] setup.c: initialize the_repository correctly in all cases

2018-02-23 Thread Nguyễn Thái Ngọc Duy
There are many ways for any command to access a git repository: - most of them will try to discover the .git dir via setup_git_directory() and friends - the server side programs already know where the repo is and prepare with enter_repo() - special commands that deal with repo creation

[PATCH v2 5/5] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread Nguyễn Thái Ngọc Duy
This reverts commit e26f7f19b6c7485f04234946a59ab8f4fd21d6d1. The root problem, git clone not setting up the_hash_algo, has been fixed in the previous patch. Since this is a dangerous move and could potentially break stuff after release (and leads to workaround like the reverted commit), the

[PATCH v2 3/5] index-pack: check (and optionally set) hash algo based on input file

2018-02-23 Thread Nguyễn Thái Ngọc Duy
After 454253f059 (builtin/index-pack: improve hash function abstraction - 2018-02-01), index-pack uses the_hash_algo for hashing. If "git index-pack" is executed without a repository, we do not know what hash algorithm to be used and the_hash_algo in theory could be undefined. Since there should

[PATCH v2 2/5] sha1_file.c: keep a good name for "unknown" hash_algos[UNKNOWN]

2018-02-23 Thread Nguyễn Thái Ngọc Duy
This is mostly for displaying the hash algorithm name when we report errors. Printing "unknown" with '%s' is much better than '(null)' in glibc printf version (and probably could crash if other implementations do not check for NULL pointer) Signed-off-by: Nguyễn Thái Ngọc Duy

Re: [PATCH] commit-graph: fix some "plain integer as NULL pointer" warnings

2018-02-23 Thread René Scharfe
Am 24.02.2018 um 03:24 schrieb Ramsay Jones: > diff --git a/commit-graph.c b/commit-graph.c > index fc5ee7e99..c2f443436 100644 > --- a/commit-graph.c > +++ b/commit-graph.c > @@ -45,7 +45,7 @@ char *get_graph_latest_filename(const char *obj_dir) > { > struct strbuf fname = STRBUF_INIT; >

[PATCHv4 09/27] sha1_file: add raw_object_store argument to alt_odb_usable

2018-02-23 Thread Stefan Beller
Add a raw_object_store to alt_odb_usable to be more specific about which repository to act on. The choice of the repository is delegated to its only caller link_alt_odb_entry. Signed-off-by: Stefan Beller --- sha1_file.c | 8 +--- 1 file changed, 5 insertions(+), 3

[PATCHv4 24/27] sha1_file: allow open_sha1_file to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 952deb02195..73bbe3a3e88 100644 --- a/sha1_file.c +++ b/sha1_file.c

[PATCHv4 13/27] sha1_file: add repository argument to prepare_alt_odb

2018-02-23 Thread Stefan Beller
See previous patch for explanation. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- builtin/fsck.c | 2 +- object-store.h | 3 ++- packfile.c | 2 +- sha1_file.c| 13 +++-- sha1_name.c| 2 +- 5 files changed, 12

[PATCHv4 12/27] sha1_file: add repository argument to link_alt_odb_entries

2018-02-23 Thread Stefan Beller
See previous patch for explanation. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index

[PATCHv4 18/27] sha1_file: add repository argument to open_sha1_file

2018-02-23 Thread Stefan Beller
Add a repository argument to allow the open_sha1_file caller 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

[PATCHv4 17/27] sha1_file: add repository argument to stat_sha1_file

2018-02-23 Thread Stefan Beller
Add a repository argument to allow the stat_sha1_file caller 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

[PATCHv4 00/27] Moving global state into the repository object (part 1)

2018-02-23 Thread Stefan Beller
v4: * addressed feedback from the single patches (mostly nits) * rebased on latest master v3: * reverted back to use the repository for most of the functions (including unduplicating 'ignore_env') * rebased on master again (I lost that state when doing v2, as I did both rebase as well as

[PATCHv4 02/27] object-store: migrate alternates struct and functions from cache.h

2018-02-23 Thread Stefan Beller
Migrate the struct alternate_object_database and all its related functions to the object store as these functions are easier found in that header. The migration is just a verbatim copy, no need to include the object store header at any C file, because cache.h includes repository.h which in turn

[PATCHv4 11/27] sha1_file: add repository argument to read_info_alternates

2018-02-23 Thread Stefan Beller
See previous patch for explanation. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index e5fe0aa04ef..f93d3b95b54

[PATCHv4 07/27] pack: move prepare_packed_git_run_once to object store

2018-02-23 Thread Stefan Beller
Each repository's object store can be initialized independently, so they must not share a run_once variable. Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 8 +++- packfile.c | 7 +++ 2 files changed, 10

[PATCHv4 22/27] sha1_file: allow sha1_file_name to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- object-store.h | 3 +-- sha1_file.c| 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/object-store.h b/object-store.h index dbd589e0083..8b38330d256 100644 ---

[PATCH] commit-graph: fix some "plain integer as NULL pointer" warnings

2018-02-23 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Derrick, If you need to re-roll your 'ds/commit-graph' branch, could you please squash this into the relevant patches (corresponding to commits 0fd2d95ee6 ["commit-graph: implement --set-latest"], a33b9b79ff ["commit-graph:

[PATCH v2 0/5] Fix initializing the_hash_algo

2018-02-23 Thread Nguyễn Thái Ngọc Duy
Brian questioned the unnecessary alarms in v1 when "git diff" or "git index-pack" run in no-repository mode. I had the same feeling after sending v1. But instead of suppresing alarms, we could do better. v2 breaks those "fall back to SHA-1" code into separate patches and handles it properly (I

[PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-23 Thread Nguyễn Thái Ngọc Duy
Our "git diff" command supports running as a standalone tool. In this code path, we try to hash the file content but after 18e2588e11 (sha1_file: switch uses of SHA-1 to the_hash_algo - 2018-02-01), there is a chance that the_hash_algo (required by index_path) may still be uninitialized if no

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 5:29 AM, brian m. carlson wrote: >> @@ -40,5 +41,8 @@ int main(int argc, const char **argv) >> >> restore_sigpipe_to_default(); >> >> + if (getenv("GIT_HASH_FIXUP")) >> + repo_set_hash_algo(the_repository, GIT_HASH_SHA1);

F.LLI PISTOLESI Snc Company

2018-02-23 Thread .F.LLI PISTOLESI
Hello , I am looking for a reliable supplier /manufacturer of products for sell in Europe. I came across your listing and wanted to get some information regarding minimum Order Quantities, FOB pricing and also the possibility of packaging including payments terms. So could you please get

[PATCHv4 19/27] sha1_file: add repository argument to map_sha1_file_1

2018-02-23 Thread Stefan Beller
Add a repository argument to allow the map_sha1_file_1 caller 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

[PATCHv4 06/27] object-store: close all packs upon clearing the object store

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller --- builtin/am.c | 2 +- builtin/clone.c| 2 +- builtin/fetch.c| 2 +- builtin/merge.c| 2 +- builtin/receive-pack.c | 2 +- object.c | 7 +++ packfile.c | 4 ++-- packfile.h

[PATCHv4 23/27] sha1_file: allow stat_sha1_file to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 59993a0878d..952deb02195 100644 --- a/sha1_file.c +++ b/sha1_file.c

[PATCHv4 21/27] sha1_file: add repository argument to sha1_loose_object_info

2018-02-23 Thread Stefan Beller
Add a repository argument to allow the sha1_loose_object_info caller 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

[PATCHv4 27/27] sha1_file: allow sha1_loose_object_info to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index

[PATCHv4 25/27] sha1_file: allow map_sha1_file_1 to handle arbitrary repositories

2018-02-23 Thread Stefan Beller
From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- sha1_file.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 73bbe3a3e88..e32f1da6b69

[PATCHv4 20/27] sha1_file: add repository argument to map_sha1_file

2018-02-23 Thread Stefan Beller
Add a repository argument to allow map_sha1_file callers 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 catch callers

[PATCHv4 01/27] repository: introduce raw object store field

2018-02-23 Thread Stefan Beller
The raw object store field will contain any objects needed for access to objects in a given repository. This patch introduces the raw object store and populates it with the `objectdir`, which used to be part of the repository struct. As the struct gains members, we'll also populate the function

[PATCH] Call timegm and timelocal with 4-digit year

2018-02-23 Thread Bernhard M. Wiedemann
amazingly timegm(gmtime(0)) is only 0 before 2020 because perl's timegm deviates from GNU timegm(3) in how it handles years. man Time::Local says Whenever possible, use an absolute four digit year instead. with a detailed explanation about ambiguity of 2-digit years above that. Even though

Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-23 Thread Derrick Stolee
On 2/20/2018 5:57 PM, Junio C Hamano wrote: Derrick Stolee writes: +#define GRAPH_OID_VERSION_SHA1 1 +#define GRAPH_OID_LEN_SHA1 20 This hardcoded 20 on the right hand side of this #define is probably problematic. Unless you are planning to possibly store truncated hash

Re: [PATCH 1/1] git-p4: add unshelve command

2018-02-23 Thread Luke Diamand
On 22 February 2018 at 22:28, Luke Diamand wrote: > On 22 February 2018 at 21:39, Miguel Torroja wrote: >> Hi Luke, >> >> I really like the idea of creating a branch based on a shelved CL (We >> particularly use shelves all the time), I tested your

Re: [PATCH v4 08/13] commit-graph: implement --delete-expired

2018-02-23 Thread Derrick Stolee
On 2/21/2018 4:34 PM, Stefan Beller wrote: On Mon, Feb 19, 2018 at 10:53 AM, Derrick Stolee wrote: graph_name = write_commit_graph(opts.obj_dir); if (graph_name) { if (opts.set_latest) set_latest_file(opts.obj_dir,

Re: [PATCH v4 07/13] commit-graph: implement --set-latest

2018-02-23 Thread Derrick Stolee
On 2/22/2018 1:31 PM, Junio C Hamano wrote: Derrick Stolee writes: static struct opts_commit_graph { const char *obj_dir; const char *graph_file; + int set_latest; } opts; ... @@ -89,6 +106,8 @@ static int graph_write(int argc, const char **argv)

Re: [PATCH v4 02/13] graph: add commit graph design document

2018-02-23 Thread Derrick Stolee
On 2/20/2018 4:42 PM, Junio C Hamano wrote: Derrick Stolee writes: +2. Walking the entire graph to avoid topological order mistakes. You have at least one more mention of "topological order mistakes" below, but we commonly refer to this issue and blame it for "clock skew".

Re: RFC: git squash

2018-02-23 Thread Julius Musseau
On Thu, Feb 22, 2018 at 10:04 PM, Junio C Hamano wrote: > Julius Musseau writes: > >> git squash [] >> >> Squashes ..HEAD into a single commit. Replaces HEAD with the >> result. If not specified, defaults to the current branch's >> upstream (a.k.a.

Re: [PATCH v4 08/13] commit-graph: implement --delete-expired

2018-02-23 Thread Derrick Stolee
On 2/22/2018 1:48 PM, Junio C Hamano wrote: Derrick Stolee writes: Teach git-commit-graph to delete the .graph files that are siblings of a newly-written graph file, except for the file referenced by 'graph-latest' at the beginning of the process and the newly-written file.

Re: [PATCH] am: support --quit

2018-02-23 Thread Junio C Hamano
Duy Nguyen writes: >> The internal implementation detail of am_abort() is leaking out >> here, by saying "rerere-clear" is the only special thing other than >> recovering the HEAD and working tree state when abort happens. It >> makes readers wonder if am_rerere_clear()

Re: [PATCH v2 0/2] two small grep patches

2018-02-23 Thread Jeff King
On Fri, Feb 23, 2018 at 03:47:55PM +0100, Rasmus Villemoes wrote: > Changes in v2: > > - Drop patch 3 with dubious gain/complexity ratio > - Add comments regarding ownership of grep_source > > I was a little torn between copy-pasting the comment or just saying > "see above" in the second case.

git stash --keep-index doesn't have the expected behaviour

2018-02-23 Thread Daryl Van Den Brink
If you search the internet for "git stash only unstaged changes" you can find much misleading information about what "git stash --keep-index" does. However, it is my opinion that the --keep-index option is broken, in that it doesn't do what 90% of people want it to do - that is, stash only the

Re: [PATCH v4 03/13] commit-graph: create git-commit-graph builtin

2018-02-23 Thread Derrick Stolee
On 2/21/2018 1:58 PM, Junio C Hamano wrote: Junio C Hamano writes: Derrick Stolee writes: +int cmd_commit_graph(int argc, const char **argv, const char *prefix) +{ + static struct option builtin_commit_graph_options[] = { + {

  1   2   >