Re: What's cooking in git.git (Sep 2016, #08; Tue, 27)

2016-09-30 Thread Stefan Beller
> > > * jc/attr (2016-05-25) 18 commits > - attr: support quoting pathname patterns in C style > - attr: expose validity check for attribute names > - attr: add counted string version of git_attr() > - attr: add counted string version of git_check_attr() > - attr: retire git_check_attrs() API

Re: [PATCH v3 2/5] ref-filter: add function to print single ref_array_item

2016-09-30 Thread Junio C Hamano
Jakub Narębski writes: >> Expose a format_ref function to create, pretty print and free individual >> ref-items. > > It's now pretty_print_ref, not format_ref (old version in commit message). Good eyes. Will tweak locally. Thanks.

[PATCH 1/3] abbrev: add FALLBACK_DEFAULT_ABBREV to prepare for auto sizing

2016-09-30 Thread Junio C Hamano
We'll be introducing a new way to decide the default abbreviation length by initialising DEFAULT_ABBREV to -1 to signal the first call to "find unique abbreviation" codepath to compute a reasonable value based on the number of objects we have to avoid collisions. We have long relied on

[PATCH 0/3] auto-sizing default abbreviation length

2016-09-30 Thread Junio C Hamano
So here is what I queued in 'pu' tonight after back and forth with Linus and Peff. The third step from Linus needs to be signed off and also a meaningful log message for it needs to be written, and also may need to be updated to include what Linus did in [*1*], but otherwise I think these are in

[PATCH 3/3] abbrev: auto size the default abbreviation

2016-09-30 Thread Junio C Hamano
From: Linus Torvalds In fairly early days we somehow decided to abbreviate object names down to 7-hexdigits, but as projects grow, it is becoming more and more likely to see such a short object names made in earlier days and recorded in the log messages no longer

[PATCH 2/3] abbrev: prepare for new world order

2016-09-30 Thread Junio C Hamano
The code that sets custom abbreviation length, in response to command line argument, often does something like this: if (skip_prefix(arg, "--abbrev=", )) abbrev = atoi(arg); else if (!strcmp("--abbrev", )) abbrev = DEFAULT_ABBREV; /* make

Re: [PATCH v3 0/5] Add --format to tag verification

2016-09-30 Thread Junio C Hamano
What is in the patch series looked more or less good to me. Lukas's sirname was still P in [3/5], a patch in [4/5] added an unnecssary blank line before git_verify_tag_config() and also a local variable declaration for "char *fmt_pretty" was indented funnily, but none of these were something I

RE: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread David Turner
Thanks. The rest all look good too. > -Original Message- > From: Jeff King [mailto:p...@peff.net] > Sent: Friday, September 30, 2016 6:45 PM > To: David Turner > Cc: git@vger.kernel.org > Subject: Re: [PATCH 3/6] tmp-objdir: introduce API for temporary object > directories > > On Fri,

Re: [PATCH v3 2/5] ref-filter: add function to print single ref_array_item

2016-09-30 Thread Jakub Narębski
W dniu 01.10.2016 o 00:18, santi...@nyu.edu pisze: > From: Lukas Puehringer > > ref-filter functions are useful for printing git object information > using a format specifier. However, some other modules may not want to use > this functionality on a ref-array but only

Re: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread Jeff King
On Fri, Sep 30, 2016 at 09:32:04PM +, David Turner wrote: > > +static void env_append(struct argv_array *env, const char *key, const > > +char *val) { > > + const char *old = getenv(key); > > + > > + if (!old) > > + argv_array_pushf(env, "%s=%s", key, val); > > + else > > +

Re: "Purposes, Concepts,Misfits, and a Redesign of Git" (a research paper)

2016-09-30 Thread Jakub Narębski
W dniu 30.09.2016 o 18:14, Konstantin Khomoutov pisze: > The "It Will Never Work in Theory" blog has just posted a summary of a > study which tried to identify shortcomings in the design of Git. > > In the hope it might be interesting, I post this summary here. > URL:

[PATCH v3 3/5] tag: add format specifier to gpg_verify_tag

2016-09-30 Thread santiago
From: Lukas P Calling functions for gpg_verify_tag() may desire to print relevant information about the header for further verification. Add an optional format argument to print any desired information after GPG verification. Signed-off-by: Lukas Puehringer

[PATCH v3 5/5] builtin/tag: add --format argument for tag -v

2016-09-30 Thread santiago
From: Lukas Puehringer Adding --format to git tag -v mutes the default output of the GPG verification and instead prints the formatted tag object. This allows callers to cross-check the tagname from refs/tags with the tagname from the tag object header upon GPG

[PATCH v3 2/5] ref-filter: add function to print single ref_array_item

2016-09-30 Thread santiago
From: Lukas Puehringer ref-filter functions are useful for printing git object information using a format specifier. However, some other modules may not want to use this functionality on a ref-array but only print a single item. Expose a format_ref function to create,

[PATCH v3 4/5] builtin/verify-tag: add --format to verify-tag

2016-09-30 Thread santiago
From: Santiago Torres Callers of verify-tag may want to cross-check the tagname from refs/tags with the tagname from the tag object header upon GPG verification. This is to avoid tag refs that point to an incorrect object. Add a --format parameter to git verify-tag to print

[PATCH v3 0/5] Add --format to tag verification

2016-09-30 Thread santiago
From: Santiago Torres This is the third iteration of [1][2], and as a result of the discussion in [3]. In this re-roll we: * Fixed all the signed-off-by's [0002] * Renamed the function format_ref to pretty_print_ref instead, which is a more descriptive name [0004] *

[PATCH v3 1/5] gpg-interface, tag: add GPG_VERIFY_QUIET flag

2016-09-30 Thread santiago
From: Lukas Puehringer Functions that print git object information may require that the gpg-interface functions be silent. Add GPG_VERIFY_QUIET flag and prevent print_signature_buffer from being called if flag is set. Signed-off-by: Lukas Puehringer

Re: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread Jeff King
On Fri, Sep 30, 2016 at 02:25:43PM -0700, Junio C Hamano wrote: > > +void add_to_alternates_internal(const char *reference) > > +{ > > + prepare_alt_odb(); > > + link_alt_odb_entries(reference, strlen(reference), '\n', NULL, 0); > > +} > > + > > A function _internal being extern felt a bit

Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT

2016-09-30 Thread Jacob Keller
On Fri, Sep 30, 2016 at 3:56 AM, SZEDER Gábor wrote: >> On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: >> > There's no way to do this short of "%ad" and --date=short, >> > but that limits you to having a single date format in the >> > output. >> > >> > This

RE: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread David Turner
> +static void env_append(struct argv_array *env, const char *key, const > +char *val) { > + const char *old = getenv(key); > + > + if (!old) > + argv_array_pushf(env, "%s=%s", key, val); > + else > + argv_array_pushf(env, "%s=%s%c%s", key, old, PATH_SEP, >

Re: [PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread Junio C Hamano
Jeff King writes: > diff --git a/sha1_file.c b/sha1_file.c > index 9a79c19..65deaf9 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -421,6 +421,12 @@ void add_to_alternates_file(const char *reference) > free(alts); > } > > +void add_to_alternates_internal(const char

Re: [RFC/PATCH 0/2] place cherry pick line below commit title

2016-09-30 Thread Junio C Hamano
Junio C Hamano writes: > Jonathan Tan writes: > >>> I vaguely recall that there were some discussion on the definition >>> of "what's a trailer line" with folks from the kernel land, perhaps >>> while discussing the interpret-trailers topic. IIRC,

Re: [RFC/PATCH 0/2] place cherry pick line below commit title

2016-09-30 Thread Jonathan Tan
On 09/30/2016 12:34 PM, Junio C Hamano wrote: 2) The Linux kernel's repository has some "commit ... upstream." lines in this position (below the commit title) - for example, in commit dacc0987fd2e. "A group of people seem to prefer it there" does not lead to "therefore let's move it there for

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Junio C Hamano
Linus Torvalds writes: > On Fri, Sep 30, 2016 at 10:54 AM, Linus Torvalds > wrote: >> >>> So IMHO, the best combination is the init_default_abbrev() you posted in >>> [1], but initialized at the top of find_unique_abbrev(). And

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Ævar Arnfjörð Bjarmason
On Fri, Sep 30, 2016 at 3:01 AM, Linus Torvalds wrote: > On Thu, Sep 29, 2016 at 5:56 PM, Mike Hommey wrote: >> >> OTOH, how often does one refer to trees or blobs with abbreviated sha1s? >> Most of the time, you'd use abbreviated sha1s for

Re: [PATCH v8 11/11] convert: add filter..process option

2016-09-30 Thread Lars Schneider
> On 27 Sep 2016, at 17:37, Jakub Narębski wrote: > > Part second of the review of 11/11. > > W dniu 20.09.2016 o 21:02, larsxschnei...@gmail.com pisze: > >> + >> +if (!drv->process && (CAP_CLEAN & wanted_capability) && drv->clean) > > This is just a very minor

[PATCH 6/6] tmp-objdir: do not migrate files starting with '.'

2016-09-30 Thread Jeff King
This avoids "." and "..", as we already do, but also leaves room for index-pack to store extra data in the quarantine area (e.g., for passing back any analysis to be read by the pre-receive hook). Signed-off-by: Jeff King --- tmp-objdir.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 5/6] tmp-objdir: put quarantine information in the environment

2016-09-30 Thread Jeff King
The presence of the GIT_QUARANTINE_PATH variable lets any called programs know that they're operating in a temporary object directory (and where that directory is). Signed-off-by: Jeff King --- cache.h | 1 + tmp-objdir.c | 2 ++ 2 files changed, 3 insertions(+) diff --git

[PATCH 4/6] receive-pack: quarantine objects until pre-receive accepts

2016-09-30 Thread Jeff King
When a client pushes objects to us, index-pack checks the objects themselves and then installs them into place. If we then reject the push due to a pre-receive hook, we cannot just delete the packfile; other processes may be depending on it. We have to do a normal reachability check at this point

[PATCH 3/6] tmp-objdir: introduce API for temporary object directories

2016-09-30 Thread Jeff King
Once objects are added to the object database by a process, they cannot easily be deleted, as we don't know what other processes may have started referencing them. We have to clean them up with git-gc, which will apply the usual reachability and grace-period checks. This patch provides an

[PATCH 2/6] sha1_file: always allow relative paths to alternates

2016-09-30 Thread Jeff King
We recursively expand alternates repositories, so that if A borrows from B which borrows from C, A can see all objects. For the root object database, we allow relative paths, so A can point to B as "../B/objects". However, we currently do not allow relative paths when recursing, so B must use an

[PATCH 1/6] check_connected: accept an env argument

2016-09-30 Thread Jeff King
This lets callers influence the environment seen by rev-list, which will be useful when we start providing quarantined objects. Signed-off-by: Jeff King --- connected.c | 1 + connected.h | 5 + 2 files changed, 6 insertions(+) diff --git a/connected.c b/connected.c index

[PATCH 0/6] receive-pack: quarantine pushed objects

2016-09-30 Thread Jeff King
I've mentioned before on the list that GitHub "quarantines" objects while the pre-receive hook runs. Here are the patches to implement that. The basic problem is that as-is, index-pack admits pushed objects into the main object database immediately, before the pre-receive hook runs. It _has_ to,

Re: [RFC/PATCH 0/2] place cherry pick line below commit title

2016-09-30 Thread Junio C Hamano
Jonathan Tan writes: >> I vaguely recall that there were some discussion on the definition >> of "what's a trailer line" with folks from the kernel land, perhaps >> while discussing the interpret-trailers topic. IIRC, when somebody >> passes an improved version along,

Re: [PATCH] diff_unique_abbrev(): document its assumtion and limitation

2016-09-30 Thread Junio C Hamano
Jeff King writes: > ... Now that function _would_ > want to be updated as a result of the other conversation (it would need > to do something sensible with "-1", like turning it into "7", or > whatever else is deemed reasonable outside of a repository). > > Anyway. I just wonder

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Junio C Hamano
Linus Torvalds writes: > Considering that TRANSPORT_SUMMARY and TRANSPORT_SUMMARY_WIDTH are > both used in exactly one place each, I'd suggest getting rid of that > crazy macro, and just expanding it in those places to avoid these > kinds of crazy "hiding variables

Re: [PATCH v8 11/11] convert: add filter..process option

2016-09-30 Thread Lars Schneider
> On 27 Sep 2016, at 00:41, Jakub Narębski wrote: > > Part first of the review of 11/11. > > W dniu 20.09.2016 o 21:02, larsxschnei...@gmail.com pisze: >> From: Lars Schneider >> >> diff --git a/Documentation/gitattributes.txt >>

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Linus Torvalds
On Fri, Sep 30, 2016 at 11:40 AM, Junio C Hamano wrote: > > There is another instance buried deep in an obscure macro. A > minimum fix may look like this, but I really hope somebody else > finds a better approach. Heh. Yeah, that's just ugly. I assume this is why the odd git

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Junio C Hamano
Junio C Hamano writes: > From: Junio C Hamano > Date: Thu, 29 Sep 2016 21:19:20 -0700 > Subject: [PATCH] abbrev: adjust to the new world order > > The default_abbrev used to be a concrete value usable as the default > abbreviation length. The code that

Re: [RFC/PATCH 0/2] place cherry pick line below commit title

2016-09-30 Thread Jonathan Tan
On 09/29/2016 02:56 PM, Junio C Hamano wrote: Jonathan Tan writes: This is somewhat of a follow-up to my previous e-mail with subject "[PATCH] sequencer: support folding in rfc2822 footer" [1], in which I proposed relaxing the definition of a commit message footer to

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Linus Torvalds
On Fri, Sep 30, 2016 at 10:54 AM, Linus Torvalds wrote: > >> So IMHO, the best combination is the init_default_abbrev() you posted in >> [1], but initialized at the top of find_unique_abbrev(). And cached >> there, obviously, in a similar way. > > That's certainly

Re: [PATCH] diff_unique_abbrev(): document its assumtion and limitation

2016-09-30 Thread Jeff King
On Fri, Sep 30, 2016 at 10:54:53AM -0700, Junio C Hamano wrote: > This function is used to add "..." to displayed object names in > "diff --raw --abbrev[=]" output. It bases its behaviour on an > untold assumption that the abbreviation length requested by the > caller is "reasonble", i.e. most

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Jeff King
On Fri, Sep 30, 2016 at 10:54:16AM -0700, Linus Torvalds wrote: > On Fri, Sep 30, 2016 at 1:06 AM, Jeff King wrote: > > > > I agree that this deals with the performance concerns by caching the > > default_abbrev_len and starting there. I still think it's unnecessarily > > invasive

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Junio C Hamano
Jeff King writes: > I agree that this deals with the performance concerns by caching the > default_abbrev_len and starting there. I still think it's unnecessarily > invasive to touch get_short_sha1() at all, which is otherwise only a > reading function. > > So IMHO, the best

[PATCH] diff_unique_abbrev(): document its assumtion and limitation

2016-09-30 Thread Junio C Hamano
This function is used to add "..." to displayed object names in "diff --raw --abbrev[=]" output. It bases its behaviour on an untold assumption that the abbreviation length requested by the caller is "reasonble", i.e. most of the objects will abbreviate within the requested length and the

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Linus Torvalds
On Fri, Sep 30, 2016 at 1:06 AM, Jeff King wrote: > > I agree that this deals with the performance concerns by caching the > default_abbrev_len and starting there. I still think it's unnecessarily > invasive to touch get_short_sha1() at all, which is otherwise only a > reading

Re: [PATCH v2 03/11] i18n: add--interactive: mark strings with interpolation for translation

2016-09-30 Thread Jakub Narębski
W dniu 31.08.2016 o 14:31, Vasco Almeida pisze: > Use of sprintf following die or error_msg is necessary for placeholder > substitution take place. No, it is not. Though I don't think that we have in out Git::I18N the support for Perl i18n placeholder substitution. >From gettext manual:

Re: [PATCH v2 02/11] i18n: add--interactive: mark simple here documents for translation

2016-09-30 Thread Jakub Narębski
W dniu 31.08.2016 o 14:31, Vasco Almeida pisze: > Mark messages in here document without interpolation for translation. > > Marking for translation by removing here documents this way, rather than > take advantage of "print __ << EOF" way, makes other instances of help > messages in clean.c match

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
Pass through some known-safe options when recursing into submodules. (--cached, -v, -t, -z, --debug, --eol) If other unsafe options are given the caller will be errored out. Signed-off-by: Brandon Williams --- Something more like this correct? I ditched the extra parameters

Re: [PATCH v6 3/4] ls-files: pass through safe options for --recurse-submodules

2016-09-30 Thread Brandon Williams
On 09/29, Junio C Hamano wrote: > Brandon Williams writes: > > > +static void compile_submodule_options(const struct dir_struct *dir, int > > show_tag) > > +{ > > + if (line_terminator == '\0') > > + argv_array_push(_options, "-z"); > > + if (show_tag) > > +

"Purposes, Concepts,Misfits, and a Redesign of Git" (a research paper)

2016-09-30 Thread Konstantin Khomoutov
The "It Will Never Work in Theory" blog has just posted a summary of a study which tried to identify shortcomings in the design of Git. In the hope it might be interesting, I post this summary here. URL: http://neverworkintheory.org/2016/09/30/rethinking-git.html The except from that resource

Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT

2016-09-30 Thread SZEDER Gábor
> On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: > > There's no way to do this short of "%ad" and --date=short, > > but that limits you to having a single date format in the > > output. > > > > This would possibly be better done with something more like > > "%ad(short)". > > > >

Re: [PATCH v2] gpg-interface: use more status letters

2016-09-30 Thread Michael J Gruber
Ramsay Jones venit, vidit, dixit 28.09.2016 23:09: > > > On 28/09/16 20:59, Junio C Hamano wrote: >> Michael J Gruber writes: > >>> + "X" for a good expired signature, or good signature made by an expired >>> key, >> >> As an attempt to clarify that we cover both

Re: [PATCH v2] gpg-interface: use more status letters

2016-09-30 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 28.09.2016 21:59: > Michael J Gruber writes: > >> - Use GNUPGHOME="$HOME/gnupg-home-not-used" just like in other tests (lib). > > If you are not using /dev/null, I expected you to do > > . ./test-lib.sh >

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Jeff King
On Thu, Sep 29, 2016 at 06:18:03PM -0700, Linus Torvalds wrote: > On Thu, Sep 29, 2016 at 5:57 PM, Linus Torvalds > wrote: > > > > Actually, all the other cases seem to be "parse a SHA1 with a known > > length", so they really don't have a negative length. So this

Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits

2016-09-30 Thread Jeff King
On Thu, Sep 29, 2016 at 04:13:38PM -0700, Junio C Hamano wrote: > There are very early ones in the program startup sequence in the > following functions, but I do not think of a reason why our new and > early call to prepare_packed_git() might be problematic, given that > all of them require us

Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT

2016-09-30 Thread Jacob Keller
On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: > There's no way to do this short of "%ad" and --date=short, > but that limits you to having a single date format in the > output. > > This would possibly be better done with something more like > "%ad(short)". > > Signed-off-by: