Re: Bug: .gitconfig folder

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 03:24:47PM -0700, Stefan Beller wrote: > What is our thinking for after-fact recovery attempts? > Like we try the mmap first, if that fails we just use open to get the > contents of > the file. And when open fails, we can still print a nice error message? For config, I thi

Re: Redirect "git" subcommand to itself?

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 06:53:26PM -0700, Junio C Hamano wrote: > > I wonder if we want to make a "git" subcommand, which behaves exactly > > the same as git itself? > > Then "git git git status" would just return the same as "git status". > > A few unrelated thoughts. > > * Perhaps we should o

Re: Redirect "git" subcommand to itself?

2015-05-27 Thread Junio C Hamano
Stefan Beller writes: > so I just run into this problem again (which happens to me maybe twice a > week): > I want to do a git operations, so I type "git " into my shell, and > then I look around what > exactly I want to do and usually I find it in the help text of a > previous command such as >

[PATCH] glossary: add "remote", "submodule", "superproject"

2015-05-27 Thread Stefan Beller
Noticed-by: Philip Oakley Helped-by: Junio C Hamano Signed-off-by: Stefan Beller --- Documentation/glossary-content.txt | 17 + 1 file changed, 17 insertions(+) diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt index bf383c2..23ab692 100644 -

Redirect "git" subcommand to itself?

2015-05-27 Thread Stefan Beller
Hi, so I just run into this problem again (which happens to me maybe twice a week): I want to do a git operations, so I type "git " into my shell, and then I look around what exactly I want to do and usually I find it in the help text of a previous command such as You are currently reverting c

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Philip Oakley
From: "Junio C Hamano" Matthieu Moy writes: I find it weird to write noop True, but then it can be spelled # too, so do we still want 'drop'? Unless we have a strong reason to believe migrants from Hg cannot be (re)trained, personally, I'd feel that we do not need this 'drop' thi

Re: [PATCH] glossary: add "remote" and "submodule"

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 4:05 PM, Junio C Hamano wrote: > Stefan Beller writes: > +[[def_submodule]]submodule:: + A <> inside another repository. The two + repositories have different history, though the outer repository + knows the commit of the inner repository. >

[PATCH] p4: Retrieve the right revision of the UTF-16 file

2015-05-27 Thread Miguel Torroja
Fixing bug with UTF-16 files when they are retrieved by git-p4. It was always getting the tip version of the file and the history of the file was lost. Signed-off-by: Miguel Torroja --- git-p4.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index c

Re: [PATCH] glossary: add "remote" and "submodule"

2015-05-27 Thread Junio C Hamano
Stefan Beller writes: >>> +[[def_submodule]]submodule:: >>> + A <> inside another repository. The two >>> + repositories have different history, though the outer repository >>> + knows the commit of the inner repository. >> > ... But correctness trumps brevity indeed. I do not think

Re: [PATCH] glossary: add "remote" and "submodule"

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 3:29 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> Noticed-by: Philip Oakley >> Signed-off-by: Stefan Beller >> --- >> Documentation/glossary-content.txt | 10 ++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/Documentation/glossary-content.txt

Re: Bug: .gitconfig folder

2015-05-27 Thread Junio C Hamano
Jeff King writes: >> -die_errno("Out of memory? mmap failed"); >> +die_errno("mmap failed"); > > This is definitely an improvement, but the real failing of that error > message is that it does not tell us that "~/.gitconfig" is the culprit. > I don't think

Re: [PATCH] glossary: add "remote" and "submodule"

2015-05-27 Thread Junio C Hamano
Stefan Beller writes: > Noticed-by: Philip Oakley > Signed-off-by: Stefan Beller > --- > Documentation/glossary-content.txt | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/Documentation/glossary-content.txt > b/Documentation/glossary-content.txt > index bf383c2..e303135 1

Re: Bug: .gitconfig folder

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 3:18 PM, Jeff King wrote: > On Wed, May 27, 2015 at 01:30:29PM -0700, Junio C Hamano wrote: > >> Jorge writes: >> >> > If you have a folder named ~/.gitconfig instead of a file with that >> > name, when you try to run some global config editing command it will >> > fail wi

Re: [PATCH 1/2] config: add options to list only variable names

2015-05-27 Thread Junio C Hamano
SZEDER Gábor writes: > diff --git a/builtin/config.c b/builtin/config.c > index 7188405..38bcf83 100644 > --- a/builtin/config.c > +++ b/builtin/config.c > @@ -13,6 +13,7 @@ static char *key; > static regex_t *key_regexp; > static regex_t *regexp; > static int show_keys; > +static int show_onl

Re: Bug: .gitconfig folder

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:30:29PM -0700, Junio C Hamano wrote: > Jorge writes: > > > If you have a folder named ~/.gitconfig instead of a file with that > > name, when you try to run some global config editing command it will > > fail with a wrong error message: > > > > "fatal: Out of memor

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:44:26PM -0700, Junio C Hamano wrote: > Paul Tan writes: > > > @@ -17,6 +34,10 @@ struct am_state { > > struct strbuf dir;/* state directory path */ > > int cur; /* current patch number */ > > int last; /*

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Junio C Hamano
Paul Tan writes: > +static const char *msgnum(const struct am_state *state) > +{ > + static struct strbuf fmt = STRBUF_INIT; > + static struct strbuf sb = STRBUF_INIT; > + > + strbuf_reset(&fmt); > + strbuf_addf(&fmt, "%%0%dd", state->prec); > + > + strbuf_reset(&sb); > +

Release candidate of Git for Windows 2.x is out

2015-05-27 Thread Johannes Schindelin
Hi all, I just uploaded release candidates for the upcoming Git for Windows 2.x release. Please find the download link here: https://git-for-windows.github.io/#download There are 32-bit and 64-bit versions both of regular installers and portable installers ("portable" meaning that they are .7z

Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file

2015-05-27 Thread Junio C Hamano
On Wed, May 27, 2015 at 3:04 PM, Luke Diamand wrote: > On 27/05/15 23:31, Miguel Torroja wrote: >> >> Fixing bug with UTF-16 files when they are retreived by git-p4. >> It was always getting the tip version of the file and the history of the >> file was lost. > > This looks sensible to me, and see

Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file

2015-05-27 Thread Luke Diamand
On 27/05/15 23:31, Miguel Torroja wrote: Fixing bug with UTF-16 files when they are retreived by git-p4. It was always getting the tip version of the file and the history of the file was lost. This looks sensible to me, and seems to work in some simple testing, thanks! Ack. Luke --- git-

Re: [PATCH/WIP 2/8] wrapper: implement xfopen()

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 09:33:32PM +0800, Paul Tan wrote: > +/** > + * xfopen() is the same as fopen(), but it die()s if the fopen() fails. > + */ > +FILE *xfopen(const char *path, const char *mode) > +{ > + FILE *fp; > + > + assert(path); > + assert(mode); > + fp = fopen(path, mod

[PATCH] Documentation: include 'merge.branchdesc' for merge and config as well

2015-05-27 Thread SZEDER Gábor
'merge.branchdesc' is only mentioned in the docs of 'git fmt-merge-msg'. The description of 'merge.log' is already duplicated between 'merge-config.txt' and 'git-fmt-merge-msg.txt'; instead of duplicating the description of another config variable, extract the descriptions of both of these variabl

Re: [PATCH/WIP 1/8] wrapper: implement xopen()

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 09:03:47PM +0200, Torsten Bögershausen wrote: > The original open can take 2 or 3 parameters, how about this: > int xopen(const char *path, int oflag, ... ) > { > va_list params; > int mode; > int fd; > > va_start(params, oflag); > m

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 1:35 PM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Junio C Hamano writes: >> >>> Matthieu Moy writes: >>> I find it weird to write noop >>> >>> True, but then it can be spelled >>> >>> # >> >> I do find it weird too. "#" means "comment", wh

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:45:55PM -0700, Stefan Beller wrote: > > Right, but I think (and please correct me if there's a case I'm > > missing) that the behavior is the same whether it is spelled > > "ping-pong" or "capability:ping-pong". That is, the rule for > > "capability:" is "if you do not u

Re: [PATCH 1/2] config: add options to list only variable names

2015-05-27 Thread SZEDER Gábor
Quoting Jeff King : On Wed, May 27, 2015 at 10:07:19PM +0200, SZEDER Gábor wrote: Help the completion script by introducing the '--list-names' and '--get-names-regexp' options, the "names-only" equivalents of '--list' and '--get-regexp', so it doesn't have to separate variable names from thei

Re: [PATCH 3/5] verify_lock(): report errors via a strbuf

2015-05-27 Thread Michael Haggerty
On 05/27/2015 09:48 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Instead of writing error messages directly to stderr, write them to a >> "strbuf *err". In lock_ref_sha1_basic(), arrange for these errors to >> be returned to its caller. > > I had to scratch my head and view long out

[PATCH] glossary: add "remote" and "submodule"

2015-05-27 Thread Stefan Beller
Noticed-by: Philip Oakley Signed-off-by: Stefan Beller --- Documentation/glossary-content.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt index bf383c2..e303135 100644 --- a/Documentation/glossary-conten

Re: [PATCH 1/2] config: add options to list only variable names

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 05:04:38PM -0400, Jeff King wrote: > > -'git config' [] [-z|--null] -l | --list > > +'git config' [] [-z|--null] -l | --list | --list-name > > s/list-name/&s/, to match the code (and your commit message). Doh, just saw your "1.5". FWIW, I expected "PATCH 1.5/2" to be "eh

Re: [PATCH 2/2] completion: use new 'git config' options to reliably list variable names

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 10:07:20PM +0200, SZEDER Gábor wrote: > List all set config variable names with 'git config --list-names' instead > of '--list' post processing. Similarly, use 'git config > --get-name-regexp' instead of '--get-regexp' to get config variables in a > given section. > > Sig

Re: [PATCH 1/2] config: add options to list only variable names

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 10:07:19PM +0200, SZEDER Gábor wrote: > Help the completion script by introducing the '--list-names' and > '--get-names-regexp' options, the "names-only" equivalents of '--list' and > '--get-regexp', so it doesn't have to separate variable names from their > values anymore.

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Junio C Hamano
Jeff King writes: > On Wed, May 27, 2015 at 01:46:26PM -0700, Junio C Hamano wrote: > >> Jeff King writes: >> >> > Do you want me to also eradicate PLAIN from the code itself? It's a >> > rather simple change, but it does touch a lot of places. >> >> Nah, that is not user-facing. We do not do

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 03:22:18AM -0400, Jeff King wrote: > In color.diff.*, these are called "new", "old", and "plain". I am of the > opinion that "context" is a far better name than "plain", but perhaps we > should support both for consistency. > > Here's a patch for the color.diff side, if we

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:46:26PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Do you want me to also eradicate PLAIN from the code itself? It's a > > rather simple change, but it does touch a lot of places. > > Nah, that is not user-facing. We do not do s/cache/index/ in the > code

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 1:34 PM, Jeff King wrote: > On Wed, May 27, 2015 at 10:40:37AM -0700, Stefan Beller wrote: > >> > If we are upload-pack-2, should we advertise that in the capabilities? I >> > think it may make things easier later if we try to provide some >> > opportunistic out-of-band dat

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Junio C Hamano
Jeff King writes: > Do you want me to also eradicate PLAIN from the code itself? It's a > rather simple change, but it does touch a lot of places. Nah, that is not user-facing. We do not do s/cache/index/ in the code, either. Besides, I actually find plain much easier to type than context ;-)

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Junio C Hamano
Paul Tan writes: > @@ -17,6 +34,10 @@ struct am_state { > struct strbuf dir;/* state directory path */ > int cur; /* current patch number */ > int last; /* last patch number */ > + struct strbuf msg;/* commit m

Re: [PATCH/WIP 3/8] am: implement patch queue mechanism

2015-05-27 Thread Junio C Hamano
Paul Tan writes: > Makefile | 2 +- > builtin.h| 1 + > builtin/am.c | 167 > +++ > git.c| 1 + > 4 files changed, 170 insertions(+), 1 deletion(-) > create mode 100644 builtin/am.c > > diff --git a/Makefile b/Makefi

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 11:57:15AM -0700, Junio C Hamano wrote: > > -- >8 -- > > Subject: diff: accept color.diff.context as a synonym for "plain" > > > > The term "plain" is a bit ambiguous; let's allow the more > > specific "context", but keep "plain" around for > > compatibility. > > > > Signed

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Junio C Hamano
Matthieu Moy writes: > Junio C Hamano writes: > >> Matthieu Moy writes: >> >>> I find it weird to write >>> >>> noop >> >> True, but then it can be spelled >> >> # > > I do find it weird too. "#" means "comment", which means "do as if it > was not there" to me. And in this case it does

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 10:40:37AM -0700, Stefan Beller wrote: > > If we are upload-pack-2, should we advertise that in the capabilities? I > > think it may make things easier later if we try to provide some > > opportunistic out-of-band data. E.g., if see tell git-daemon: > > > > git-upload-pac

[PATCH] p4: Retrieve the right revision of the UTF-16 file

2015-05-27 Thread Miguel Torroja
Fixing bug with UTF-16 files when they are retreived by git-p4. It was always getting the tip version of the file and the history of the file was lost. --- git-p4.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index cdfa2df..be2c7da 100755 --- a/git

Re: Bug: .gitconfig folder

2015-05-27 Thread Junio C Hamano
Jorge writes: > If you have a folder named ~/.gitconfig instead of a file with that > name, when you try to run some global config editing command it will > fail with a wrong error message: > > "fatal: Out of memory? mmap failed: No such device" That indeed is a funny error message. How abo

Re: [RFC/WIP PATCH 05/11] transport: add infrastructure to support a protocol version number

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 12:01:50PM -0700, Stefan Beller wrote: > > Interesting choice for the short option ("-v" would be nice, but > > obviously it is taken). Do we want to delay on claiming the > > short-and-sweet 'y' until we are sure this is something people will use > > a lot? In an ideal wor

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:30:28PM -0400, Eric Sunshine wrote: > > Like Eric, I find the whole next_capability thing a little ugly. His > > suggestion to pass in the parsing state is an improvement, but I wonder > > why we need to parse at all. Can we keep the capabilities as: > > > > const char

[PATCH 1.5/2] config: add options to list only variable names

2015-05-27 Thread SZEDER Gábor
Recenty I created a multi-line branch description with '.' and '=' characters on one of the lines, and noticed that fragments of that line show up when completing set variable names for 'git config', e.g.: $ git config --get branch.b.description Branch description to fool the completion script

Re: [RFC/WIP PATCH 06/11] remote.h: add get_remote_capabilities, request_capabilities

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:19:39PM -0400, Eric Sunshine wrote: > >> The 'len > 4' check is needed because there's no guarantee that 'line' > >> is NUL-terminated. Correct? > > > > I think this was just blindly copied from get_remote_heads(). And I > > think that code was being overly paranoid. Eve

Re: [PATCH v6] send-email: Add sendmail email aliases format

2015-05-27 Thread Junio C Hamano
Allen Hubbe writes: > Add support for the sendmail email aliases format. Thanks. > ** Note: A general 'where to find documentation' paragraph will be added >by Junio, appearing either before or after this patch in the series. You didn't have to do this to me; as long as you agree w

[PATCH 1/2] config: add options to list only variable names

2015-05-27 Thread SZEDER Gábor
Recenty I created a multi-line branch description with '.' and '=' characters on one of the lines, and noticed that fragments of that line show up when completing set variable names for 'git config', e.g.: $ git config --get branch.b.description Branch description to fool the completion script

[PATCH 2/2] completion: use new 'git config' options to reliably list variable names

2015-05-27 Thread SZEDER Gábor
List all set config variable names with 'git config --list-names' instead of '--list' post processing. Similarly, use 'git config --get-name-regexp' instead of '--get-regexp' to get config variables in a given section. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 15

Re: [PATCH 0/5] Fix verify_lock() to report errors via strbuf

2015-05-27 Thread Junio C Hamano
Michael Haggerty writes: > The last sentence is nonsense. This patch series relies on > lock_ref_sha1_basic() having a "strbuf *err" parameter, which is only > the case since > > 4a32b2e lock_ref_sha1_basic(): report errors via a "struct strbuf > *err" (2015-05-11) > > The latter commit is in

Re: [PATCH 3/5] verify_lock(): report errors via a strbuf

2015-05-27 Thread Junio C Hamano
Michael Haggerty writes: > Instead of writing error messages directly to stderr, write them to a > "strbuf *err". In lock_ref_sha1_basic(), arrange for these errors to > be returned to its caller. I had to scratch my head and view long outside the context before realizing that the caller lock_re

[PATCHv3] submodule documentation: Reorder introductory paragraphs

2015-05-27 Thread Stefan Beller
It's better to start the man page with a description of what submodules actually are instead of saying what they are not. Reorder the paragraphs such that the first short paragraph introduces the submodule concept, the second paragraph highlights the usage of the submodule command, the third parag

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >> I find it weird to write >> >> noop > > True, but then it can be spelled > > # I do find it weird too. "#" means "comment", which means "do as if it was not there" to me. And in this case it does change the semantics once you activate t

Re: [PATCH 3/3] clone: add `--seed` shorthand

2015-05-27 Thread Junio C Hamano
Jeff King writes: > On Sun, May 24, 2015 at 12:07:53PM -0700, Junio C Hamano wrote: > >> Jeff King writes: >> >> > Having slept on it, I really think "--seed" should be "fetch from the >> > seed into temp refs", and not what I posted earlier. >> >> Yeah, I think that is the right way to do it.

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Junio C Hamano
Matthieu Moy writes: > I find it weird to write > > noop True, but then it can be spelled # too, so do we still want 'drop'? Unless we have a strong reason to believe migrants from Hg cannot be (re)trained, personally, I'd feel that we do not need this 'drop' thing. -- To unsubscribe

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Junio C Hamano
Matthieu Moy writes: > Stephen Kelly writes: > >> Galan Rémi ensimag.grenoble-inp.fr> writes: >> >>> >>> Check if commits were removed (i.e. a line was deleted) or dupplicated >>> (e.g. the same commit is picked twice), can print warnings or abort >>> git rebase according to the value of the c

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Junio C Hamano
Remi Galan Alfonso writes: > Thank you for reviewing the code. > > Eric Sunshine writes: >> > + # To uppercase >> > + checkLevel=$(echo "$checkLevel" | tr '[:lower:]' '[:upper:]') >> >> Is there precedence elsewhere for recognizing uppercase and lowercase >> variants of config value

Re: [RFC/WIP PATCH 05/11] transport: add infrastructure to support a protocol version number

2015-05-27 Thread Stefan Beller
On Tue, May 26, 2015 at 11:39 PM, Jeff King wrote: > On Tue, May 26, 2015 at 03:01:09PM -0700, Stefan Beller wrote: > >> + OPT_STRING('y', "transport-version", &transport_version, >> +N_("transport-version"), >> +N_("specify transport version to be used")), > >

Re: [RFC/WIP PATCH 05/11] transport: add infrastructure to support a protocol version number

2015-05-27 Thread Junio C Hamano
Jeff King writes: > On Tue, May 26, 2015 at 03:01:09PM -0700, Stefan Beller wrote: > >> +OPT_STRING('y', "transport-version", &transport_version, >> + N_("transport-version"), >> + N_("specify transport version to be used")), > > Interesting choice for the short op

Re: [PATCH/WIP 1/8] wrapper: implement xopen()

2015-05-27 Thread Torsten Bögershausen
On 2015-05-27 15.33, Paul Tan wrote: > A common usage pattern of open() is to check if it was successful, and > die() if it was not: > > int fd = open(path, O_WRONLY | O_CREAT, 0777); > if (fd < 0) > die_errno(_("Could not open '%s' for writing."), path); > > Implement a

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Junio C Hamano
Jeff King writes: > In color.diff.*, these are called "new", "old", and "plain". I am of the > opinion that "context" is a far better name than "plain", but perhaps we > should support both for consistency. > > Here's a patch for the color.diff side, if we want to go that route. > > -- >8 -- > Su

Re: [PATCH/WIP 1/8] wrapper: implement xopen()

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 6:33 AM, Paul Tan wrote: > A common usage pattern of open() is to check if it was successful, and > die() if it was not: > > int fd = open(path, O_WRONLY | O_CREAT, 0777); > if (fd < 0) > die_errno(_("Could not open '%s' for writing."), path)

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Eric Sunshine
On Wed, May 27, 2015 at 9:19 AM, Remi Galan Alfonso wrote: > Eric Sunshine writes: >> > + # To uppercase >> > + checkLevel=$(echo "$checkLevel" | tr '[:lower:]' '[:upper:]') >> >> Is there precedence elsewhere for recognizing uppercase and lowercase >> variants of config values? > > It

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Stefan Beller
On Tue, May 26, 2015 at 11:35 PM, Jeff King wrote: > On Tue, May 26, 2015 at 03:01:08PM -0700, Stefan Beller wrote: > >> --- a/upload-pack.c >> +++ b/upload-pack.c >> @@ -716,10 +716,47 @@ static void format_symref_info(struct strbuf *buf, >> struct string_list *symref) >> strbuf_ad

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Eric Sunshine
On Wed, May 27, 2015 at 2:35 AM, Jeff King wrote: > On Tue, May 26, 2015 at 03:01:08PM -0700, Stefan Beller wrote: >> +static void send_capabilities(void) >> +{ >> + char buf[100]; >> + >> + while (next_capability(buf)) >> + packet_write(1, "capability:%s\n", buf); > > Like Eri

Re: [RFC/WIP PATCH 06/11] remote.h: add get_remote_capabilities, request_capabilities

2015-05-27 Thread Eric Sunshine
On Wed, May 27, 2015 at 2:50 AM, Jeff King wrote: > On Tue, May 26, 2015 at 11:25:05PM -0400, Eric Sunshine wrote: > >> > + len = packet_read(in, &src_buf, &src_len, >> > + packet_buffer, sizeof(packet_buffer), >> > + PA

Important Notification

2015-05-27 Thread Technical Support
You are required to click on the link to verify your email account because we are upgrading our webmail.http://www.skywap.ro/logo/eupdate/ Webmail Technical Support Copyright 2012. All Rights Reserved -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to maj

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Matthieu Moy
Remi Galan Alfonso writes: > It also has some effects with the second part of this patch (checks > removed and/or duplicated commits): if you comment the line, the > commit will be considered as removed, thus ending in a warning if the > config variable is set to warn/error; however this problem

Re: [PATCH/RFC 1/2] git-rebase -i: Add key word "drop" to remove a commit

2015-05-27 Thread Remi Galan Alfonso
Thank you for reviewing the code. Johannes Schindelin writes: > Please note that you can already just comment-out the line if you need to > keep a visual trace. > > Alternatively, you can replace the `pick` command by `noop`. > > If you really need the `drop` command (with which I am not 100% >

[PATCH/WIP 3/8] am: implement patch queue mechanism

2015-05-27 Thread Paul Tan
git-am applies a series of patches. If the process terminates abnormally, we want to be able to resume applying the series of patches. This requires the session state to be saved in a persistent location. Implement the mechanism of a "patch queue", represented by 2 integers -- the index of the cur

[PATCH/WIP 4/8] am: split out mbox/maildir patches with git-mailsplit

2015-05-27 Thread Paul Tan
git-am.sh supports mbox, stgit and mercurial patches. Re-implement support for splitting out mbox/maildirs using git-mailsplit, while also implementing the framework required to support other patch formats in the future. Re-implement support for the --patch-format option (since a5a6755 (git-am for

[PATCH/WIP 7/8] am: apply patch with git-apply

2015-05-27 Thread Paul Tan
Implement applying the patch to the index using git-apply. Signed-off-by: Paul Tan --- builtin/am.c | 50 +- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 0b8a42d..7126df3 100644 --- a/builtin/am.c

[PATCH/WIP 8/8] am: commit applied patch

2015-05-27 Thread Paul Tan
Implement do_commit(), which commits the index which contains the results of applying the patch, along with the extracted commit message and authorship information. Signed-off-by: Paul Tan --- builtin/am.c | 46 ++ 1 file changed, 46 insertions(+) dif

[PATCH/WIP 5/8] am: detect mbox patches

2015-05-27 Thread Paul Tan
Since 15ced75 (git-am foreign patch support: autodetect some patch formats, 2009-05-27), git-am.sh is able to autodetect mbox, stgit and mercurial patches through heuristics. Re-implement support for autodetecting mbox/maildir files. Signed-off-by: Paul Tan --- builtin/am.c | 99 +++

[PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Paul Tan
For the purpose of applying the patch and committing the results, implement extracting the patch data, commit message and authorship from an e-mail message using git-mailinfo. git-mailinfo is run as a separate process, but ideally in the future, we should be be able to access its functionality dir

[PATCH/WIP 1/8] wrapper: implement xopen()

2015-05-27 Thread Paul Tan
A common usage pattern of open() is to check if it was successful, and die() if it was not: int fd = open(path, O_WRONLY | O_CREAT, 0777); if (fd < 0) die_errno(_("Could not open '%s' for writing."), path); Implement a wrapper function xopen() that does the above s

[PATCH/WIP 2/8] wrapper: implement xfopen()

2015-05-27 Thread Paul Tan
A common usage pattern of fopen() is to check if it succeeded, and die() if it failed: FILE *fp = fopen(path, "w"); if (!fp) die_errno(_("could not open '%s' for writing"), path); Implement a wrapper function xfopen() for the above, so that we can save a few lines

[PATCH/WIP 0/8] Make git-am a builtin

2015-05-27 Thread Paul Tan
git-am is a commonly used command for applying a series of patches from a mailbox to the current branch. Currently, it is implemented by the shell script git-am.sh. However, compared to C, shell scripts have certain deficiencies: they need to spawn a lot of processes, introduce a lot of dependencie

Bug: .gitconfig folder

2015-05-27 Thread Jorge
If you have a folder named ~/.gitconfig instead of a file with that name, when you try to run some global config editing command it will fail with a wrong error message: "fatal: Out of memory? mmap failed: No such device" You can reproduce it: $rm ~/.gitconfig $mkdir ~/.gitconfig $ls -l

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Remi Galan Alfonso
Eric Sunshine writes: > Shouldn't this case also 'die' when rebase.checkLevel is "error"? And, > why doesn't the user get advice about configuring rebase.checkLevel in > this case? Stephen Kelly writes: > I sometimes duplicate commits deliberately if I want to split a commit in > two. Matthieu Moy

FW: Query on git submodules

2015-05-27 Thread Frawley, Sarah
Thanks Heiko for getting back to me. Correct when I referred to 10+ layers I meant nested repositories which make up a large hierarchy.  Some repositories are repeated across the hierarchy.  We check-out submodules to tag versions (as opposed to master branch).  If we need to roll out a particu

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Remi Galan Alfonso
Thank you for reviewing the code. Eric Sunshine writes: > > + # To uppercase > > + checkLevel=$(echo "$checkLevel" | tr '[:lower:]' '[:upper:]') > > Is there precedence elsewhere for recognizing uppercase and lowercase > variants of config values? It seems to be commonly used when p

Re: [PATCH 0/5] Fix verify_lock() to report errors via strbuf

2015-05-27 Thread Michael Haggerty
On 05/23/2015 01:34 AM, Michael Haggerty wrote: > verify_lock() is a helper function called while committing reference > transactions. But when it fails, instead of recording its error > message in a strbuf to be passed back to the caller of > ref_transaction_commit(), the error message was being w

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Matthieu Moy
Stephen Kelly writes: > Galan Rémi ensimag.grenoble-inp.fr> writes: > >> >> Check if commits were removed (i.e. a line was deleted) or dupplicated >> (e.g. the same commit is picked twice), can print warnings or abort >> git rebase according to the value of the configuration variable >> rebase.

Recovering from 'fatal: core.bare and core.worktree do not make sense'

2015-05-27 Thread SZEDER Gábor
Hi, the other day I said 'git config core.worktree /somewhere' in a bare repo while thinking I was in a regular one, user error. The 'fatal: core.bare and core.worktree do not make sense' error from the next command made me realize immediately that I was wrong, that's good. However... OK, let'

[PATCH] t7063: hide stderr from setup inside prereq

2015-05-27 Thread Jeff King
When t7063 starts, it runs "update-index --untracked-cache" to see if we support the untracked cache. Its output goes straight to stderr, even if the test is not run with "-v". Let's wrap it in a prereq that will hide the output by default, but show it with "-v". Signed-off-by: Jeff King --- I no

Re: [PATCH/RFC 2/2] git rebase -i: Warn removed or dupplicated commits

2015-05-27 Thread Stephen Kelly
Galan Rémi ensimag.grenoble-inp.fr> writes: > > Check if commits were removed (i.e. a line was deleted) or dupplicated > (e.g. the same commit is picked twice), can print warnings or abort > git rebase according to the value of the configuration variable > rebase.checkLevel. I sometimes duplica

Re: [PATCH 3/3] clone: add `--seed` shorthand

2015-05-27 Thread Jeff King
On Sun, May 24, 2015 at 12:07:53PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Having slept on it, I really think "--seed" should be "fetch from the > > seed into temp refs", and not what I posted earlier. > > Yeah, I think that is the right way to do it. In the meantime, do you wan

Re: [PATCH] git-new-workdir: add windows compatibility

2015-05-27 Thread Johannes Schindelin
Hi Daniel, On 2015-05-26 19:16, Daniel Smith wrote: > Thanks to everyone for reviewing my proposed patch an providing valuable > feedback. This was my first patch submission to a large open source project > like Git and the whole process was a little daunting. Heh, yeah, it can be quite overwhelm

Re: Staging commits with visual diff tools?

2015-05-27 Thread John Lee
On Wed, 27 May 2015, Jeff King wrote: If you are interested in looking further, see how the %patch_mode hash is defined in git-add--interactive.perl. Specifically, note that "add -p" is just one case: diff against the index and apply with "apply --cached". But once you have a separate tool for p

Re: Staging commits with visual diff tools?

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 09:50:49PM +0100, John Lee wrote: > Does anybody have code to stage commits using a the visual diff/merge tools > supported by git-difftool? Is there support in git itself somewhere, even? > > I'm looking for something functionally similar to git add -p > > Looking at th

Re: [PATCH v3 0/4] showing existing ws breakage

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 11:30:28PM -0700, Junio C Hamano wrote: > The fourth one in v2 used a new option "--[no-]ws-check-deleted", > but in this round a new option "--ws-error-highlight=" is > defined instead. With that, you can say > > diff --ws-error-highlight=new,old > > to say "I wan

Re: [RFC/WIP PATCH 10/11] t5544: add a test case for the new protocol

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 03:01:14PM -0700, Stefan Beller wrote: > Signed-off-by: Stefan Beller > --- > t/t5544-fetch-2.sh | 40 > 1 file changed, 40 insertions(+) > create mode 100755 t/t5544-fetch-2.sh Obviously we are not there yet, but a fun test will

Re: [RFC/WIP PATCH 00/11] Protocol version 2, again!

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 02:18:18AM -0400, Jeff King wrote: > > The new protocol works just like the old protocol, except for > > the capabilities negotiation being before any exchange of real data. > > I like this approach. [...] So now I've read through all the patches. I still like it. :) The

Re: [RFC/WIP PATCH 09/11] transport: get_refs_via_connect exchanges capabilities before refs.

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 03:01:13PM -0700, Stefan Beller wrote: > + switch (version) { > + default: /* > + * Configured a protocol version > 2? > + * Try version 2 as it's the most future proof. > + */ > +

Re: [RFC/WIP PATCH 08/11] transport: connect_setup appends protocol version number

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 03:01:12PM -0700, Stefan Beller wrote: > Signed-off-by: Stefan Beller > --- > transport.c | 18 -- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/transport.c b/transport.c > index 3ef15f6..33644a6 100644 > --- a/transport.c > +++ b/tr