Re: [PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-20 Thread Michael Haggerty
On 12/19/2016 11:53 PM, Philip Oakley wrote: > From: "Michael Haggerty" >> This patch series changes a bunch of details about how remote-tracking >> references are rendered in the commit list of gitk: >> > [...] >> * Introduce a separate constant to speci

Re: [PATCH 0/5] git check-ref-format --stdin --report-errors

2016-12-19 Thread Michael Haggerty
On 12/19/2016 07:23 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Especially given that the output is not especially machine-readable, it >> might be more consistent with other commands to call the new feature >> `--verbose` rather than `--report-errors`. &g

Re: [PATCH 1/5] check-ref-format: Refactor out check_one_ref_format

2016-12-19 Thread Michael Haggerty
On 12/19/2016 02:19 PM, Ian Jackson wrote: > Michael Haggerty writes ("Re: [PATCH 1/5] check-ref-format: Refactor out > check_one_ref_format"): >> On 11/04/2016 08:13 PM, Ian Jackson wrote: >>> +static int check_one_ref_format(const char *refname) > ... >>

[PATCH 03/13] gitk: use a type "tags" to indicate abbreviated tags

2016-12-19 Thread Michael Haggerty
This replaces the functionality of the old `singletag` variable. Signed-off-by: Michael Haggerty --- gitk | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index 7c830c3..502f0aa 100755 --- a/gitk +++ b/gitk @@ -6561,7 +6561,6 @@ proc drawtags {id x xt

[PATCH 13/13] gitk: change the default colors for remote-tracking references

2016-12-19 Thread Michael Haggerty
local branches, so it is appropriate that their coloring be subtler. * Brown isn't used elsewhere. Signed-off-by: Michael Haggerty --- gitk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitk b/gitk index cb5c715..be97640 100755 --- a/gitk +++ b/gitk @@ -12363,8 +12

[PATCH 11/13] gitk: introduce a constant otherrefbgcolor

2016-12-19 Thread Michael Haggerty
This is the value used for references other than tags, heads, and remote-tracking references (e.g., `refs/stash`). Signed-off-by: Michael Haggerty --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index 44f4d70..0bd4aa5 100755 --- a/gitk +++ b

[PATCH 10/13] gitk: use type "remote" for remote-tracking references

2016-12-19 Thread Michael Haggerty
This is clearer, and also lets us avoid calling `remotereftext` a second time for normal branches. Signed-off-by: Michael Haggerty --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index d22ce5f..44f4d70 100755 --- a/gitk +++ b/gitk @@ -6613,9

[PATCH 09/13] gitk: shorten labels displayed for modern remote-tracking refs

2016-12-19 Thread Michael Haggerty
space displaying `remote/` for every remote reference. However, if a remote-tracking reference has only two slashes, like refs/remotes/baz , render the label the same as before, namely remotes/baz Signed-off-by: Michael Haggerty --- gitk | 10 +++--- 1 file changed, 7

[PATCH 05/13] gitk: fill in `wvals` as the tags are first processed

2016-12-19 Thread Michael Haggerty
It's no longer, and a little bit more direct, to fill in `wvals` at the same time as we determine the tag's type. Signed-off-by: Michael Haggerty --- gitk | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gitk b/gitk index d2e3803..fb2f653 10

[PATCH 08/13] gitk: only change the color of the "remote" part of remote refs

2016-12-19 Thread Michael Haggerty
cking references with only two slashes (e.g., `refs/remotes/foo`). Such references were created by `git-svn` when using its old naming scheme. They are still rendered like remotes/foo Signed-off-by: Michael Haggerty --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH 04/13] gitk: use a type "mainhead" to indicate the main HEAD branch

2016-12-19 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- gitk | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gitk b/gitk index 502f0aa..d2e3803 100755 --- a/gitk +++ b/gitk @@ -6588,7 +6588,11 @@ proc drawtags {id x xt y1} { } if {[info exists idheads($id

[PATCH 06/13] gitk: simplify regexp

2016-12-19 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index fb2f653..84a5326 100755 --- a/gitk +++ b/gitk @@ -6654,7 +6654,7 @@ proc drawtags {id x xt y1} { set xl [expr {$xl - $delta/2}] $canv create

[PATCH 07/13] gitk: extract a method `remotereftext`

2016-12-19 Thread Michael Haggerty
The text value that it also provides to its caller is not used yet, but it will be soon. Signed-off-by: Michael Haggerty --- gitk | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 84a5326..51ebaf5 100755 --- a/gitk +++ b/gitk @@ -6551,6

[PATCH 12/13] gitk: add a configuration setting `remoterefbgcolor`

2016-12-19 Thread Michael Haggerty
, `remoterefbgcolor`. For the moment, leave it set to the old default `headbgcolor`. Signed-off-by: Michael Haggerty --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index 0bd4aa5..cb5c715 100755 --- a/gitk +++ b/gitk @@ -6574,7 +6574,7 @@ proc drawtags {id x xt

[PATCH 02/13] gitk: keep track of tag types in a separate `types` array

2016-12-19 Thread Michael Haggerty
The resulting code is easier to follow than the old counting-based code, plus in a moment we will add some more specific types. Signed-off-by: Michael Haggerty --- gitk | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/gitk b/gitk index

[PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-19 Thread Michael Haggerty
e adjusted by editing the configuration file. Someday it would be nice to allow them to be configured via the preferences dialog.) It's been a while since I've written any Tcl code, so I apologize in advance for any howlers :-) This branch applies against the `master` branch in git://ozlabs.

[PATCH 01/13] gitk: when processing tag labels, don't use `marks` as scratch space

2016-12-19 Thread Michael Haggerty
Instead, just append to it as necessary. Signed-off-by: Michael Haggerty --- gitk | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index a14d7a1..296efb3 100755 --- a/gitk +++ b/gitk @@ -6570,18 +6570,20 @@ proc drawtags {id x xt y1} { set

Re: [PATCH 5/5] check-ref-format: New --stdin option

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > Signed-off-by: Ian Jackson > --- > Documentation/git-check-ref-format.txt | 10 -- > builtin/check-ref-format.c | 34 > +++--- > 2 files changed, 39 insertions(+), 5 deletions(-) > > [...] > diff --git

Re: [PATCH 0/5] git check-ref-format --stdin --report-errors

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > I wanted to be able to syntax check lots of proposed refs quickly > (please don't ask why - it's complicated!) > > So I added a --stdin option to git-check-ref-format. Also it has > --report-errors now too so you can get some kind of useful error > mes

Re: [PATCH 5/5] check-ref-format: New --stdin option

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > Signed-off-by: Ian Jackson > --- > Documentation/git-check-ref-format.txt | 10 -- > builtin/check-ref-format.c | 34 > +++--- > 2 files changed, 39 insertions(+), 5 deletions(-) > > diff --git a/Docume

Re: [PATCH 3/5] check-ref-format: Abolish leak of collapsed refname

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > collapse_slashes always returns a value from xmallocz. > > Right now this leak is not very interesting, since we only call > check_one_ref_format once. > > Signed-off-by: Ian Jackson > --- > builtin/check-ref-format.c | 4 +++- > 1 file changed, 3 in

Re: [PATCH 2/5] check-ref-format: Refactor to make --branch code more common

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > We are going to want to permit other options with --branch. > > So, replace the special case with just an entry for --branch in the > parser for ordinary options, and check for option compatibility at the > end. > > No overall functional change. > > S

Re: [PATCH 1/5] check-ref-format: Refactor out check_one_ref_format

2016-12-19 Thread Michael Haggerty
On 11/04/2016 08:13 PM, Ian Jackson wrote: > We are going to want to reuse this. No functional change right now. > > It currently has a hidden memory leak if --normalize is used. > > Signed-off-by: Ian Jackson > --- > builtin/check-ref-format.c | 26 ++ > 1 file changed

Re: [ANNOUNCE] Git v2.11.0-rc0

2016-11-02 Thread Michael Haggerty
On 11/01/2016 10:38 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> If it involves renaming and swapping, however, we may be talking >> about a change that we cannot deliver with confidence in less than a >> week before -rc1, which sounds, eh, suboptimal. >> >> FWIW, here is how the remov

Re: [PATCH 2/2] files_read_raw_ref: prevent infinite retry loops in general

2016-10-10 Thread Michael Haggerty
he previous commit, there's no known way > to trigger an infinite loop, but I did manually verify that > this fixes the test in that commit even when the code change > is not applied. > [...] This patch is Reviewed-by: Michael Haggerty Michael

Re: [PATCH v2 1/2] files_read_raw_ref: avoid infinite loop on broken symlinks

2016-10-10 Thread Michael Haggerty
On 10/06/2016 09:41 PM, Jeff King wrote: > [...] > Subject: files_read_raw_ref: avoid infinite loop on broken symlinks > [...] This patch is Reviewed-by: Michael Haggerty Michael

Re: thoughts on error passing, was Re: [PATCH 2/2] fsck: handle bad trees like other errors

2016-09-27 Thread Michael Haggerty
On 09/27/2016 09:19 PM, Jeff King wrote: > [...] > I'm going to ramble for a minute, and I don't think it's worth exploring > for this patch series in particular, so feel free to ignore me. > > I think this error concept could be extended fairly elegantly with > something like: > > typedef void

Re: [PATCH] xdiff: rename "struct group" to "struct xdlgroup"

2016-09-27 Thread Michael Haggerty
On 09/27/2016 06:37 AM, Jeff King wrote: > Commit e8adf23 (xdl_change_compact(): introduce the concept > of a change group, 2016-08-22) added a "struct group" type > to xdiff/xdiffi.c. But the POSIX system header "grp.h" > already defines "struct group" (it is part of the getgrnam > interface). Thi

Re: [PATCH v3 0/8] Better heuristics make prettier diffs

2016-09-19 Thread Michael Haggerty
On 09/19/2016 07:27 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Michael Haggerty writes: >> >>> On 09/08/2016 01:25 AM, Junio C Hamano wrote: >>>> I'd move it temporarily to t4061 with a separate SQUASH??? at the >>>> tip for

Re: [PATCH v3 0/8] Better heuristics make prettier diffs

2016-09-18 Thread Michael Haggerty
On 09/08/2016 01:25 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> * Add test t4059 as part of this commit, not as part of its >> successor. > > Which needs to be moved to somewhere else, as another topics that > has already been in 'ne

Re: [PATCH v2 00/38] Virtualization of the refs API

2016-09-07 Thread Michael Haggerty
On 09/07/2016 09:20 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> This is v2 of the patch series to virtualize the references API >> (though earlier patch series similar in spirit were submitted by >> Ronnie Sahlberg and David Turner). Thanks to Junio, Eric,

Re: [PATCH v2 02/38] rename_ref_available(): add docstring

2016-09-06 Thread Michael Haggerty
On 09/06/2016 04:25 PM, Jakub Narębski wrote: > W dniu 04.09.2016 o 18:08, Michael Haggerty pisze: > >> +/* >> + * Check whether an attempt to rename old_refname to new_refname would >> + * cause a D/F conflict with any existing reference (other than >> + * possibl

[PATCH v3 8/8] blame: honor the diff heuristic options and config

2016-09-05 Thread Michael Haggerty
ceivable to introduce separate configuration options for "blame" and "annotate"; for example `blame.compactionHeuristic` and `blame.indentHeuristic`. But it would be confusing to users if blame output is inconsistent with diff output, so it makes more sense for them to respect the sa

[PATCH v3 2/8] xdl_change_compact(): only use heuristic if group can't be matched

2016-09-05 Thread Michael Haggerty
group higher than the blank line. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 95b037e..61deed8 100644 --- a/xdiff/xdiffi.c +++ b/xdiff/xdiffi.c

[PATCH v3 7/8] parse-options: add parse_opt_unknown_cb()

2016-09-05 Thread Michael Haggerty
Add a new callback function, parse_opt_unknown_cb(), which returns -2 to indicate that the corresponding option is unknown. This can be used to add "-h" documentation for an option that will be handled externally to parse_options(). Signed-off-by: Michael Haggerty --- See the next pat

[PATCH v3 3/8] is_blank_line(): take a single xrecord_t as argument

2016-09-05 Thread Michael Haggerty
There is no reason for it to take an array and index as argument, as it only accesses a single element of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 61deed8

[PATCH v3 5/8] xdl_change_compact(): introduce the concept of a change group

2016-09-05 Thread Michael Haggerty
o-index --compaction-heuristic a.txt b.txt diff --git a/a.txt b/b.txt index e53969f..0d60c5fe 100644 --- a/a.txt +++ b/b.txt @@ -1,3 +1,7 @@ 1 +A + +B + A 2 The new code gives the bottom answer. Signed-off-by: Michael Haggerty ---

[PATCH v3 4/8] recs_match(): take two xrecord_t pointers as arguments

2016-09-05 Thread Michael Haggerty
There is no reason for it to take an array and two indexes as argument, as it only accesses two elements of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index

[PATCH v3 6/8] diff: improve positioning of add/delete blocks in diffs

2016-09-05 Thread Michael Haggerty
ation and analysis, along with the human-generated data values, are recorded in a separate project [1]. This patch adds a new command-line option `--indent-heuristic`, and a new configuration setting `diff.indentHeuristic`, that activate this heuristic. This interface is only meant for te

[PATCH v3 1/8] xdl_change_compact(): fix compaction heuristic to adjust ixo

2016-09-05 Thread Michael Haggerty
ce ixo was too large at the end of that iteration, it will be incremented past the end of the xdfo->rchg array, and will try to read that memory illegally. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c

[PATCH v3 0/8] Better heuristics make prettier diffs

2016-09-05 Thread Michael Haggerty
864378.git.mhag...@alum.mit.edu/ [2] http://public-inbox.org/git/a27aa17e-f602-fc49-92b3-2198e4772...@ramsayjones.plus.com/ [3] https://github.com/mhagger/git Michael Haggerty (8): xdl_change_compact(): fix compaction heuristic to adjust ixo xdl_change_compact(): only use heuristic if group can&#x

Re: [PATCH v2 7/7] blame: actually use the diff opts parsed from the command line

2016-09-04 Thread Michael Haggerty
On 08/23/2016 11:56 AM, René Scharfe wrote: > Am 22.08.2016 um 13:22 schrieb Michael Haggerty: >> "git blame" already parsed generic diff options from the command line >> via diff_opt_parse(), but instead of passing the resulting xdl_opts to >> xdi_diff(), it se

Re: [PATCH v2 05/38] refs: create a base class "ref_store" for files_ref_store

2016-09-04 Thread Michael Haggerty
On 09/04/2016 10:40 PM, David Turner wrote: > On Sun, 2016-09-04 at 18:08 +0200, Michael Haggerty wrote: > >> +/* A linked list of ref_stores for submodules: */ >> +static struct ref_store *submodule_ref_stores; > > I don't like the per-submodule stores being in a li

[PATCH v2 19/38] refs: make read_raw_ref() virtual

2016-09-04 Thread Michael Haggerty
Reference backends will be able to customize this function to implement reference reading. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 4 ++-- refs/files-backend.c | 14 -- refs/refs-internal.h | 36

[PATCH v2 28/38] lock_ref_sha1_basic(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 2f8eb54..ab2c1de 100644 --- a/refs/files-backend.c +++ b/refs

[PATCH v2 11/38] refs: reorder definitions

2016-09-04 Thread Michael Haggerty
Move resolve_gitlink_ref() and related functions lower in the file to avoid the need for forward declarations in the next step. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 166 +-- 1 file changed, 83

[PATCH v2 25/38] lock_raw_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 363f306..ae425c5 100644 --- a/refs/files-backend.c +++ b/refs/files

[PATCH v2 24/38] repack_without_refs(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 8d43e0b..363f306 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 21/38] refs: make pack_refs() virtual

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 6 -- refs/refs-internal.h | 4 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 662c417..961927a 100644 --- a/refs.c +++ b

[PATCH v2 20/38] refs: make verify_refname_available() virtual

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 10 ++ refs/files-backend.c | 14 -- refs/refs-internal.h | 7 +++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 7a7adeb..662c417 100644

[PATCH v2 36/38] refs: add method to rename refs

2016-09-04 Thread Michael Haggerty
From: David Turner This removes the last caller of function get_files_ref_store(), so remove it. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 24

[PATCH v2 34/38] refs: make delete_refs() virtual

2016-09-04 Thread Michael Haggerty
: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 6 -- refs/refs-internal.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH v2 27/38] lock_ref_for_update(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 001b8ef..2f8eb54 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 32/38] refs: add methods for reflog

2016-09-04 Thread Michael Haggerty
ff-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 63 ++ refs/files-backend.c | 70 +--- refs/refs-internal.h | 44 +++-- 3 files changed, 150 inser

[PATCH v2 26/38] commit_ref_update(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index ae425c5..001b8ef 100644 --- a/refs/files-backend.c +++ b/refs/files

[PATCH v2 15/38] resolve_ref_recursively(): new function

2016-09-04 Thread Michael Haggerty
Add a new function, resolve_ref_recursively(), which is basically like the old resolve_ref_unsafe() except that it takes a (ref_store *) argument and also works for submodules. Re-implement resolve_ref_unsafe() as a thin wrapper around resolve_ref_recursively(). Signed-off-by: Michael Haggerty

[PATCH v2 12/38] resolve_packed_ref(): rename function from resolve_missing_loose_ref()

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 7673342..32ca5ff 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases

2016-09-04 Thread Michael Haggerty
If we don't have to strip trailing '/' from the submodule path, then don't allocate and copy the submodule name. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --g

[PATCH v2 09/38] {lock,commit,rollback}_packed_refs(): add files_ref_store arguments

2016-09-04 Thread Michael Haggerty
These functions currently only work in the main repository, so add an assert_main_repository() check to each function. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 32 1 file changed, 16 insertions(+), 16 deletions

[PATCH v2 23/38] refs: make peel_ref() virtual

2016-09-04 Thread Michael Haggerty
For now it only supports the main reference store. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 6 -- refs/refs-internal.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c

[PATCH v2 05/38] refs: create a base class "ref_store" for files_ref_store

2016-09-04 Thread Michael Haggerty
We want ref_stores to be polymorphic, so invent a base class of which files_ref_store is a derived class. For now there is exactly one ref_store for the main repository and one for any submodules whose references have been accessed. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano

[PATCH v2 13/38] resolve_gitlink_packed_ref(): remove function

2016-09-04 Thread Michael Haggerty
Now that resolve_packed_ref() can work with an arbitrary files_ref_store, there is no need to have a separate resolve_gitlink_packed_ref() function. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 26 +- 1 file changed, 5

[PATCH v2 37/38] refs: make lock generic

2016-09-04 Thread Michael Haggerty
From: David Turner Instead of including a files-backend-specific struct ref_lock, change the generic ref_update struct to include a void pointer that backends can use for their own arbitrary data. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty

[PATCH v2 35/38] refs: add methods to init refs db

2016-09-04 Thread Michael Haggerty
From: David Turner Alternate refs backends might not need the refs/heads directory and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- builtin/init-db.c

[PATCH v2 38/38] refs: implement iteration over only per-worktree refs

2016-09-04 Thread Michael Haggerty
iterating. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 4 refs/refs-internal.h | 10 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files

[PATCH v2 22/38] refs: make create_symref() virtual

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 9 + refs/files-backend.c | 7 ++- refs/refs-internal.h | 5 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 961927a..74874e5 100644 --- a/refs.c +++ b

[PATCH v2 33/38] refs: add method for initial ref transaction commit

2016-09-04 Thread Michael Haggerty
From: David Turner Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 8 refs/files-backend.c | 8 +--- refs/refs-internal.h | 1 + 3 files changed

[PATCH v2 29/38] split_symref_update(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index ab2c1de..3a0db5a 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 30/38] files_ref_iterator_begin(): take a ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 2 +- refs/files-backend.c | 4 ++-- refs/refs-internal.h | 8 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/refs.c b/refs.c index f10f86a..d00126b 100644 --- a/refs.c +++ b/refs.c

[PATCH v2 31/38] refs: add method iterator_begin

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 2 +- refs/files-backend.c | 3 ++- refs/refs-internal.h | 24 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/refs.c b/refs.c index d00126b..798b08a 100644 --- a

[PATCH v2 02/38] rename_ref_available(): add docstring

2016-09-04 Thread Michael Haggerty
From: David Turner And improve the internal variable names. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 12 ++-- refs/refs-internal.h | 12 +++- 2 files changed, 17

[PATCH v2 14/38] read_raw_ref(): take a (struct ref_store *) argument

2016-09-04 Thread Michael Haggerty
And make the function work for submodules. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 4 +++- refs/files-backend.c | 18 +- refs/refs-internal.h | 9 ++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/refs.c

[PATCH v2 00/38] Virtualization of the refs API

2016-09-04 Thread Michael Haggerty
lable(): add docstring refs: add methods for reflog refs: add method for initial ref transaction commit refs: make delete_refs() virtual refs: add methods to init refs db refs: add method to rename refs refs: make lock generic refs: implement iteration over only per-worktree refs Mi

[PATCH v2 08/38] resolve_missing_loose_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 2fc8ec9..0c92ace 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 01/38] resolve_gitlink_ref(): eliminate temporary variable

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 12290d2..74c2c47 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 07/38] get_packed_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index c544de8..2fc8ec9 100644 --- a/refs/files-backend.c +++ b/refs/files

[PATCH v2 10/38] refs: add a transaction_commit() method

2016-09-04 Thread Michael Haggerty
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Jeff King Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 9 + refs/files-backend.c | 10 ++ refs/refs

[PATCH v2 18/38] resolve_gitlink_ref(): rename path parameter to submodule

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 13 +++-- refs.h | 9 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/refs.c b/refs.c index 34c0c5e..e881874 100644 --- a/refs.c +++ b/refs.c @@ -1299,26 +1299,27 @@ const char

[PATCH v2 16/38] resolve_gitlink_ref(): implement using resolve_ref_recursively()

2016-09-04 Thread Michael Haggerty
-submodule references. And, since the code is now agnostic about reference backends, it will work for any future references backend (so move its definition to refs.c). Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 24 +++ refs/files-back

[PATCH v2 04/38] refs: add a backend method structure

2016-09-04 Thread Michael Haggerty
, the backends cannot do anything. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Jeff King Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 19 +++ refs.h | 2

[PATCH v2 03/38] refs: rename struct ref_cache to files_ref_store

2016-09-04 Thread Michael Haggerty
to hold the reference caches. So let's treat ref_caches as embryo ref_stores, and build them out from there. As the first step, simply rename `ref_cache` to `files_ref_store`, and rename some functions and attributes correspondingly. Signed-off-by: Michael Haggerty Signed-off-by: Junio C H

[PATCH v2 06/38] add_packed_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 439c500..c544de8 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

Re: on Amazon EFS (NFS): "Reference directory conflict: refs/heads/" with status code 128

2016-08-25 Thread Michael Haggerty
On 08/25/2016 06:01 PM, Alex Nauda wrote: > On Thu, Aug 25, 2016 at 2:28 AM, Michael Haggerty > wrote: >> On 08/24/2016 11:39 PM, Jeff King wrote: >>> On Wed, Aug 24, 2016 at 04:52:33PM -0400, Alex Nauda wrote: >>> >>>> Elastic File System (EFS) is

Re: on Amazon EFS (NFS): "Reference directory conflict: refs/heads/" with status code 128

2016-08-24 Thread Michael Haggerty
On 08/24/2016 11:39 PM, Jeff King wrote: > On Wed, Aug 24, 2016 at 04:52:33PM -0400, Alex Nauda wrote: > >> Elastic File System (EFS) is Amazon's scalable filesystem product that >> is exposed to the OS as an NFS mount. We're using EFS to host the >> filesystem used by a Jenkins CI server. Sometim

[PATCH v2 7/7] blame: actually use the diff opts parsed from the command line

2016-08-22 Thread Michael Haggerty
d, rely on diff_opt_parse() to parse all of the diff options, including "-w" and "--minimal", and pass the resulting xdl_opts to xdi_diff(). Signed-off-by: Michael Haggerty --- Somebody who knows more about how diff operations are configured should please review this. I'

[PATCH v2 4/7] recs_match(): take two xrecord_t pointers as arguments

2016-08-22 Thread Michael Haggerty
There is no reason for it to take an array and two indexes as argument, as it only accesses two elements of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index

[PATCH v2 5/7] xdl_change_compact(): introduce the concept of a change group

2016-08-22 Thread Michael Haggerty
o-index --compaction-heuristic a.txt b.txt diff --git a/a.txt b/b.txt index e53969f..0d60c5fe 100644 --- a/a.txt +++ b/b.txt @@ -1,3 +1,7 @@ 1 +A + +B + A 2 The new code gives the bottom answer. Signed-off-by: Michael Haggerty ---

[PATCH v2 6/7] diff: improve positioning of add/delete blocks in diffs

2016-08-22 Thread Michael Haggerty
ation and analysis, along with the human-generated data values, are recorded in a separate project [1]. This patch adds a new command-line option `--indent-heuristic`, and a new configuration setting `diff.indentHeuristic`, that activate this heuristic. This interface is only meant for te

[PATCH v2 3/7] is_blank_line(): take a single xrecord_t as argument

2016-08-22 Thread Michael Haggerty
There is no reason for it to take an array and index as argument, as it only accesses a single element of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 61deed8

[PATCH v2 1/7] xdl_change_compact(): fix compaction heuristic to adjust ixo

2016-08-22 Thread Michael Haggerty
ce ixo was too large at the end of that iteration, it will be incremented past the end of the xdfo->rchg array, and will try to read that memory illegally. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c

[PATCH v2 0/7] Better heuristics make prettier diffs

2016-08-22 Thread Michael Haggerty
.com/mhagger/git [3] https://github.com/mhagger/diff-slider-tools Michael Haggerty (7): xdl_change_compact(): fix compaction heuristic to adjust ixo xdl_change_compact(): only use heuristic if group can't be matched is_blank_line(): take a single xrecord_t as argument recs_match(): take

[PATCH v2 2/7] xdl_change_compact(): only use heuristic if group can't be matched

2016-08-22 Thread Michael Haggerty
group higher than the blank line. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 95b037e..61deed8 100644 --- a/xdiff/xdiffi.c +++ b/xdiff/xdiffi.c

Re: [PATCH 1/8] xdl_change_compact(): rename some local variables for clarity

2016-08-14 Thread Michael Haggerty
On 08/04/2016 09:06 AM, Jeff King wrote: > On Thu, Aug 04, 2016 at 12:00:29AM +0200, Michael Haggerty wrote: > >> * ix -> i >> * ixo -> io >> * ixs -> start >> * grpsiz -> groupsize > > After your change, I immediately understand three of them. Bu

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 06:55 PM, Stefan Beller wrote: > [...] > I have just reread the scoring function and I think you could pull out the > `score=indent` assignment (it is always assigned except for indent <0) > > if (indent == -1) >score = 0; > else >score

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 09:52 PM, Junio C Hamano wrote: > Michael Haggerty writes: >> +#define START_OF_FILE_BONUS 9 >> +#define END_OF_FILE_BONUS 46 >> +#define TOTAL_BLANK_WEIGHT 4 >> +#define PRE_BLANK_WEIGHT 16 >> +#define RELATIVE_INDENT_BONUS -1 >> +#de

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 09:56 AM, Jeff King wrote: > On Thu, Aug 04, 2016 at 12:00:36AM +0200, Michael Haggerty wrote: > >> This table shows the number of diff slider groups that were positioned >> differently than the human-generated values, for various repositories. >> "defa

Re: [PATCH] xdiffi.c: mark some file-local symbols as static

2016-08-11 Thread Michael Haggerty
On 08/05/2016 10:57 PM, Ramsay Jones wrote: > If you need to re-roll your 'mh/diff-indent-heuristic' branch, could > you please squash this into the relevant patch (e199b6e2, "diff: improve > positioning of add/delete blocks in diffs", 04-08-2016). Will do. Thanks, Ramsay! Michael -- To unsubsc

Re: Forward declaration of enum iterator_selection?

2016-08-10 Thread Michael Haggerty
On 08/08/2016 06:30 PM, Johannes Sixt wrote: > Am 07.08.2016 um 22:34 schrieb Ramsay Jones: >> [...] I would rather the 'enum iterator_selection' be defined >> before this declaration. One solution could be to #include "iterator.h" >> prior to _all_ #include "refs/refs-internal.h" in all compilatio

Re: [PATCH 5/8] xdl_change_compact(): fix compaction heuristic to adjust io

2016-08-10 Thread Michael Haggerty
On 08/04/2016 09:27 AM, Jeff King wrote: > On Thu, Aug 04, 2016 at 12:00:33AM +0200, Michael Haggerty wrote: > >> The code branch used for the compaction heuristic incorrectly forgot to >> keep io in sync while the group was shifted. I think that could have >> led to rea

Re: [PATCH 5/8] xdl_change_compact(): fix compaction heuristic to adjust io

2016-08-10 Thread Michael Haggerty
On 08/04/2016 08:43 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> The code branch used for the compaction heuristic incorrectly forgot to >> keep io in sync while the group was shifted. I think that could have >> led to reading past the end of the rchgo array

<    3   4   5   6   7   8   9   10   11   12   >