Re: [PATCH v3 02/44] refs: make repack_without_refs and is_branch public

2015-10-13 Thread Michael Haggerty
On 10/13/2015 04:39 AM, Michael Haggerty wrote: > On 10/12/2015 11:51 PM, David Turner wrote: >> is_branch was already non-static, but this patch declares it in the >> header. >> >> Signed-off-by: Ronnie Sahlberg >> Signed-off-by: David Turner >> --- >> [...] > > It seems odd that repack_without

Re: [PATCH] Add fetch.recurseSubmoduleParallelism config option

2015-10-13 Thread Junio C Hamano
Stefan Beller writes: >> The parallel_process API could learn a new "verbose" feature that it >> by itself shows some messages like >> >> "processing the 'frotz' job with N tasks" >> "M tasks finished (N still running)" > > I know what to fill in for M and N, 'frotz' is a bit unclear to m

Re: [PATCH v3 25/44] refs.h: document make refname_is_safe and add it to header

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > This function might be used by other refs backends > > Signed-off-by: David Turner > --- > refs.h | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/refs.h b/refs.h > index fc8a748..7a936e2 100644 > --- a/refs.h > +++ b/refs.h > @

Re: Solaris: Fail to build git with CFLAGS=-m64

2015-10-13 Thread Junio C Hamano
evgeny litvinenko writes: > Solaris has the following prototype in the file /usr/include/arpa/inet.h: > > extern const char *inet_ntop(int, const void *_RESTRICT_KYWD, char > *_RESTRICT_KYWD, socklen_t); > > Git's prototype for inet_ntop is in file git-compat-util.h: > > #ifdef NO_INET_NTOP > con

Re: [PATCH v3 20/44] refs-be-files.c: add methods for misc ref operations

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > From: Ronnie Sahlberg > > Add ref backend methods for: > resolve_ref_unsafe, verify_refname_available, pack_refs, peel_ref, > create_symref, resolve_gitlink_ref. > > Signed-off-by: Ronnie Sahlberg > Signed-off-by: David Turner > --- > builtin/init

Re: [PATCH v3 19/44] refs-be-files.c: add a backend method structure with transaction functions

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > From: Ronnie Sahlberg > > Add a ref structure for backend methods. Start by adding a method pointer > for the transaction commit function. > > Add a function set_refs_backend to switch between backends. The files > based backend is the default. > >

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Francois-Xavier Le Bail
On 12/10/2015 22:21, Matthieu Moy wrote: > Francois-Xavier Le Bail writes: > >> Hello, >> >> [I try some search engines without success, perhaps I have missed something]. >> >> For example, if I rebase the following commits, I would want that if >> the commit hash 222... become 777...,

Re: [PATCH v3 25/44] refs.h: document make refname_is_safe and add it to header

2015-10-13 Thread Michael Haggerty
On 10/13/2015 09:33 AM, Michael Haggerty wrote: > On 10/12/2015 11:51 PM, David Turner wrote: >> This function might be used by other refs backends >> >> Signed-off-by: David Turner >> --- >> refs.h | 11 +++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/refs.h b/refs.h >> index

Re: [PATCH v3 26/44] refs.c: move copy_msg to the common code

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > Rename copy_msg to copy_reflog_msg and make it public. > > Signed-off-by: David Turner > --- > refs-be-files.c | 28 +--- > refs.c | 26 ++ > refs.h | 2 ++ > 3 files changed, 29 inse

Re: [PATCH v3 27/44] refs.c: move peel_object to the common code

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > This function does not contain any backend specific code so we > move it to the common code. > > Signed-off-by: David Turner > --- > refs-be-files.c | 53 - > refs.c | 31 ++

Re: [PATCH v3 37/44] refs: break out a ref conflict check

2015-10-13 Thread Michael Haggerty
On 10/12/2015 11:51 PM, David Turner wrote: > Create new function verify_no_descendants, to hold one of the ref > conflict checks used in verify_refname_available. Multiple backends > will need this function, so it goes in the common code. > > Signed-off-by: David Turner > --- > refs-be-files.c

Re: [PATCH v3 1/3] Add Travis CI support

2015-10-13 Thread Jean-Noël Avila
Le 11/10/2015 19:55, larsxschnei...@gmail.com a écrit : > + > +before_script: make > + > +script: make --quiet test Travis can be used in container mode but that would need getting rid of "sudo" command and only installing from white-listed sources (https://github.com/travis-ci/apt-source-whitelis

Re: [PATCH v3 18/44] refs: move transaction functions into common code

2015-10-13 Thread Michael Haggerty
I reviewed the patches up to here pretty carefully, and aside from the comments I already sent, they look good. I like the new approach where the ref_transaction-building code is shared across backends. It seems to me that a good breaking point for the first batch of patches would be here, just b

Re: [PATCH v3 01/13] refs: convert some internal functions to use object_id

2015-10-13 Thread Michael Haggerty
On 10/09/2015 03:43 AM, brian m. carlson wrote: > Convert several internal functions in refs.c to use struct object_id, > and use the GIT_SHA1_HEXSZ constants in parse_ref_line. > > Signed-off-by: brian m. carlson > [...] I looked over this patch at the diff level and didn't find any problems.

Re: [PATCH 0/2] Reinstate the helpful message when `git pull --rebase` fails

2015-10-13 Thread Johannes Schindelin
Hi Junio, On 2015-10-12 22:28, Junio C Hamano wrote: > Johannes Schindelin writes: > >>> I think the most sensible regression fix as the first step at this >>> point is to call it as a separate process, just like the code calls >>> "apply" as a separate process for each patch. Optimization can

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Konstantin Khomoutov
On Tue, 13 Oct 2015 10:50:40 +0200 Francois-Xavier Le Bail wrote: > >> For example, if I rebase the following commits, I would want that > >> if the commit hash 222... become 777..., > >> the message > >> "Update test output for " > >> become > >> "

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Philip Oakley
From: "Konstantin Khomoutov" On Tue, 13 Oct 2015 10:50:40 +0200 Francois-Xavier Le Bail wrote: >> For example, if I rebase the following commits, I would want that >> if the commit hash 222... become 777..., >> the message >> "Update test output for 222

[Suggestion] add alt texts to the images of the git book

2015-10-13 Thread Lucas Radaelli
Hey there, the book at https://git-scm.com/book/en/v2 (which is awesome btw, thanks for that!), contains a lot of images that are inaccessible to me because I am visually impaired. Not sure if they are really really important, but in some cases it was a little bit complicated to follow some

Re: [Suggestion] add alt texts to the images of the git book

2015-10-13 Thread Johannes Schindelin
Hi Lucas, On 2015-10-13 15:53, Lucas Radaelli wrote: > the book at https://git-scm.com/book/en/v2 (which is awesome btw, > thanks for that!), contains a lot of images that are inaccessible to > me because I am visually impaired. Not sure if they are really really > important, but in some cases

Re: [PATCH] Add fetch.recurseSubmoduleParallelism config option

2015-10-13 Thread Stefan Beller
On Tue, Oct 13, 2015 at 12:32 AM, Junio C Hamano wrote: > Stefan Beller writes: > >>> The parallel_process API could learn a new "verbose" feature that it >>> by itself shows some messages like >>> >>> "processing the 'frotz' job with N tasks" >>> "M tasks finished (N still running)" >> >

[PATCH 1/1] send-email: allow to compose only prepared cover letter

2015-10-13 Thread Andy Shevchenko
Since @rev_list_opts contains everything that goes to the git format-patch including an additional option like '--cover-letter' we might be interested to compose it before send. My often use case is to do: % git format-patch --cover-letter --subject-prefix="PATCH vN" rev1^..revXYZ

Re: [PATCH v2 09/10] branch: use ref-filter printing APIs

2015-10-13 Thread Junio C Hamano
Karthik Nayak writes: > Port branch.c to use ref-filter APIs for printing. This clears out > most of the code used in branch.c for printing and replaces them with > calls made to the ref-filter library. > > Introduce get_format() which gets the format required for printing of > refs. Make amendme

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Jacob Keller
On Tue, Oct 13, 2015 at 6:29 AM, Philip Oakley wrote: > My tuppence is that the only sha1's that could/would be rewritten would be > those for the commits within the rebase. During rebasing it is expected that > the user is re-adjusting things for later upstream consumption, with social > controls

Re: [PATCH v2 09/10] branch: use ref-filter printing APIs

2015-10-13 Thread Karthik Nayak
On Tue, Oct 13, 2015 at 10:01 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> Port branch.c to use ref-filter APIs for printing. This clears out >> most of the code used in branch.c for printing and replaces them with >> calls made to the ref-filter library. >> >> Introduce get_format() wh

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Mike Rappazzo
On Tue, Oct 13, 2015 at 1:07 PM, Jacob Keller wrote: > On Tue, Oct 13, 2015 at 6:29 AM, Philip Oakley wrote: >> My tuppence is that the only sha1's that could/would be rewritten would be >> those for the commits within the rebase. During rebasing it is expected that >> the user is re-adjusting th

Re: [PATCH v2 08/10] ref-filter: add support for %(upstream:track,nobracket)

2015-10-13 Thread Karthik Nayak
On Thu, Oct 8, 2015 at 2:48 PM, Karthik Nayak wrote: > Add support for %(upstream:track,nobracket) which will print the > tracking information without the brackets (i.e. "ahead N, behind M"). > > Add test and documentation for the same. > --- > Documentation/git-for-each-ref.txt | 6 -- > re

Re: [PATCH v3 19/44] refs-be-files.c: add a backend method structure with transaction functions

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 09:56 +0200, Michael Haggerty wrote: > On 10/12/2015 11:51 PM, David Turner wrote: > > From: Ronnie Sahlberg > > > > Add a ref structure for backend methods. Start by adding a method pointer > > for the transaction commit function. > > > > Add a function set_refs_backend to

Re: [PATCH v3 25/44] refs.h: document make refname_is_safe and add it to header

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 11:18 +0200, Michael Haggerty wrote: > On 10/13/2015 09:33 AM, Michael Haggerty wrote: > > On 10/12/2015 11:51 PM, David Turner wrote: > >> This function might be used by other refs backends > >> > >> Signed-off-by: David Turner > >> --- > >> refs.h | 11 +++ > >> 1

Re: [PATCH v3 37/44] refs: break out a ref conflict check

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 12:25 +0200, Michael Haggerty wrote: > On 10/12/2015 11:51 PM, David Turner wrote: > > Create new function verify_no_descendants, to hold one of the ref > > conflict checks used in verify_refname_available. Multiple backends > > will need this function, so it goes in the comm

Re: [PATCH v2 08/10] ref-filter: add support for %(upstream:track,nobracket)

2015-10-13 Thread Matthieu Moy
Karthik Nayak writes: > On Thu, Oct 8, 2015 at 2:48 PM, Karthik Nayak wrote: >> Add support for %(upstream:track,nobracket) which will print the >> tracking information without the brackets (i.e. "ahead N, behind M"). >> >> Add test and documentation for the same. >> --- >> Documentation/git-fo

Re: Solaris: Fail to build git with CFLAGS=-m64

2015-10-13 Thread evgeny litvinenko
Hi Junio, On 10/13/15, Junio C Hamano wrote: > evgeny litvinenko writes: > >> Solaris has the following prototype in the file /usr/include/arpa/inet.h: >> >> extern const char *inet_ntop(int, const void *_RESTRICT_KYWD, char >> *_RESTRICT_KYWD, socklen_t); >> >> Git's prototype for inet_ntop is

Re: [PATCH v2 08/10] ref-filter: add support for %(upstream:track,nobracket)

2015-10-13 Thread Junio C Hamano
Matthieu Moy writes: >> If you see here, we detect "track" first for >> %(upstream:track,nobracket) > > Yes, but I still think that this was a bad idea. If you want > nobracket to apply to "track", then the syntax should be > %(upstream:track=nobracket). I think the "nobracket" should apply > to

Re: [PATCH v2] merge: fix cache_entry use-after-free

2015-10-13 Thread David Turner
On Mon, 2015-10-12 at 15:28 -0700, Junio C Hamano wrote: > David Turner writes: > > > From: Keith McGuigan > > > > During merges, we would previously free entries that we no longer need > > in the destination index. But those entries might also be stored in > > the dir_entry cache, and when a l

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Philip Oakley
From: "Mike Rappazzo" On Tue, Oct 13, 2015 at 1:07 PM, Jacob Keller wrote: On Tue, Oct 13, 2015 at 6:29 AM, Philip Oakley wrote: My tuppence is that the only sha1's that could/would be rewritten would be those for the commits within the rebase. During rebasing it is expected that the user i

Re: [PATCH v3 05/44] refs.c: move update_ref to refs.c

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 05:41 +0200, Michael Haggerty wrote: > If its removal was intentional, it deserves a careful explanation (and > should probably be done as a separate commit). If it was an accident, > please consider how this accident arose and try to think about whether > similar accidents m

Re: [PATCH v2] merge: fix cache_entry use-after-free

2015-10-13 Thread Junio C Hamano
David Turner writes: >> This one smelled iffy. I think it is safe because the caller does >> not look at src[] other than src[0] after this function returns, and >> this setting to NULL happens only when o->merge is set to 1, so I do >> not think this is buggy, but at the same time I do not thin

Re: [PATCH] Add fetch.recurseSubmoduleParallelism config option

2015-10-13 Thread Junio C Hamano
Stefan Beller writes: > Assuming we go with your second school of thought (N are the real > running processes, M including the finished but still pending output tasks), That's neither of my two, I would think. Anyway, I think it is now clear that it not very easy to say "I know what to fill in

Re: [PATCH 1/1] send-email: allow to compose only prepared cover letter

2015-10-13 Thread Junio C Hamano
Andy Shevchenko writes: > My often use case is to do: > % git format-patch --cover-letter --subject-prefix="PATCH vN" > rev1^..revXYZ > % $GIT_EDITOR -* > % git send-email 00* # assumes series less than 100 patches > % rm -f 00* I guess this patch would not hurt too

Re: [PATCH v3 19/44] refs-be-files.c: add a backend method structure with transaction functions

2015-10-13 Thread Michael Haggerty
On 10/13/2015 08:28 PM, David Turner wrote: > On Tue, 2015-10-13 at 09:56 +0200, Michael Haggerty wrote: >> On 10/12/2015 11:51 PM, David Turner wrote: >>> [...] >>> +extern struct ref_be refs_be_files; >> >> I don't think that refs_be_files is needed in the public interface. > > We use refs_be_lm

Re: [PATCH v3 02/44] refs: make repack_without_refs and is_branch public

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 09:23 +0200, Michael Haggerty wrote: > On 10/13/2015 04:39 AM, Michael Haggerty wrote: > > On 10/12/2015 11:51 PM, David Turner wrote: > >> is_branch was already non-static, but this patch declares it in the > >> header. > >> > >> Signed-off-by: Ronnie Sahlberg > >> Signed-of

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Jacob Keller
On Tue, Oct 13, 2015 at 12:24 PM, Philip Oakley wrote: > IIUC (as an alternate example), in G4W one can submit a (long) pull request > with internal back references that would be merged directly, so the sha1's > could be updated as Francois-Xavier originally asked. I have a series that's > been b

Re: [PATCH v3 18/44] refs: move transaction functions into common code

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 13:29 +0200, Michael Haggerty wrote: > I reviewed the patches up to here pretty carefully, and aside from the > comments I already sent, they look good. > > I like the new approach where the ref_transaction-building code is > shared across backends. > > It seems to me that a

bug report: `git stash save -u` deletes directory whose contents are .gitignored

2015-10-13 Thread lennart spitzner
hi, - `git stash save -u` deletes a directory, even though the _contents_ of that directory are .gitignored (e.g. "foo/*" in .gitignore). Detailed reproduction below. - The behaviour is not present when instead .gitignoring the directory itself (e.g. "foo"). This does imo not excuse the behaviour

Re: [PATCH v3 18/44] refs: move transaction functions into common code

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 18:21 -0400, David Turner wrote: > On Tue, 2015-10-13 at 13:29 +0200, Michael Haggerty wrote: > > I reviewed the patches up to here pretty carefully, and aside from the > > comments I already sent, they look good. > > > > I like the new approach where the ref_transaction-buil

Re: How to rebase when some commit hashes are in some commit messages

2015-10-13 Thread Philip Oakley
From: "Jacob Keller" On Tue, Oct 13, 2015 at 12:24 PM, Philip Oakley wrote: IIUC (as an alternate example), in G4W one can submit a (long) pull request with internal back references that would be merged directly, so the sha1's could be updated as Francois-Xavier originally asked. I have a ser

[PATCH 00/26] mailinfo libification

2015-10-13 Thread Junio C Hamano
So here is an attempt to libify "git mailinfo" so that the built-in version of "git am" does not have to run it via run_command() interface. "git am", when fed an N-patch series, runs one "mailsplit", N "mailinfo" and N "apply" all via run_command() interface (plus 2 more "apply" and 1 "merge-recu

[PATCH 10/26] mailinfo: move global "FILE *fin, *fout" to struct mailinfo

2015-10-13 Thread Junio C Hamano
This requires us to pass "struct mailinfo" to more functions throughout the codepath that read input lines, which makes later steps easier. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 54 -- 1 file changed, 28 insertions(+), 26 delet

[PATCH 01/26] mailinfo: remove a no-op call convert_to_utf8(it, "")

2015-10-13 Thread Junio C Hamano
The called function checks if the second parameter is either a NULL or an empty string at the very beginning and returns without doing anything. Remove the useless call. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 5 - 1 file changed, 5 deletions(-) diff --git a/builtin/mailinfo

[PATCH 06/26] mailinfo: always pass "line" as an argument

2015-10-13 Thread Junio C Hamano
Some functions in this module accessed the global "struct strbuf line" while many others used a strbuf passed as an argument. Convert the former to ensure that nobody deeper in the callchains relies on the global one. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 48

[PATCH 02/26] mailinfo: fix for off-by-one error in boundary stack

2015-10-13 Thread Junio C Hamano
We pre-increment the pointer that we will use to store something at, so the pointer is already beyond the end of the array if it points at content[MAX_BOUNDARIES]. Signed-off-by: Junio C Hamano --- As always, I am very bad at checking and fixing off-by-one errors. A few extra sets of eyeballs

[PATCH 14/26] mailinfo: move use_scissors and use_inbody_headers to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 35e1ab9..5302c03 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -20,6 +20,8 @@ struct maili

[PATCH 13/26] mailinfo: move add_message_id and message_id to struct mailinfo

2015-10-13 Thread Junio C Hamano
This requires us to pass the structure into check_header() codepath. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 163032e..35e1ab9 100644 ---

[PATCH 11/26] mailinfo: move filter/header stage to struct mailinfo

2015-10-13 Thread Junio C Hamano
Earlier we got rid of two function-scope static variables that kept track of the states of helper functions by making them extra arguments that are passed throughout the callchain. Now we have a convenient place to store and pass them around in the form of "struct mailinfo", change them into two f

[PATCH 24/26] mailinfo: handle charset conversion errors in the caller

2015-10-13 Thread Junio C Hamano
Instead of dying in convert_to_utf8(), just report an error and let the callers handle it. Between the two callers: - decode_header() knows how to handle malformed line by reporting the breakage to the caller, so let it follow the pattern it already knows about; - handle_commit_msg() doe

[PATCH 12/26] mailinfo: move patch_lines to struct mailinfo

2015-10-13 Thread Junio C Hamano
This one is trivial thanks to previous steps that started passing the structure throughout the input codepaths. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 7e3976

[PATCH 15/26] mailinfo: move metainfo_charset to struct mailinfo

2015-10-13 Thread Junio C Hamano
This requires us to pass the struct down to decode_header() and convert_to_utf8() callchain. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 40 +++- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c

[PATCH 25/26] mailinfo: remove calls to exit() and die() deep in the callchain

2015-10-13 Thread Junio C Hamano
The top-level mailinfo() would instead punt when the code in the deeper part of the callchain detects an unrecoverable error in the input. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git

[PATCH 18/26] mailinfo: handle_commit_msg() shouldn't be called after finding patchbreak

2015-10-13 Thread Junio C Hamano
There is a strange "if (!cmitmsg) return 0" at the very beginning of handle_commit_msg(), but the condition should never trigger, because: * The only place cmitmsg is set to NULL is after this function sees a patch break, closes the FILE * to write the commit log message and returns 1. Thi

[PATCH 21/26] mailinfo: keep the parsed log message in a strbuf

2015-10-13 Thread Junio C Hamano
When mailinfo() is eventually libified, the calling "git am" still will have to write out the log message in the "msg" file for hooks and other users of the information, but at least it does not have to reopen and reread what was written back if the function kept it in a strbuf so that the caller c

[PATCH 03/26] mailinfo: fold decode_header_bq() into decode_header()

2015-10-13 Thread Junio C Hamano
In olden days we might have wanted to behave differently in decode_header() if the header line was encoded with RFC2047, but we apparently do not do so, hence this helper function can go, together with its return value. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 23 +++---

[PATCH 16/26] mailinfo: move transfer_encoding to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 7e01efa..fbfa27e 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -23,14 +23,14 @@ struct

[PATCH 17/26] mailinfo: move charset to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index fbfa27e..a51b2c5 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -22,6 +22,7 @@ struct mailinfo {

[PATCH 22/26] mailinfo: move content/content_top to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 45 ++--- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index d38d716..4b9b1cc 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -7,6

[PATCH 19/26] mailinfo: move cmitmsg and patchfile to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index 256d04a..b591a2f 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -7,11 +7,11 @@ #inclu

[PATCH 23/26] mailinfo: handle errors found in decode_header() better

2015-10-13 Thread Junio C Hamano
The decode_header() function tries to unwrap RFC2047-style quoted strings but punts when it finds anything it cannot parse. Allow the function to report if it punted to the caller, and use the resulting string in the caller only when the function says it parsed the input successfully. Signed-off-

[PATCH 09/26] mailinfo: move keep_subject & keep_non_patch_bracket to struct mailinfo

2015-10-13 Thread Junio C Hamano
These two are the only easy ones that do not require passing the structure around to deep corners of the callchain. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c in

[PATCH 04/26] mailinfo: move handle_boundary() lower

2015-10-13 Thread Junio C Hamano
This function wants to call find_boundary() and is called only from one place without any recursing, so it becomes easier to read if it appears after the called function. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 114 ++--- 1 file chan

[PATCH 26/26] mailinfo: libify the whole thing

2015-10-13 Thread Junio C Hamano
With this, the builtin "git am" can hopefully make an internal call to the mailinfo() function without going through the run_command() interface, whose overhead is heavyweight compared to what mailinfo() itself does on some platforms. Signed-off-by: Junio C Hamano --- Makefile |1 +

[PATCH 07/26] mailinfo: move global "line" into mailinfo() function

2015-10-13 Thread Junio C Hamano
The mailinfo() function is the only one that wants the "line_global" to be directly touchable. Note that handle_body() has to be passed this strbuf so that it sees the "first line of the input" after the loop in this function processes the headers. It feels a bit dirty that handle_body() then kee

[PATCH 08/26] mailinfo: introduce "struct mailinfo" to hold globals

2015-10-13 Thread Junio C Hamano
Initially have only 'email' and 'name' fields in there and remove the corresponding globals. In subsequent patches, more globals will be moved to this and the structure will be passed around as a new parameter to more functions. Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 61

[PATCH 05/26] mailinfo: get rid of function-local static states

2015-10-13 Thread Junio C Hamano
Two helper functions use "static int" in their scope to keep track of the state while repeatedly getting called once for each input line. Move these state variables their ultimate caller and pass down pointers to them, as a small step in preparation for making this entire callchain more reentrant.

[PATCH 20/26] mailinfo: move [ps]_hdr_data to struct mailinfo

2015-10-13 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/mailinfo.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index b591a2f..c9629c8 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -30,10 +30,10 @@ struc

[BUG] Broken links in Git Documentation/user-manual.txt

2015-10-13 Thread Xue Fuqiao
Hi list, In https://git-scm.com/docs/user-manual.html , all links to the glossary[1] are broken. I'm aware of a recent bug report about broken links ($gmane/279048/), but that one seems unrelated to what I'm reporting. [1] For example: https://git-scm.com/docs/user-manual.html#def_head -- To uns

Re: [PATCH v3 05/44] refs.c: move update_ref to refs.c

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 05:41 +0200, Michael Haggerty wrote: > The original read > > if (read_ref(pseudoref, actual_old_sha1)) > die("could not read ref '%s'", pseudoref); > > This seems like an important test. What happened to it? > > If its removal was intent

[PATCH 27/26] mailinfo: close patchfile

2015-10-13 Thread Junio C Hamano
"git mailinfo" itself did not need this, as open file handles are flushed and closed upon process exit, but the libified version needs to clean up after itself when it is done. Signed-off-by: Junio C Hamano --- mailinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailin

[PATCH 28/26] am: make direct call to mailinfo

2015-10-13 Thread Junio C Hamano
And finally the endgame. Instead of spawning "git mailinfo" via the run_command() API the same number of times as there are incoming patches, make direct internal call to the libified mailinfo() from "git am" to reduce the spawning overhead, which would matter on some platforms. Signed-off-by: Ju

Re: [PATCH v3 01/13] refs: convert some internal functions to use object_id

2015-10-13 Thread brian m. carlson
On Tue, Oct 13, 2015 at 01:43:30PM +0200, Michael Haggerty wrote: > On 10/09/2015 03:43 AM, brian m. carlson wrote: > > Convert several internal functions in refs.c to use struct object_id, > > and use the GIT_SHA1_HEXSZ constants in parse_ref_line. > > > > Signed-off-by: brian m. carlson > > [..

Re: [PATCH v2 08/10] ref-filter: add support for %(upstream:track,nobracket)

2015-10-13 Thread Karthik Nayak
Wed, Oct 14, 2015 at 12:24 AM, Matthieu Moy wrote: > Yes, but I still think that this was a bad idea. If you want nobracket > to apply to "track", then the syntax should be > %(upstream:track=nobracket). I think the "nobracket" should apply to > "upstream" (i.e. be global to the atom), hence > %(