Fwd: Discovering the new parents in commit hooks

2019-07-05 Thread scott douglass
Hi, I’d like to be able to discover the new parents-to-be SHA-1s during the hooks that run before a commit*. Essentially I’d like be able to distinguish the ‘git commit’ case from ‘git commit —amend’. Is there already a way to do this that I have overlooked? (I’ve read ‘man githooks’ and searched

Re: Virtual Git Contributor Summit

2019-07-05 Thread Johannes Schindelin
Hi Jakub, On Fri, 5 Jul 2019, Jakub Narebski wrote: > Johannes Schindelin writes: > > > I kept talking about this idea of a purely online Git Contributor > > Summit, and it is finally time for action. > > > > The idea: just like the Git Contributor Summits we have on the day > > before GitMerge,

[PATCH v1] merge - rename a shadowed variable in cmd_merge

2019-07-05 Thread Edmundo Carmona Antoranz
variable ret used in cmd_merge introduced in d5a35c114ab was already a local variable used inside a for loop inside the function. for-local variable is being renamed to ret_try_merge to avoid shadow. --- builtin/merge.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

Re: [PATCH v2 00/14] output improvements for git range-diff

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > It's been quite a while since I sent the RFC [1] (thanks all for the > comments on that), and the series changed shapes quite a bit since the > last round. > > Since it's been such a long time, just to remind everyone, the goal of > this ser

Re: [PATCH v2 12/14] range-diff: add section header instead of diff header

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > Currently range-diff keeps the diff header of the inner diff > intact (apart from stripping lines starting with index). This diff > header is somewhat useful, especially when files get different > names in different ranges. > > However ther

Re: [PATCH v2 10/14] range-diff: don't remove funcname from inner diff

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > When postprocessing the inner diff in range-diff, we currently replace > the whole hunk header line with just "@@". This matches how 'git > tbdiff' used to handle hunk headers as well. Right, that's why I did it this way: `tbdiff` did it.

Re: [PATCH v2 09/14] range-diff: split lines manually

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > Currently range-diff uses the 'strbuf_getline()' function for doing > its line by line processing. In a future patch we want to do parts of > that parsing using the 'parse_git_header()' function, which does If you like my suggestion in pa

Re: Handling text files encoded in little-endian UTF-16 with BOM

2019-07-05 Thread Mateusz Loskot
On Fri, 5 Jul 2019 at 18:25, Torsten Bögershausen wrote: > On Fri, Jul 05, 2019 at 01:35:13PM +0200, Mateusz Loskot wrote: > > > > Using git version 2.22.0.windows.1 > > > > I have a repository with number of .txt files encoded in > > little-endian UTF-16 with BOM. > > > > What are the best practi

Re: [PATCH v2 06/14] apply: only pass required data to gitdiff_* functions

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > Currently the 'gitdiff_*()' functions take 'struct apply_state' as > parameter, even though they only needs the root, linenr and p_value > from that struct. > > These functions are in the callchain of 'parse_git_header()', which we > want to

Re: [PATCH v2 07/14] apply: make parse_git_header public

2019-07-05 Thread Johannes Schindelin
Hi Thomas, On Fri, 5 Jul 2019, Thomas Gummerer wrote: > Make parse_git_header a "public" function in apply.h, so we can re-use > it in range-diff in a subsequent commit. This function probably wants a different name when it becomes public, as it was relatively obvious inside `apply.c` that it wa

Re: mt/dir-iterator-updates, was Re: What's cooking in git.git (Jul 2019, #01; Wed, 3)

2019-07-05 Thread Johannes Schindelin
Hi Matheus, On Fri, 5 Jul 2019, Matheus Tavares Bernardino wrote: > On Thu, Jul 4, 2019 at 6:30 PM Johannes Schindelin > wrote: > > > > Hi Matheus, > > > > On Thu, 4 Jul 2019, Matheus Tavares Bernardino wrote: > > > > > > I wanted to take a look at the failures to see if I could help, [...] > >

Hi

2019-07-05 Thread bantiepcongdan_tpbg
I need your help

[PATCH v2 10/14] range-diff: don't remove funcname from inner diff

2019-07-05 Thread Thomas Gummerer
When postprocessing the inner diff in range-diff, we currently replace the whole hunk header line with just "@@". This matches how 'git tbdiff' used to handle hunk headers as well. Most likely this is being done because line numbers in the hunk header are not relevant without other changes. They

[PATCH v2 03/14] apply: only pass required data to git_header_name

2019-07-05 Thread Thomas Gummerer
Currently the 'git_header_name()' function takes 'struct apply_state' as parameter, even though it only needs the p_value from that struct. This function is in the callchain of 'parse_git_header()', which we want to make more generally useful in a subsequent commit. To make that happen we only wa

[PATCH v2 05/14] apply: only pass required data to find_name_*

2019-07-05 Thread Thomas Gummerer
Currently the 'find_name_*()' functions take 'struct apply_state' as parameter, even though they only need the 'root' member from that struct. These functions are in the callchain of 'parse_git_header()', which we want to make more generally useful in a subsequent commit. To make that happen we o

[PATCH v2 04/14] apply: only pass required data to check_header_line

2019-07-05 Thread Thomas Gummerer
Currently the 'check_header_line()' function takes 'struct apply_state' as parameter, even though it only needs the linenr from that struct. This function is in the callchain of 'parse_git_header()', which we want to make more generally useful in a subsequent commit. To make that happen we only w

[PATCH v2 14/14] range-diff: add headers to the outer hunk header

2019-07-05 Thread Thomas Gummerer
Add the section headers/hunk headers we introduced in the previous commits to the outer diff's hunk headers. This makes it easier to understand which change we are actually looking at. For example an outer hunk header might now look like: @@ Documentation/config/interactive.txt while previ

[PATCH v2 01/14] apply: replace marc.info link with public-inbox

2019-07-05 Thread Thomas Gummerer
public-inbox.org links include the whole message ID by default. This means the message can still be found even if the site goes away, which is not the case with the marc.info link. Replace the marc.info link with a more future proof one. Signed-off-by: Thomas Gummerer --- apply.c | 2 +- 1 fil

[PATCH v2 08/14] range-diff: fix function parameter indentation

2019-07-05 Thread Thomas Gummerer
Fix the indentation of the function parameters for a couple of functions, to match the style in the rest of the file. Signed-off-by: Thomas Gummerer --- range-diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/range-diff.c b/range-diff.c index 48b0e1b4ce..9242b8975f 1

[PATCH v2 09/14] range-diff: split lines manually

2019-07-05 Thread Thomas Gummerer
Currently range-diff uses the 'strbuf_getline()' function for doing its line by line processing. In a future patch we want to do parts of that parsing using the 'parse_git_header()' function, which does requires reading parts of the input from that function, which doesn't use strbufs. Switch rang

[PATCH v2 02/14] apply: only pass required data to skip_tree_prefix

2019-07-05 Thread Thomas Gummerer
Currently the 'skip_tree_prefix()' function takes 'struct apply_state' as parameter, even though it only needs the p_value from that struct. This function is in the callchain of 'parse_git_header()', which we want to make more generally useful in a subsequent commit. To make that happen we only w

[PATCH v2 00/14] output improvements for git range-diff

2019-07-05 Thread Thomas Gummerer
It's been quite a while since I sent the RFC [1] (thanks all for the comments on that), and the series changed shapes quite a bit since the last round. Since it's been such a long time, just to remind everyone, the goal of this series is to make the range-diff output clearer, by showing informatio

[PATCH v2 12/14] range-diff: add section header instead of diff header

2019-07-05 Thread Thomas Gummerer
Currently range-diff keeps the diff header of the inner diff intact (apart from stripping lines starting with index). This diff header is somewhat useful, especially when files get different names in different ranges. However there is no real need to keep the whole diff header for that. The main

[PATCH v2 06/14] apply: only pass required data to gitdiff_* functions

2019-07-05 Thread Thomas Gummerer
Currently the 'gitdiff_*()' functions take 'struct apply_state' as parameter, even though they only needs the root, linenr and p_value from that struct. These functions are in the callchain of 'parse_git_header()', which we want to make more generally useful in a subsequent commit. To make that h

[PATCH v2 13/14] range-diff: add filename to inner diff

2019-07-05 Thread Thomas Gummerer
In a range-diff it's not always clear which file a certain funcname of the inner diff belongs to, because the diff header (or section header as added in a previous commit) is not always visible in the range-diff. Add the filename to the inner diffs header, so it's always visible to users. This al

[PATCH v2 07/14] apply: make parse_git_header public

2019-07-05 Thread Thomas Gummerer
Make parse_git_header a "public" function in apply.h, so we can re-use it in range-diff in a subsequent commit. Signed-off-by: Thomas Gummerer --- I considered creating a separate struct for only the metadata here, and embedding that in 'struct patch'. As struct patch is mostly metadata fields

[PATCH v2 11/14] range-diff: suppress line count in outer diff

2019-07-05 Thread Thomas Gummerer
The line count in the outer diff's hunk headers of a range diff is not all that interesting. It merely shows how far along the inner diff are on both sides. That number is of no use for human readers, and range-diffs are not meant to be machine readable. In a subsequent commit we're going to add

Re: [RFC/PATCH v1] merge - make squash a 1-step operation

2019-07-05 Thread Edmundo Carmona Antoranz
On Fri, Jul 5, 2019 at 10:56 AM Edmundo Carmona Antoranz wrote: > > --- > builtin/merge.c | 63 + > 1 file changed, 32 insertions(+), 31 deletions(-) > This would be a first step in order to achieve the dream of having rebase/squash in a single ste

[RFC/PATCH v1] merge - make squash a 1-step operation

2019-07-05 Thread Edmundo Carmona Antoranz
--- builtin/merge.c | 63 + 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index 6e99aead46..d5745a7888 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -64,6 +64,7 @@ static int option_edit = -

Re: Handling text files encoded in little-endian UTF-16 with BOM

2019-07-05 Thread Torsten Bögershausen
On Fri, Jul 05, 2019 at 01:35:13PM +0200, Mateusz Loskot wrote: > Hi, > > Using git version 2.22.0.windows.1 > > I have a repository with number of .txt files encoded in > little-endian UTF-16 with BOM. > > What are the best practice and recommended configuration to > manage such files with Git to

Re: mt/dir-iterator-updates, was Re: What's cooking in git.git (Jul 2019, #01; Wed, 3)

2019-07-05 Thread Matheus Tavares Bernardino
On Thu, Jul 4, 2019 at 6:30 PM Johannes Schindelin wrote: > > Hi Matheus, > > On Thu, 4 Jul 2019, Matheus Tavares Bernardino wrote: > > > > I wanted to take a look at the failures to see if I could help, [...] > > Could you point me to the right place, please? [...] > > I usually click on the "Tes

Re: Virtual Git Contributor Summit

2019-07-05 Thread Philip Oakley
Hi Dscho, On 03/07/2019 14:01, Johannes Schindelin wrote: Team, I kept talking about this idea of a purely online Git Contributor Summit, and it is finally time for action. The idea: just like the Git Contributor Summits we have on the day before GitMerge, but instead of traveling to the same

Re: Virtual Git Contributor Summit

2019-07-05 Thread Jakub Narebski
Johannes Schindelin writes: > Team, > > I kept talking about this idea of a purely online Git Contributor Summit, > and it is finally time for action. > > The idea: just like the Git Contributor Summits we have on the day before > GitMerge, but instead of traveling to the same place, we'll use an

Re: Surprising use of memory and time when repacking mozilla's gecko repository

2019-07-05 Thread Mike Hommey
On Fri, Jul 05, 2019 at 02:45:16PM +0900, Mike Hommey wrote: > On Fri, Jul 05, 2019 at 01:09:55AM -0400, Jeff King wrote: > > On Thu, Jul 04, 2019 at 07:05:30PM +0900, Mike Hommey wrote: > > > Finally, with 1 thread, the picture changes greatly. The overall process > > > takes 2.5h: > > > - 50 seco

Handling text files encoded in little-endian UTF-16 with BOM

2019-07-05 Thread Mateusz Loskot
Hi, Using git version 2.22.0.windows.1 I have a repository with number of .txt files encoded in little-endian UTF-16 with BOM. What are the best practice and recommended configuration to manage such files with Git to avoid unexpected re-encoding to UTF-8 or others? Currently, there is .gitattri

Re: Surprising use of memory and time when repacking mozilla's gecko repository

2019-07-05 Thread Jakub Narebski
Mike Hommey writes: > On Fri, Jul 05, 2019 at 01:14:13AM -0400, Jeff King wrote: >> On Thu, Jul 04, 2019 at 10:13:20PM +0900, Mike Hommey wrote: [...] >> I think I explained all of the memory-usage questions in my earlier >> response, but just for reference: if you have access to it, valgrind's >