Re: What happened to "git status --color=(always|auto|never)"?

2017-10-09 Thread Nazri Ramliy
> commit 6be4595edb8e5b616c6e8b9fbc78b0f831fa2a87 > Author: Jeff King > Date: Tue Oct 3 09:46:06 2017 -0400 > > color: make "always" the same as "auto" in config > > Would you like to take a stab at adding it? builtin/commit.c and >

Re: [PATCH v3] run-command: add hint when a hook is ignored

2017-10-09 Thread Junio C Hamano
Damien Marié writes: > When an hook is present but the file is not set as executable then git will > ignore the hook. > For now this is silent which can be confusing. Quite honestly, I do not particulary think this is confusing, and I expect that this change will irritate many

[PATCH 1/2] describe: do not use cmd_*() as a subroutine

2017-10-09 Thread Junio C Hamano
The cmd_foo() function is a moral equivalent of 'main' for a Git subcommand 'git foo', and as such, it is allowed to do many things that make it unsuitable to be called as a subroutine, including - call exit(3) to terminate the process; - allocate resource held and used throughout its

[PATCH 2/2] merge-ours: do not use cmd_*() as a subroutine

2017-10-09 Thread Junio C Hamano
The call to cmd_diff_index() "git merge-ours" makes has been working by accident that the function did not call exit(3), and the caller exited almost immediately after making a call, but it sets a bad precedent for people to cut and paste. For finding out if the index exactly matches the HEAD (or

[PATCH 0/2] Do not call cmd_*() as a subroutine

2017-10-09 Thread Junio C Hamano
These two patches are for a recent #leftoverbits topic. https://public-inbox.org/git/xmqqr2vlbgyk@gitster.mtv.corp.google.com/ The cmd_foo() function is a moral equivalent of 'main' for a Git subcommand 'git foo', and as such, it is allowed to do many things that make it unsuitable to be

Re: [PATCH] submodule: avoid sentence-lego in translated string

2017-10-09 Thread Changwoo Ryu
2017-10-10 10:26 GMT+09:00 Junio C Hamano : > Jean-Noël AVILA writes: > >> On Monday, 9 October 2017, 09:47:26 CEST Stefan Beller wrote: >> >>> I always assumed that translators are aware of these issues and sort of >>> work around this somehow, maybe like

Re: [PATCH v2 13/24] builtin/pack-objects: convert to struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > This is one of the last unconverted callers to peel_ref. While we're > fixing that, convert the rest of the file, since it will need to be > converted at some point anyway. > > Signed-off-by: brian m. carlson > --- >

Re: [PATCH v2 12/24] pack-bitmap: convert traverse_bitmap_commit_list to object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Convert traverse_bitmap_commit_list and the callbacks it takes to use a > pointer to struct object_id. > > Signed-off-by: brian m. carlson > --- > builtin/pack-objects.c | 8 > builtin/rev-list.c | 4 ++-- > pack-bitmap.c

Re: [PATCH v2 11/24] refs: convert dwim_log to struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Signed-off-by: brian m. carlson > --- > builtin/reflog.c | 4 ++-- > reflog-walk.c| 2 +- > refs.c | 8 > refs.h | 2 +- > sha1_name.c | 2 +- > 5 files changed, 9 insertions(+), 9 deletions(-)

Re: [PATCH v2 10/24] builtin/reflog: convert remaining unsigned char uses to object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Convert the remaining uses of unsigned char [20] to struct object_id. > This conversion is needed for dwim_log. > > Signed-off-by: brian m. carlson > --- > builtin/reflog.c | 18 +- > 1 file changed, 9 insertions(+), 9

Re: [PATCH v2 09/24] refs: convert dwim_ref and expand_ref to struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > All of the callers of these functions just pass the hash member of a > struct object_id, so convert them to use a pointer to struct object_id > directly. > > Signed-off-by: brian m. carlson > --- > archive.c | 2 +- > branch.c

Re: [PATCH v2 08/24] refs: convert read_ref and read_ref_full to object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > All but two of the call sites already had parameters using the hash nit: "already have", since commit messages use the present for the state of the codebase without the patch applied. > parameter of struct object_id, so convert them to take a pointer to the > struct

Re: [PATCH] sha1_loose_object_info: handle errors from unpack_sha1_rest

2017-10-09 Thread Junio C Hamano
Jeff King writes: > Actually, there are only two callers left these days. One of them leaks, > and the other immediately closes the zstream. So something like: > > diff --git a/sha1_file.c b/sha1_file.c > index 09ad64ce55..cea003d182 100644 > --- a/sha1_file.c > +++ b/sha1_file.c

Re: [PATCH] submodule: avoid sentence-lego in translated string

2017-10-09 Thread Junio C Hamano
Jean-Noël AVILA writes: > On Monday, 9 October 2017, 09:47:26 CEST Stefan Beller wrote: > >> I always assumed that translators are aware of these issues and sort of >> work around this somehow, maybe like this: >> >> "submodule entry '%s' (%s) is not a commit. It is of type

Re: [PATCH v2 07/24] refs: convert resolve_refdup and refs_resolve_refdup to struct object_id

2017-10-09 Thread Junio C Hamano
"brian m. carlson" writes: > All of the callers already pass the hash member of struct object_id, so > update them to pass a pointer to the struct directly, > > This transformation was done with an update to declaration and > definition and the following semantic

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Junio C Hamano
Jonathan Nieder writes: > All that said, I want this function to go away completely. :) Oh, if you are planning to replace it with something else, then I wouldn't bother wasting my time trying to understand the updated comment, or making it more understandable by others.

Re: What happened to "git status --color=(always|auto|never)"?

2017-10-09 Thread Jonathan Nieder
Nazri Ramliy wrote: > On Tue, Oct 10, 2017 at 8:16 AM, Jonathan Nieder wrote: >> Nazri Ramliy wrote: >>> I used to work before, but now: >>> >>> $ git version >>> git version 2.15.0.rc0.39.g2f0e14e649 >>> >>> $ git status --color=always >>> error: unknown option

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Jonathan Nieder
Junio C Hamano wrote: > Jonathan Nieder writes: >> Junio C Hamano wrote: >>> This is not a new issue (the removed comment did not mention this at >>> all), but is it correct to say that updates to "index and work tree" >>> was as if we did "git -C $path checkout new" (and of

Re: What happened to "git status --color=(always|auto|never)"?

2017-10-09 Thread Nazri Ramliy
On Tue, Oct 10, 2017 at 8:16 AM, Jonathan Nieder wrote: > Hi, > > Nazri Ramliy wrote: > >> I used to work before, but now: >> >> $ git version >> git version 2.15.0.rc0.39.g2f0e14e649 >> >> $ git status --color=always >> error: unknown option `color=always' >> usage: git

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Junio C Hamano
Jonathan Nieder writes: >> This is not a new issue (the removed comment did not mention this at >> all), but is it correct to say that updates to "index and work tree" >> was as if we did "git -C $path checkout new" (and of course, HEAD in >> the $path submodule must be at

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Jonathan Nieder
Junio C Hamano wrote: > Stefan Beller writes: >> +/** >> + * Move the HEAD and content of the active submodule at 'path' from object >> id >> + * 'old' to 'new'. >> + * >> + * Updates the submodule at 'path' and files in its work tree to commit >> + * 'new'. The commit

Re: What happened to "git status --color=(always|auto|never)"?

2017-10-09 Thread Jonathan Nieder
Hi, Nazri Ramliy wrote: > I used to work before, but now: > > $ git version > git version 2.15.0.rc0.39.g2f0e14e649 > > $ git status --color=always > error: unknown option `color=always' > usage: git status [] [--] ... Which version did it work in? That would allow me to bisect. Thanks,

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Junio C Hamano
Stefan Beller writes: > +/** > + * Move the HEAD and content of the active submodule at 'path' from object id > + * 'old' to 'new'. > + * > + * Updates the submodule at 'path' and files in its work tree to commit > + * 'new'. The commit previously pointed to by the submodule

Re: [PATCH 3/3] write_entry: untangle symlink and regular-file cases

2017-10-09 Thread Junio C Hamano
Jeff King writes: > The write_entry() function switches on the mode of the entry > we're going to write out. The cases for S_IFLNK and S_IFREG > are lumped together. In earlier versions of the code, this > made some sense. They have a shared preamble (which reads > the blob

Re: [PATCH 1/3] write_entry: fix leak when retrying delayed filter

2017-10-09 Thread Junio C Hamano
Jeff King writes: > When write_entry() retries a delayed filter request, we > don't need to send the blob content to the filter again, and > set the pointer to NULL. But doing so means we leak the > contents we read earlier from read_blob_entry(). Let's make > sure to free it

Re: [PATCH 2/3] write_entry: avoid reading blobs in CE_RETRY case

2017-10-09 Thread Junio C Hamano
Jeff King writes: > When retrying a delayed filter-process request, we don't > need to send the blob to the filter a second time. However, > we read it unconditionally into a buffer, only to later > throw away that buffer. We can make this more efficient by > skipping the read in

What happened to "git status --color=(always|auto|never)"?

2017-10-09 Thread Nazri Ramliy
I used to work before, but now: $ git version git version 2.15.0.rc0.39.g2f0e14e649 $ git status --color=always error: unknown option `color=always' usage: git status [] [--] ... Is it no longer supported? nazri

Re: [PATCH v2 07/24] refs: convert resolve_refdup and refs_resolve_refdup to struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > All of the callers already pass the hash member of struct object_id, so > update them to pass a pointer to the struct directly, > > This transformation was done with an update to declaration and > definition and the following semantic patch: > > @@ > expression E1, E2,

Re: [RFC] column: show auto columns when pager is active

2017-10-09 Thread Eric Sunshine
On Mon, Oct 9, 2017 at 5:45 PM, Kevin Daudt wrote: > When columns are set to automatic for git tag and the output is > paginated by git, the output is a single column instead of multiple > columns. > > Standard behaviour in git is to honor auto values when the pager is > active,

Re: [PATCH v2 06/24] Convert check_connected to use struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Convert check_connected and the callbacks it takes to use struct > object_id. > > Signed-off-by: brian m. carlson > --- > builtin/clone.c| 4 ++-- > builtin/fetch.c| 4 ++-- > builtin/receive-pack.c | 10 +- >

Re: [PATCH v2 05/24] refs: update ref transactions to use struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Update the ref transaction code to use struct object_id. Remove one > NULL pointer check which was previously inserted around a dereference; > since we now pass a pointer to struct object_id directly through, the > code we're calling handles this for us. > >

Re: [PATCH v2 04/24] refs: convert update_ref and refs_update_ref to use struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Convert update_ref, refs_update_ref, and write_pseudoref to use struct > object_id. Update the existing callers as well. Remove update_ref_oid, > as it is no longer needed. > > Signed-off-by: brian m. carlson > --- I'm very happy to see

Re: [PATCH v2 00/24] object_id part 10

2017-10-09 Thread Junio C Hamano
"brian m. carlson" writes: > This is the tenth in a series of patches to convert from unsigned char > [20] to struct object_id. This series mostly involves changes to the > refs code. After these changes, there are almost no references to > unsigned char in the

Re: [PATCH v2 03/24] refs: convert delete_ref and refs_delete_ref to struct object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Convert delete_ref and refs_delete_ref to take a pointer to struct > object_id. Update the documentation accordingly, including referring to > null_oid in lowercase, as it is not a #define constant. > > Signed-off-by: brian m. carlson >

Re: [PATCH v2 02/24] refs/files-backend: convert struct ref_to_prune to object_id

2017-10-09 Thread Jonathan Nieder
brian m. carlson wrote: > Change the member of this struct to be a struct object_id. > > Signed-off-by: brian m. carlson > --- > refs/files-backend.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Yes, this is an obvious improvement to the clarity

Re: [PATCH v2 01/24] walker: convert to struct object_id

2017-10-09 Thread Jonathan Nieder
Hi, brian m. carlson wrote: > Signed-off-by: brian m. carlson > --- > walker.c | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) An egrep for 'sha1|unsigned char' finds nothing left in the file after this change. [...] > ---

Re: [PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Jonathan Nieder
Stefan Beller wrote: > This way users of this function do not need to read the implementation to > know what it will do. > > Signed-off-by: Jonathan Nieder > Signed-off-by: Stefan Beller > --- > submodule.c | 5 - > submodule.h | 18

[PATCH] submodule: spell out API of submodule_move_head

2017-10-09 Thread Stefan Beller
This way users of this function do not need to read the implementation to know what it will do. Signed-off-by: Jonathan Nieder Signed-off-by: Stefan Beller --- submodule.c | 5 - submodule.h | 18 ++ 2 files changed, 18

Re: Branch switching with submodules where the submodule replaces a folder aborts unexpectedly

2017-10-09 Thread Stefan Beller
On Mon, Oct 9, 2017 at 2:29 PM, Thomas Braun wrote: > Hi, > > I'm currently in the progress of pulling some subprojects in a git repository > of mine into their own repositories and adding these subprojects back as > submodules. > > While doing this I

[RFC] column: show auto columns when pager is active

2017-10-09 Thread Kevin Daudt
When columns are set to automatic for git tag and the output is paginated by git, the output is a single column instead of multiple columns. Standard behaviour in git is to honor auto values when the pager is active, which happens for example with commands like git log showing colors when being

Branch switching with submodules where the submodule replaces a folder aborts unexpectedly

2017-10-09 Thread Thomas Braun
Hi, I'm currently in the progress of pulling some subprojects in a git repository of mine into their own repositories and adding these subprojects back as submodules. While doing this I enountered a potential bug as checkout complains on branch switching that a file already exists. I've

Re: [PATCH] submodule: avoid sentence-lego in translated string

2017-10-09 Thread Jean-Noël AVILA
On Monday, 9 October 2017, 09:47:26 CEST Stefan Beller wrote: > I always assumed that translators are aware of these issues and sort of > work around this somehow, maybe like this: > > "submodule entry '%s' (%s) is not a commit. It is of type %s" Translators can be aware of the issue if the

Re: Auto adding changed files

2017-10-09 Thread Sascha Manns
Hello Randall, Am Montag, den 09.10.2017, 15:39 -0400 schrieb Randall S. Becker: > -Original Message- > On October 9, 2017 3:35 PM Sascha Manns wrote: > > if i'm in a git repo and change a file, it is listed in git status. > > But i have to add this file manually and commit them. > > $

RE: Auto adding changed files

2017-10-09 Thread Randall S. Becker
-Original Message- On October 9, 2017 3:35 PM Sascha Manns wrote: >if i'm in a git repo and change a file, it is listed in git status. But i have >to add this file manually and commit them. $ git commit -a >From the git commit help: by using the -a switch with the commit command to

Auto adding changed files

2017-10-09 Thread Sascha Manns
Hello list, if i'm in a git repo and change a file, it is listed in git status. But i have to add this file manually and commit them. Is it possible to autoadd such files? Greetings Sascha

Re: [git-for-windows] [ANNOUNCE] Git for Windows 2.14.2(2)

2017-10-09 Thread Steve Hoelzer
On Thu, Oct 5, 2017 at 3:22 PM, Lars Schneider wrote: > >> On 05 Oct 2017, at 22:02, Johannes Schindelin >> wrote: >> >> Dear Git users, >> >> It is my pleasure to announce that Git for Windows 2.14.2(2) is available >> from: >> >>

Re: [RFC PATCH 2/4] change submodule push test to use proper repository setup

2017-10-09 Thread Stefan Beller
On Fri, Oct 6, 2017 at 3:32 PM, Heiko Voigt wrote: > NOTE: The argument in this message is not correct, see description in > cover letter. > > The setup of the repositories in this test is using gitlinks without the > .gitmodules infrastructure. It is however testing

Re: [PATCH v2 00/24] object_id part 10

2017-10-09 Thread Stefan Beller
On Sun, Oct 8, 2017 at 6:11 PM, brian m. carlson wrote: > This is the tenth in a series of patches to convert from unsigned char > [20] to struct object_id. This series mostly involves changes to the > refs code. After these changes, there are almost no references

Re: "git rm" seems to do recursive removal even without "-r"

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 04:42:27PM -0400, Theodore Ts'o wrote: > On Sun, Oct 08, 2017 at 03:44:14PM -0400, Robert P. J. Day wrote: > > > > > > find | xargs git rm > > > > > > myself. > > > > that's what i would have normally used until i learned about git's > > magical globbing

[PATCH 3/3] write_entry: untangle symlink and regular-file cases

2017-10-09 Thread Jeff King
The write_entry() function switches on the mode of the entry we're going to write out. The cases for S_IFLNK and S_IFREG are lumped together. In earlier versions of the code, this made some sense. They have a shared preamble (which reads the blob content), a short type-specific body, and a shared

[PATCH 2/3] write_entry: avoid reading blobs in CE_RETRY case

2017-10-09 Thread Jeff King
When retrying a delayed filter-process request, we don't need to send the blob to the filter a second time. However, we read it unconditionally into a buffer, only to later throw away that buffer. We can make this more efficient by skipping the read in the first place when it isn't necessary.

[PATCH 1/3] write_entry: fix leak when retrying delayed filter

2017-10-09 Thread Jeff King
When write_entry() retries a delayed filter request, we don't need to send the blob content to the filter again, and set the pointer to NULL. But doing so means we leak the contents we read earlier from read_blob_entry(). Let's make sure to free it before dropping the pointer. Signed-off-by: Jeff

Re: [PATCH v1 1/2] entry.c: update cache entry only for existing files

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 11:37:14PM +0200, Lars Schneider wrote: > >> Yeah, I think that makes more sense. > >> > >> A patch may look like this on top of these two patches, but I'd > >> prefer to see Lars's eyeballing and possibly wrapping it up in an > >> applicable patch after taking the

Re: [PATCH] submodule: avoid sentence-lego in translated string

2017-10-09 Thread Stefan Beller
On Sun, Oct 8, 2017 at 9:14 PM, Martin Ågren wrote: > In this particular case, we could have three specific messages plus one > default > message (which at the time shouldn't ever occur). Or we have one specific > message for the "tag"-case, which seems to have been

Re: [PATCH v4 4/4] sha1_name: minimize OID comparisons during disambiguation

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 02:49:42PM -0400, Derrick Stolee wrote: > @@ -505,6 +506,65 @@ static int extend_abbrev_len(const struct object_id > *oid, void *cb_data) > return 0; > } > > +static void find_abbrev_len_for_pack(struct packed_git *p, > + struct

Re: [PATCH v4 3/4] sha1_name: parse less while finding common prefix

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 02:49:41PM -0400, Derrick Stolee wrote: > +static inline char get_hex_char_from_oid(const struct object_id *oid, > + int pos) > +{ > + static const char hex[] = "0123456789abcdef"; > + > + if ((pos & 1) == 0) > +

Re: Special strings in commit messages

2017-10-09 Thread Florian Weimer
On 10/08/2017 11:30 PM, Eric Wong wrote: diff --git a/git-rebase--am.sh b/git-rebase--am.sh index 6e64d40d6f..14c50782e0 100644 --- a/git-rebase--am.sh +++ b/git-rebase--am.sh @@ -53,6 +53,7 @@ else git format-patch -k --stdout --full-index --cherry-pick --right-only \

Re: [PATCH v2] cleanup: fix possible overflow errors in binary search

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 02:29:37PM -0400, Derrick Stolee wrote: > A common mistake when writing binary search is to allow possible > integer overflow by using the simple average: > > mid = (min + max) / 2; > > Instead, use the overflow-safe version: > > mid = min + (max - min) / 2;

Draft of Git Rev News edition 32

2017-10-09 Thread Christian Couder
Hi, A draft of a new Git Rev News edition is available here: https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-32.md Everyone is welcome to contribute in any section either by editing the above page on GitHub and sending a pull request, or by commenting on this GitHub