Re: [PATCH 14/40] sha1_file: prepare for external odbs

2018-01-15 Thread Christian Couder
On Thu, Jan 4, 2018 at 7:00 PM, Jeff Hostetler wrote: > > > On 1/3/2018 11:33 AM, Christian Couder wrote: >> diff --git a/sha1_file.c b/sha1_file.c >> index 261baf800f..785e8dda03 100644 >> --- a/sha1_file.c >> +++ b/sha1_file.c >> @@ -322,17 +322,22 @@ static void fill_sha1_path(struct strbuf *b

Re: [PATCH v2 01/18] cat-file: split expand_atom into 2 functions

2018-01-15 Thread Оля Тележная
2018-01-16 1:09 GMT+03:00 Jeff King : > On Mon, Jan 15, 2018 at 04:33:35PM -0500, Jeff King wrote: > >> That works, but I don't think it's where we want to end up in the long >> run. I absolutely agree, I want to merge current edits and then continue migrating process. And hopefully second part of

[PATCH] sha1_file: remove static strbuf from sha1_file_name()

2018-01-15 Thread Christian Couder
Using a static buffer in sha1_file_name() is error prone and the performance improvements it gives are not needed in most of the callers. So let's get rid of this static buffer and, if necessary or helpful, let's use one in the caller. --- cache.h | 8 +++- http-walker.c | 6 -- h

Re: [PATCH v2 04/18] cat-file: move struct expand_data into ref-filter

2018-01-15 Thread Оля Тележная
2018-01-16 0:44 GMT+03:00 Jeff King : > On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > >> Need that for further reusing of formatting logic in cat-file. >> Have plans to get rid of using expand_data in cat-file at all, >> and use it only in ref-filter for collecting, formatting

Re: [PATCH v2 03/18] ref-filter: make valid_atom as function parameter

2018-01-15 Thread Оля Тележная
2018-01-16 0:42 GMT+03:00 Jeff King : > On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > >> Make valid_atom as a function parameter, >> there could be another variable further. >> Need that for further reusing of formatting logic in cat-file.c. >> >> We do not need to allow users

RE: [BUG] test_must_fail: does not correctly detect failures - Was Git 2.16.0-rc2 Test Summary on NonStop

2018-01-15 Thread Randall S. Becker
On January 15, 2018 10:01 PM, brian m. Carlson wrote: > On Mon, Jan 15, 2018 at 09:25:37AM -0500, Randall S. Becker wrote: > > On January 15, 2018 2:06 AM, Johannes Sixt wrote: > > > I take "die exits with non-zero" as a piece of information for the > > > *users* so that they can write "if perl foo

Re: [BUG] test_must_fail: does not correctly detect failures - Was Git 2.16.0-rc2 Test Summary on NonStop

2018-01-15 Thread brian m. carlson
On Mon, Jan 15, 2018 at 09:25:37AM -0500, Randall S. Becker wrote: > On January 15, 2018 2:06 AM, Johannes Sixt wrote: > > I take "die exits with non-zero" as a piece of information for the > > *users* so that they can write "if perl foo.pl; then something; fi" in shell > > scripts. I do *not* inte

Re: [BUG] git remote prune removes local tags, depending on fetch config

2018-01-15 Thread Michael Giuffrida
Just to confirm, you're talking about the behavior of removing *all* tags that aren't found on the remote? (Not just tags that used to be on some remote, but have since been removed from that remote.) So, with your proposed workflow, you would never create your own tags locally, without pushing the

[PATCH] mru: Replace mru.[ch] with list.h implementation

2018-01-15 Thread Gargi Sharma
Replace the custom calls to mru.[ch] with calls to list.h. This patch is the final step in removing the mru API completely and inlining the logic. Another discussion, here (https://public-inbox.org/git/caoci2dgyqr4jff5oby2buyhnjeaapqkf8tbojn2w0b18eo+...@mail.gmail.com/) was on what has to be done

Re: [BUG] git remote prune removes local tags, depending on fetch config

2018-01-15 Thread Ævar Arnfjörð Bjarmason
On Mon, Jan 15 2018, Michael Giuffrida jotted: > `git remote prune ` should "delete all stale remote-tracking > branches under ". I was surprised to discover, after some > troubleshooting, that it also deletes *all* local tags that don't > exist on the remote, if the following refspec is included

Re: [PATCH] Removed unnecessary void* from hashmap.h that caused compile warnings

2018-01-15 Thread Thomas Gummerer
On 01/15, Randall S. Becker wrote: > On January 15, 2018 3:43 PM, Thomas Gummerer wrote: > > Thanks for your patch! A few nitpicks below: > > > > > Subject: [PATCH] Removed unnecessary void* from hashmap.h that caused > > > compile warnings > > > > From Documentation/SubmittingPatches: > > > >

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Jeff King
On Tue, Jan 16, 2018 at 12:37:51AM +0100, Kim Gybels wrote: > > This looks good to me, and since it's a recent-ish regression, I think > > we should take the minimal fix here. > > The minimal fix being a simple NULL check before munmap()? Sorry to be unclear. I just meant that your patch is prob

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Kim Gybels
On (15/01/18 16:15), Jeff King wrote: > On Sat, Jan 13, 2018 at 05:11:49PM +0100, Kim Gybels wrote: > > > Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use > > read() instead of mmap() for small packed-refs files. > > > > This also fixes the problem[1] where xmmap() return

Re: [PATCH v2 01/18] cat-file: split expand_atom into 2 functions

2018-01-15 Thread Jeff King
On Mon, Jan 15, 2018 at 04:33:35PM -0500, Jeff King wrote: > That works, but I don't think it's where we want to end up in the long > run. Because: > > 1. We still have the set of formats duplicated between expand_atom() > and the "preparation" step. It's just that the preparation is now >

Re: [PATCH v2 04/18] cat-file: move struct expand_data into ref-filter

2018-01-15 Thread Jeff King
On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > Need that for further reusing of formatting logic in cat-file. > Have plans to get rid of using expand_data in cat-file at all, > and use it only in ref-filter for collecting, formatting and printing > needed data. I think some of

Re: [PATCH] Add shell completion for git remote rm

2018-01-15 Thread Keith Smiley
So it sounds like either we should deprecate rm, or I should update the patch to the suggested method where we just complete remotes, but not rm in the list of completions. Thoughts? -- Keith Smiley On Wed, Jan 3, 2018, at 11:24, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > > >

Re: [PATCH v2 03/18] ref-filter: make valid_atom as function parameter

2018-01-15 Thread Jeff King
On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > Make valid_atom as a function parameter, > there could be another variable further. > Need that for further reusing of formatting logic in cat-file.c. > > We do not need to allow users to pass their own valid_atom variable in > gl

Re: [PATCH v2 02/18] cat-file: reuse struct ref_format

2018-01-15 Thread Jeff King
On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > Start using ref_format struct instead of simple char*. > Need that for further reusing of formatting logic from ref-filter. OK, this makes sense (though again, at some point we want this to stop being a "ref_format" and just be a

Re: [PATCH v2 01/18] cat-file: split expand_atom into 2 functions

2018-01-15 Thread Jeff King
On Wed, Jan 10, 2018 at 09:36:41AM +, Olga Telezhnaya wrote: > Split expand_atom function into 2 different functions, > expand_atom_into_fields prepares variable for further filling, > (new) expand_atom creates resulting string. > Need that for further reusing of formatting logic from ref-filt

[GIT PULL] l10n updates for 2.16.0 round 2

2018-01-15 Thread Jiang Xin
Hi Junio, Please pull the following git l10n updates for Git 2.16.0. The following changes since commit 36438dc19dd2a305dddebd44bf7a65f1a220075b: Git 2.16-rc1 (2018-01-05 13:45:17 -0800) are available in the Git repository at: git://github.com/git-l10n/git-po tags/l10n-2.16.0-rnd2 for you

[BUG] git remote prune removes local tags, depending on fetch config

2018-01-15 Thread Michael Giuffrida
`git remote prune ` should "delete all stale remote-tracking branches under ". I was surprised to discover, after some troubleshooting, that it also deletes *all* local tags that don't exist on the remote, if the following refspec is included in the remote's fetch config: +refs/tags/*:refs/tag

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Jeff King
On Sat, Jan 13, 2018 at 05:11:49PM +0100, Kim Gybels wrote: > Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use > read() instead of mmap() for small packed-refs files. > > This also fixes the problem[1] where xmmap() returns NULL for zero > length[2], for which munmap() lat

RE: [PATCH] Removed unnecessary void* from hashmap.h that caused compile warnings

2018-01-15 Thread Randall S. Becker
On January 15, 2018 3:43 PM, Thomas Gummerer wrote: > Thanks for your patch! A few nitpicks below: > > > Subject: [PATCH] Removed unnecessary void* from hashmap.h that caused > > compile warnings > > From Documentation/SubmittingPatches: > > Describe your changes in imperative mood, e.g. "m

Re: [PATCH] Removed unnecessary void* from hashmap.h that caused compile warnings

2018-01-15 Thread Thomas Gummerer
Thanks for your patch! A few nitpicks below: > Subject: [PATCH] Removed unnecessary void* from hashmap.h that caused compile > warnings >From Documentation/SubmittingPatches: Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do fr

Hello

2018-01-15 Thread Miss Samira Kipkalya
My Dearest, I am Miss Samira Kipkalya Kones, I am seeking for an investment assistance, relocation and long term relationship , I am constrained to contact you because of the abuse which I am receiving from my step mother .My Late father deposited the sum of US$ 27.5 Million in one bank in Ben

[PATCH] describe: use strbuf_add_unique_abbrev() for adding short hashes

2018-01-15 Thread René Scharfe
Call strbuf_add_unique_abbrev() to add an abbreviated hash to a strbuf instead of taking a detour through find_unique_abbrev() and its static buffer. This is shorter and a bit more efficient. Patch generated by Coccinelle (and contrib/coccinelle/strbuf.cocci). Signed-off-by: Rene Scharfe --- Th

Re: [PATCH 10/40] external-odb: implement external_odb_get_direct

2018-01-15 Thread Christian Couder
On Thu, Jan 4, 2018 at 6:44 PM, Jeff Hostetler wrote: > > > On 1/3/2018 11:33 AM, Christian Couder wrote: >> >> This is implemented only in the promisor remote mode >> for now by calling fetch_object(). >> >> Signed-off-by: Christian Couder >> --- >> external-odb.c | 15 +++ >> ext

Re: [PATCH 01/40] Add initial external odb support

2018-01-15 Thread Christian Couder
On Thu, Jan 4, 2018 at 8:59 PM, Jeff Hostetler wrote: > >> diff --git a/odb-helper.h b/odb-helper.h >> new file mode 100644 >> index 00..9395e606ce >> --- /dev/null >> +++ b/odb-helper.h >> @@ -0,0 +1,24 @@ >> +#ifndef ODB_HELPER_H >> +#define ODB_HELPER_H >> + >> +struct odb_helper { >> +

RE: [BUG] test_must_fail: does not correctly detect failures - Was Git 2.16.0-rc2 Test Summary on NonStop

2018-01-15 Thread Randall S. Becker
On January 15, 2018 2:06 AM, Johannes Sixt wrote: > Am 15.01.2018 um 03:37 schrieb Randall S. Becker: > > On January 14, 2018 4:33 PM, I wrote: > >> The exotic error code coming back from perl is 162. I can muck with > >> it, if there was a value more useful to git. > >> * 553 } else if (

[PATCH 2/3] create_snapshot(): exit early if the file was empty

2018-01-15 Thread Michael Haggerty
If the `packed_refs` files is entirely empty (i.e., not even a header line), then `load_contents()` returns 1 even though `snapshot->buf` and `snapshot->eof` both end up set to NULL. In that case, the subsequent processing that `create_snapshot()` does is unnecessary, and also involves computing `N

[PATCH 3/3] find_reference_location(): don't invoke if `snapshot->buf` is NULL

2018-01-15 Thread Michael Haggerty
If `snapshot->buf` is NULL, then `find_reference_location()` has two problems: 1. It relies on behavior that is technically undefined in C, such as computing `NULL + 0`. 2. It returns NULL if the reference doesn't exist, even if `mustexist` is not set. This problem doesn't come up in the cu

[PATCH 1/3] SQUASH? Mention that `snapshot::buf` can be NULL for empty files

2018-01-15 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/packed-backend.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/refs/packed-backend.c b/refs/packed-backend.c index 01a13cb817..f20f05b4df 100644 --- a/refs/packed-backend.c +++ b/refs/packed-backend.c @@ -69,11 +69,11 @@ st

[PATCH 0/3] Supplements to "packed_ref_cache: don't use mmap() for small files"

2018-01-15 Thread Michael Haggerty
Thanks for your patch. I haven't measured the performance difference of `mmap()` vs. `read()` for small `packed-refs` files, but it's not surprising that `read()` would be faster. I especially like the fix for zero-length `packed-refs` files. (Even though AFAIK Git never writes such files, they ar

[PATCH v5 7/7] trace.c: print new cwd in trace_run_command()

2018-01-15 Thread Nguyễn Thái Ngọc Duy
If a command sets a new env variable GIT_DIR=.git, we need more context to know where that '.git' is related to. Signed-off-by: Nguyễn Thái Ngọc Duy --- trace.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/trace.c b/trace.c index 8db5bbf3c9..ad75d683bf 100644 --- a/trace.c +++ b/tra

[PATCH v5 5/7] trace.c: print program 'git' when child_process.git_cmd is set

2018-01-15 Thread Nguyễn Thái Ngọc Duy
We normally print full command line, including the program and its argument. When git_cmd is set, we have a special code path to run the right "git" program and child_process.argv[0] will not contain the program name anymore. As a result, we print just the command arguments. I thought it was a reg

[PATCH v5 6/7] trace.c: print env vars in trace_run_command()

2018-01-15 Thread Nguyễn Thái Ngọc Duy
Occasionally submodule code could execute new commands with GIT_DIR set to some submodule. GIT_TRACE prints just the command line which makes it hard to tell that it's not really executed on this repository. Print the env delta (compared to parent environment) in this case. Helped-by: Junio C Ham

[PATCH v5 4/7] trace.c: introduce trace_run_command()

2018-01-15 Thread Nguyễn Thái Ngọc Duy
This is the same as the old code that uses trace_argv_printf() in run-command.c. This function will be improved in later patches to print more information from struct child_process. A slight regression: the old code would print run-command.c:xxx as the trace location site while the new code prints

[PATCH v5 2/7] trace: avoid unnecessary quoting

2018-01-15 Thread Nguyễn Thái Ngọc Duy
From: Jeff King Trace output which contains arbitrary strings (e.g., the arguments to commands which we are running) is always passed through sq_quote_buf(). That function always adds single-quotes, even if the output consists of vanilla characters. This can make the output a bit hard to read. L

[PATCH v5 3/7] trace.c: move strbuf_release() out of print_trace_line()

2018-01-15 Thread Nguyễn Thái Ngọc Duy
The function is about printing a trace line, not releasing the buffer it receives too. Move strbuf_release() back outside. This makes it easier to see how strbuf is managed. Signed-off-by: Nguyễn Thái Ngọc Duy --- trace.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tr

[PATCH v5 0/7] Trace env variables in run_command()

2018-01-15 Thread Nguyễn Thái Ngọc Duy
v5 - makes test-run-command safer - deletes a dead line - fixes an embarassing memory leak Interdiff diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index 0ab71f14fb..153342e44d 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -57,9 +57,14

[PATCH v5 1/7] sq_quote_argv: drop maxlen parameter

2018-01-15 Thread Nguyễn Thái Ngọc Duy
From: Jeff King No caller passes anything but "0" for this parameter, which requests that the function ignore it completely. In fact, in all of history there was only one such caller, and it went away in 7f51f8bc2b (alias: use run_command api to execute aliases, 2011-01-07). Signed-off-by: Jeff

Re: [PATCH 1/1] Mark messages for translations

2018-01-15 Thread Duy Nguyen
On Mon, Jan 15, 2018 at 12:44 PM, Alexander Shopov wrote: > @@ -160,7 +160,7 @@ int check_filename(const char *prefix, const char *arg) > free(to_free); > return 0; /* file does not exist */ > } > - die_errno("failed to stat '%s'", arg); > + die_

Re: [PATCH 1/1] Mark messages for translations

2018-01-15 Thread Eric Sunshine
On Mon, Jan 15, 2018 at 12:44 AM, Alexander Shopov wrote: > Reuse already translated messages if possible > Do not translate messages aimed at developers of git A couple comments beyond those from Hannes... > Signed-off-by: Alexander Shopov > --- > diff --git a/git.c b/git.c > @@ -5,11 +5,11 @@

Re: [PATCH 1/1] Mark messages for translations

2018-01-15 Thread Alexander Shopov
And again, sigh: >> const char git_usage_string[] = >> const char git_more_info_string[] = > It is not obvious to me where git_usage_string is looked up in the > message catalog. It is used that way in builtin/help.c .. I wanted to be consistent with the current state of the file. This is