Re: [PATCH v7 0/7] convert: add support for different encodings

2018-02-24 Thread Lars Schneider
> On 23 Feb 2018, at 21:11, Junio C Hamano wrote: > > Junio C Hamano writes: > >> Lars Schneider writes: >> >>> I still think it would be nice to see diffs for arbitrary encodings. >>> Would it be an option to read the

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

2018-02-24 Thread Duy Nguyen
I notice that there are a few global state (or configuration rather) left after this: packed_git_window_size, packed_git_limit and delta_base_cache_limit. These can be changed by $GIT_DIR/config, but since it's still global, a submodule repository will use the same settings of its super

[PATCH v8 0/7] convert: add support for different encodings

2018-02-24 Thread lars . schneider
From: Lars Schneider Hi, Patches 1-4, 6 are preparation and helper functions. Patch 5,7 are the actual change. This series depends on Torsten's 8462ff43e4 (convert_to_git(): safe_crlf/checksafe becomes int conv_flags, 2018-01-13) which is already in master. Changes

[PATCH v8 1/7] strbuf: remove unnecessary NUL assignment in xstrdup_tolower()

2018-02-24 Thread lars . schneider
From: Lars Schneider Since 3733e69464 (use xmallocz to avoid size arithmetic, 2016-02-22) we allocate the buffer for the lower case string with xmallocz(). This already ensures a NUL at the end of the allocated buffer. Remove the unnecessary assignment. Signed-off-by:

[PATCH v8 6/7] convert: add tracing for 'working-tree-encoding' attribute

2018-02-24 Thread lars . schneider
From: Lars Schneider Add the GIT_TRACE_WORKING_TREE_ENCODING environment variable to enable tracing for content that is reencoded with the 'working-tree-encoding' attribute. This is useful to debug encoding issues. Signed-off-by: Lars Schneider

[PATCH v8 5/7] convert: add 'working-tree-encoding' attribute

2018-02-24 Thread lars . schneider
From: Lars Schneider Git recognizes files encoded with ASCII or one of its supersets (e.g. UTF-8 or ISO-8859-1) as text files. All other encodings are usually interpreted as binary and consequently built-in Git text processing tools (e.g. 'git diff') as well as most Git

[PATCH v8 7/7] convert: add round trip check based on 'core.checkRoundtripEncoding'

2018-02-24 Thread lars . schneider
From: Lars Schneider UTF supports lossless conversion round tripping and conversions between UTF and other encodings are mostly round trip safe as Unicode aims to be a superset of all other character encodings. However, certain encodings (e.g. SHIFT-JIS) are known to

[PATCH v8 3/7] utf8: add function to detect prohibited UTF-16/32 BOM

2018-02-24 Thread lars . schneider
From: Lars Schneider Whenever a data stream is declared to be UTF-16BE, UTF-16LE, UTF-32BE or UTF-32LE a BOM must not be used [1]. The function returns true if this is the case. This function is used in a subsequent commit. [1]

[PATCH v8 4/7] utf8: add function to detect a missing UTF-16/32 BOM

2018-02-24 Thread lars . schneider
From: Lars Schneider If the endianness is not defined in the encoding name, then let's be strict and require a BOM to avoid any encoding confusion. The is_missing_required_utf_bom() function returns true if a required BOM is missing. The Unicode standard instructs to

[PATCH v8 2/7] strbuf: add xstrdup_toupper()

2018-02-24 Thread lars . schneider
From: Lars Schneider Create a copy of an existing string and make all characters upper case. Similar xstrdup_tolower(). This function is used in a subsequent commit. Signed-off-by: Lars Schneider --- strbuf.c | 12 strbuf.h |

[PATCH] git-gui: search for all current SSH key types

2018-02-24 Thread Beat Bolli
OpenSSH has supported Ed25519 keys since version 6.4 (2014-01-30), and ECDSA keys since version 5.7 (2011-01-24). git-gui fails to find these key types in its Help/Show SSH Key dialog. Teach git-gui to show Ed25519 and ECDSA keys as well. This was originally reported in

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

2018-02-24 Thread Eric Sunshine
On Fri, Feb 23, 2018 at 6:39 PM, SZEDER Gábor wrote: > The two test checking 'git mmerge-recursive' in an empty worktree in s/mmerge/merge/, I guess. > 't3030-merge-recursive.sh' fail when the test script is run with '-x' > tracing (and using a shell other than a Bash

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

2018-02-24 Thread Eric Sunshine
On Fri, Feb 23, 2018 at 10:34 PM, Nguyễn Thái Ngọc Duy wrote: > 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

Re: [PATCH v3 06/42] completion: use __gitcomp_builtin in _git_am

2018-02-24 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 1:08 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Fri, Feb 23, 2018 at 1:19 AM, Junio C Hamano wrote: >>> Duy Nguyen writes: >>> Now that you mention it, the only command that

[PATCH v4 2/2] diff: add --stat-with-summary

2018-02-24 Thread Nguyễn Thái Ngọc Duy
Certain information is currently shown with --summary, but when used in combination with --stat it's a bit hard to read since info of the same file is in two places (--stat and --summary). On top of that, commits that add or remove files double the number of display lines, which could be a lot if

[PATCH v4 1/2] diff.c: refactor pprint_rename() to use strbuf

2018-02-24 Thread Nguyễn Thái Ngọc Duy
Instead of passing char* around, let function handle strbuf directly. All callers already use strbuf internally. This helps kill the "not free" exception in free_diffstat_info(). I don't think this code is so critical that we need to avoid some free() calls. The other benefit comes in the next

[PATCH v4 0/2] diff: add --compact-summary (aka nd/diff-stat-with-summary)

2018-02-24 Thread Nguyễn Thái Ngọc Duy
v4 renames the option back to --compact-summary. I can't think of any better name. Interdiff diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 595e4cd548..e3a44f03cd 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -128,7 +128,7

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

2018-02-24 Thread Paul-Sebastian Ungureanu
Hello, Your proposed solution makes a lot more sense. I have actually considered a solution similar to this (the third solution from [1]), but found it more complicated. I did not account for the fact that once a callback is called, the user is already aware of the available options and the user

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

2018-02-24 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 10:34 AM, Nguyễn Thái Ngọc Duy wrote: > @@ -3995,6 +3995,18 @@ static void run_diff(struct diff_filepair *p, struct > diff_options *o) > return; > } > > + /* > +* NEEDSWORK: When running in no-index mode (and no

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

2018-02-24 Thread SZEDER Gábor
On Sat, Feb 24, 2018 at 12:39 AM, SZEDER Gábor wrote: > - Duplicate stderr of the tested command executed in the test helper > function from the function's fd 7 (see next point), to ensure that > the tested command's error messages go to a different fd than the >

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

2018-02-24 Thread Duy Nguyen
On Sat, Feb 24, 2018 at 3:15 PM, Eric Sunshine wrote: > On Fri, Feb 23, 2018 at 10:34 PM, Nguyễn Thái Ngọc Duy > wrote: >> before, compared to the alternative that we simply do not hash). >> >> dòng được > > Accidental paste? Oops. I blame Emacs. --

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

2018-02-24 Thread Miguel Torroja
On Fri, Feb 23, 2018 at 6:22 PM, Luke Diamand wrote: > 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

[PATCH v5 2/2] diff: add --compact-summary

2018-02-24 Thread Nguyễn Thái Ngọc Duy
Certain information is currently shown with --summary, but when used in combination with --stat it's a bit hard to read since info of the same file is in two places (--stat and --summary). On top of that, commits that add or remove files double the number of display lines, which could be a lot if

[PATCH v5 1/2] diff.c: refactor pprint_rename() to use strbuf

2018-02-24 Thread Nguyễn Thái Ngọc Duy
Instead of passing char* around, let function handle strbuf directly. All callers already use strbuf internally. This helps kill the "not free" exception in free_diffstat_info(). I don't think this code is so critical that we need to avoid some free() calls. The other benefit comes in the next

[PATCH v5 0/2] diff: add --compact-summary (aka nd/diff-stat-with-summary)

2018-02-24 Thread Nguyễn Thái Ngọc Duy
... and v5 fixes the commit message of 2/2 where in v4 it still mentions --stat-with-summary instead of --compact-summary. Sorry. Nguyễn Thái Ngọc Duy (2): diff.c: refactor pprint_rename() to use strbuf diff: add --compact-summary Documentation/diff-options.txt| 8 ++

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

2018-02-24 Thread Ævar Arnfjörð Bjarmason
On Fri, Feb 23 2018, Junio C. Hamano jotted: > Æ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

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

2018-02-24 Thread brian m. carlson
On Sat, Feb 24, 2018 at 09:36:03PM +0700, Duy Nguyen wrote: > On Sat, Feb 24, 2018 at 10:34 AM, Nguyễn Thái Ngọc Duy > wrote: > > @@ -3995,6 +3995,18 @@ static void run_diff(struct diff_filepair *p, struct > > diff_options *o) > > return; > > } > > > >

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

2018-02-24 Thread Ævar Arnfjörð Bjarmason
On Fri, Feb 23 2018, Bernhard M. Wiedemann jotted: > 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 v2 2/5] sha1_file.c: keep a good name for "unknown" hash_algos[UNKNOWN]

2018-02-24 Thread brian m. carlson
On Sat, Feb 24, 2018 at 10:34:26AM +0700, Nguyễn Thái Ngọc Duy wrote: > 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

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

2018-02-24 Thread brian m. carlson
On Sat, Feb 24, 2018 at 10:34:27AM +0700, Nguyễn Thái Ngọc Duy wrote: > 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

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

2018-02-24 Thread brian m. carlson
On Sat, Feb 24, 2018 at 10:34:29AM +0700, Nguyễn Thái Ngọc Duy wrote: > 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

Re: [PATCH v8 5/7] convert: add 'working-tree-encoding' attribute

2018-02-24 Thread Eric Sunshine
On Sat, Feb 24, 2018 at 11:27 AM, wrote: > Git recognizes files encoded with ASCII or one of its supersets (e.g. > UTF-8 or ISO-8859-1) as text files. All other encodings are usually > interpreted as binary and consequently built-in Git text processing > tools (e.g.

Re: [PATCH v8 3/7] utf8: add function to detect prohibited UTF-16/32 BOM

2018-02-24 Thread Eric Sunshine
On Sat, Feb 24, 2018 at 11:27 AM, wrote: > Whenever a data stream is declared to be UTF-16BE, UTF-16LE, UTF-32BE > or UTF-32LE a BOM must not be used [1]. The function returns true if > this is the case. > > [1] http://unicode.org/faq/utf_bom.html#bom10 > >

Re: [PATCH] revision.c: reduce object database queries

2018-02-24 Thread Derrick Stolee
On 2/24/2018 8:34 PM, Derrick Stolee wrote: In mark_parents_uninteresting(), we check for the existence of an object file to see if we should treat a commit as parsed. The result is to set the "parsed" bit on the commit. Modify the condition to only check has_object_file() if the result would

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

2018-02-24 Thread Duy Nguyen
On Sun, Feb 25, 2018 at 5:58 AM, brian m. carlson wrote: >> diff --git a/repository.c b/repository.c >> index 4ffbe9bc94..0d715f4fdb 100644 >> --- a/repository.c >> +++ b/repository.c >> @@ -5,7 +5,7 @@ >> >> /* The main repository */ >> static struct repository

[PATCH] revision.c: reduce object database queries

2018-02-24 Thread Derrick Stolee
In mark_parents_uninteresting(), we check for the existence of an object file to see if we should treat a commit as parsed. The result is to set the "parsed" bit on the commit. Modify the condition to only check has_object_file() if the result would change the parsed bit. When a local branch is

Re: [PATCH] t/known-leaky: add list of known-leaky test scripts

2018-02-24 Thread Kaartic Sivaraam
On Wednesday 21 February 2018 02:14 AM, Martin Ågren wrote: > To sum up: I probably won't be looking into Travis-ing such a blacklist > in the near future. > Just thinking out loud, how about having a white-list instead of a black-list and using it to run only those tests in the white list.

Re: [PATCH v8 4/7] utf8: add function to detect a missing UTF-16/32 BOM

2018-02-24 Thread Eric Sunshine
On Sat, Feb 24, 2018 at 11:27 AM, wrote: > If the endianness is not defined in the encoding name, then let's > be strict and require a BOM to avoid any encoding confusion. The > is_missing_required_utf_bom() function returns true if a required BOM > is missing. > >