Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Junio C Hamano
David Aguilar writes: > Reading the code again, the point of add_left_or_right() > is to populate the worktree (done later in the loop) with > the stuff we read from Git. Thus, if we changed just this > section to call get_symlink() then we should not even try > to checkout

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Junio C Hamano
Junio C Hamano writes: >> +struct strbuf path = STRBUF_INIT; >> +struct strbuf link = STRBUF_INIT; >> + >> +int ok = 0; >> + >> +if (strbuf_readlink(, ce->name, ce_namelen(ce)) == 0) { >> +strbuf_add(, state->base_dir, state->base_dir_len); >> +

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread David Aguilar
On Mon, Mar 13, 2017 at 02:33:09PM -0700, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> > +if (strbuf_readlink(, ce->name, ce_namelen(ce)) == 0) { > >> > +strbuf_add(, state->base_dir, state->base_dir_len); > >> > +

[PATCH 6/6 v5] sha1_name.c: avoid parsing @{-1} unnecessarily

2017-03-13 Thread mash
Move dash is previous branch check to get_sha1_basic. Introduce helper function that gets nth prior branch switch from reflog. Signed-off-by: mash --- RE: [PATCH 4/6 v5] sha1_name.c: teach get_sha1_1 "-" shorthand for "@{-1}" > + if (*name == '-' && len == 1) { > +

git checkout exit value and post-commit hooks

2017-03-13 Thread Andreas Politz
Hi, the exit value of a `git checkout' seems to depend on the exit values of the hooks it runs. This breaks for example `git bisect', as seen in the following example. $ mkdir gitbug $ cd gitbug $ git init $ ln -s /bin/false .git/hooks/post-commit $ git bisect start $ git bisect reset fatal:

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > diff --git a/credential-cache.c b/credential-cache.c > index db1343b46..63236adc2 100644 > --- a/credential-cache.c > +++ b/credential-cache.c > @@ -83,12 +83,18 @@ static void do_cache(const char *socket, const char > *action, int timeout, >

Re: [GSoC][PATCH/RFC v3 2/3] credential-cache: use XDG_CACHE_HOME for socket

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > Signed-off-by: Devin Lehmacher > Reviewed-by: Junio C Hamano, Jeff King The last line is premature; neither of us reviewed this exact version and haven't checked if all the issues we mentioned in the previous review have been

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
> Best practice for submitting patches would be to ensure that each patch > compiles without errors (with the DEVELOPER=1 flag set) and that the > entire test suite passes with no errors; this is to maintain > bisect-ability. Only after you've done this should you send your > patches to the

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Brandon Williams
On 03/13, Devin Lehmacher wrote: > > +static int is_socket(char *path) { > > + struct stat sb; > > + int ret = lstat(path, ); > > + return ret && S_IFSOCK(sb.st_mode); > > +} > > This patch won’t even compile. S_IFSOCK(sb.st_mode) should have been S_IFSOCK > & sb.st_mode. > > (I guess I

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
> +static int is_socket(char *path) { > + struct stat sb; > + int ret = lstat(path, ); > + return ret && S_IFSOCK(sb.st_mode); > +} This patch won’t even compile. S_IFSOCK(sb.st_mode) should have been S_IFSOCK & sb.st_mode. (I guess I should have compiled first) After making that

[GSoC][PATCH/RFC v3 1/3] path.c: add xdg_cache_home

2017-03-13 Thread Devin Lehmacher
We already have xdg_config_home to format paths relative to XDG_CONFIG_HOME. Let's provide a similar function xdg_cache_home to do the same for paths relative to XDG_CACHE_HOME. Signed-off-by: Devin Lehmacher --- cache.h | 7 +++ path.c | 15 +++ 2 files

[GSoC][PATCH/RFC v3 2/3] credential-cache: use XDG_CACHE_HOME for socket

2017-03-13 Thread Devin Lehmacher
Make git-credential-cache follow the XDG base path specification by default. This increases consistency with other applications and helps keep clutter out of users' home directories. Check the old socket location, ~/.git-credential-cache/socket and use it instead if there is already a socket at

[GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
Create function is_socket. Make get_socket_path return check if ~/.git-credential-cache/socket is a socket and not just a file. If file_exists behavior could change in an unexpected way. Additionally a file at ~/.git-credential-cache/socket could cause false positives which would otherwise lead to

[GSoC][PATCH/RFC v3 0/3] Fix commit messages, check if socket is socket

2017-03-13 Thread Devin Lehmacher
I fixed all of the commit messages and the weird indentation. I also now check that the socket is actually a socket. What do you think of the function is_socket? Is it general enough to be put in dir.h or unix_socket.h for use in other files? Or should it be left as is? - Devin

Re: What's cooking in git.git (Mar 2017, #05; Mon, 13)

2017-03-13 Thread Junio C Hamano
Stefan Beller writes: >> >> * sb/rev-parse-show-superproject-root (2017-03-08) 1 commit >> - rev-parse: add --show-superproject-working-tree >> >> From a working tree of a repository, a new option of "rev-parse" >> lets you ask if the repository is used as a submodule of

Re: [PATCH v5 10/11] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Junio C Hamano
Johannes Schindelin writes: > On Mon, 13 Mar 2017, Junio C Hamano wrote: > >> When a patch series is refactoring an existing function to be used >> in different codepaths, an existing issue inherited from the >> original code (e.g. perhaps an existing error checking

Re: Possible git blame bug?

2017-03-13 Thread Domagoj Stolfa
Hello, > > Thanks for clearing this up. Is this documented somewhere, so that if it > > happens > > again I can point people to the docs that explain this behaviour? > > Is this from "git blame --help" sufficient? > > When you are not interested in changes older than version > v2.6.18,

Re: [PATCH 1/1] archive: learn to include submodules in output archive

2017-03-13 Thread Junio C Hamano
Stefan Beller writes: > On Mon, Mar 13, 2017 at 3:12 PM, Stefan Beller wrote: > >>> will recursively traverse submodules in the repository and >>> consider their contents for inclusion in the output archive, subject to >>> any pathspec filters. > >

Re: Possible git blame bug?

2017-03-13 Thread Junio C Hamano
Domagoj Stolfa writes: > Thanks for clearing this up. Is this documented somewhere, so that if it > happens > again I can point people to the docs that explain this behaviour? Is this from "git blame --help" sufficient? When you are not interested in changes

Re: Possible git blame bug?

2017-03-13 Thread Domagoj Stolfa
Hello, > > For example, saying: > > > > $ git blame time.h --since=2017 > > ^e19f2a27ed8 (Domagoj Stolfa 2017-03-12 20:43:01 +0100 33) #ifndef > > _SYS_TIME_H_ > > > > $ git blame time.h --since=2016 > > ^21613a57af9 (bz 2016-03-13 21:26:18 + 33) #ifndef _SYS_TIME_H_ > > > > $ git blame

Re: What's cooking in git.git (Mar 2017, #05; Mon, 13)

2017-03-13 Thread Stefan Beller
> > * sb/rev-parse-show-superproject-root (2017-03-08) 1 commit > - rev-parse: add --show-superproject-working-tree > > From a working tree of a repository, a new option of "rev-parse" > lets you ask if the repository is used as a submodule of another > project, and where the root level of the

Re: [PATCH 1/1] archive: learn to include submodules in output archive

2017-03-13 Thread Stefan Beller
On Mon, Mar 13, 2017 at 3:12 PM, Stefan Beller wrote: >> will recursively traverse submodules in the repository and >> consider their contents for inclusion in the output archive, subject to >> any pathspec filters. git-archive pays attention to export-ignore and

Re: [PATCH v3 00/10] decoupling a submodule's existence and its url

2017-03-13 Thread Stefan Beller
On Mon, Mar 13, 2017 at 2:43 PM, Brandon Williams wrote: > changes in v3: > > * Droped a patch which tried to use a more accurate URL for deinit. It didn't > really fit inside the scope of this series. It may be something we want to > revisit later though. > > * The

Re: [PATCH v3 05/10] submodule: decouple url and submodule existence

2017-03-13 Thread Stefan Beller
+ cc Jens, FYI. Once upon a time I brought up different addressing/activating mechanism for submodules and I remember Jens having some uneasy thoughts about that back in the day. This series addresses the user confusion and documentation better than what I had back then. On Mon, Mar 13, 2017 at

Re: Possible git blame bug?

2017-03-13 Thread Junio C Hamano
Junio C Hamano writes: > Domagoj Stolfa writes: > >> For example, saying: >> >> $ git blame time.h --since=2017 >> ^e19f2a27ed8 (Domagoj Stolfa 2017-03-12 20:43:01 +0100 33) #ifndef >> _SYS_TIME_H_ >> >> $ git blame time.h --since=2016 >>

What's cooking in git.git (Mar 2017, #05; Mon, 13)

2017-03-13 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. A handful of topics are ready to

Re: [PATCH v3 0/2] bringing attributes to pathspecs

2017-03-13 Thread Brandon Williams
On 03/13, Junio C Hamano wrote: > Brandon Williams writes: > > > v3 fixes some nits in style in the test script (using <<-\EOF instead of > > <<-EOF) > > as well as fixing a few other minor things reported by Junio and Jonathan. > > Thanks. Will replace. > > I think this

Re: [PATCH v3 01/10] submodule--helper: add is_active command

2017-03-13 Thread Stefan Beller
On Mon, Mar 13, 2017 at 2:43 PM, Brandon Williams wrote: > There are a lot of places where an explicit check for > submodule."".url is done to see if a submodule exists. In order > to centralize this check introduce a helper which can be used to query > if a submodule is

Re: [PATCH v6 00/12] Fix the early config

2017-03-13 Thread Junio C Hamano
Johannes Schindelin writes: > These patches are an attempt to make Git's startup sequence a bit less > surprising. I think this is ready for 'next', so let's ask reviewers to really pay attention to this round, wait for a few days and merge it by the end of the week

Re: [PATCH v3 0/2] bringing attributes to pathspecs

2017-03-13 Thread Junio C Hamano
Brandon Williams writes: > v3 fixes some nits in style in the test script (using <<-\EOF instead of > <<-EOF) > as well as fixing a few other minor things reported by Junio and Jonathan. Thanks. Will replace. I think this is ready for 'next', so let's ask reviewers to

[PATCH/RFC V2] stash: implement builtin stash

2017-03-13 Thread Joel Teichroeb
Implement all git stash functionality as a builtin command Signed-off-by: Joel Teichroeb --- I've been working on rewriting git stash as a c builtin and I have all but three tests passing. I'm having a bit of trouble fixing them, as well as a few other issues, so I'd really

Re: Possible git blame bug?

2017-03-13 Thread Junio C Hamano
Domagoj Stolfa writes: > For example, saying: > > $ git blame time.h --since=2017 > ^e19f2a27ed8 (Domagoj Stolfa 2017-03-12 20:43:01 +0100 33) #ifndef > _SYS_TIME_H_ > > $ git blame time.h --since=2016 > ^21613a57af9 (bz 2016-03-13 21:26:18 + 33) #ifndef

Re: [PATCH 1/1] archive: learn to include submodules in output archive

2017-03-13 Thread Stefan Beller
Welcome to the Git community! On Sat, Mar 11, 2017 at 11:54 PM, Nikhil Benesch wrote: > This commit is a revival of Lars Hjemli's 2009 patch to provide an > option to include submodules in the output of `git archive`. I am unaware of said patch, could you link to it,

Re: [GSoC][PATCH v2 2/2] credential-cache: use XDG_CACHE_HOME for socket

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > git-credential-cache will now use a socket following the XDG base path > specification by default. This increases consistency with other > applications and helps keep clutter out of users' home directories. We tend to write our log messages in

Re: [PATCH v5 10/11] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Johannes Schindelin
Hi Junio, On Mon, 13 Mar 2017, Junio C Hamano wrote: > Junio C Hamano writes: > > > The former case may split into two. "Yes I agree that is bad and it > > is the same badness as the version without this change", in which case > > we may want to leave a "NEEDSWORK" comment

Re: [PATCH v6 03/12] Prepare setup_discovered_git_directory() the root directory

2017-03-13 Thread Johannes Schindelin
Hi Junio, On Mon, 13 Mar 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Subject: Re: [PATCH v6 03/12] Prepare setup_discovered_git_directory() the > > root directory > > I do not think you've changed this title throughout the rerolls, but > I

[PATCH v3 06/10] submodule update: add `--init-active` switch

2017-03-13 Thread Brandon Williams
The new switch `--init-active` initializes the submodules which are configured in `submodule.active` and `submodule..active` instead of those given as command line arguments before updating. In the first implementation this is made incompatible with further command line arguments as it is unclear

[PATCH v3 10/10] submodule add: respect submodule.active and submodule..active

2017-03-13 Thread Brandon Williams
In addition to adding submodule..url to the config, set submodule..active to true unless submodule.active is configured and the submodule's path matches the configured pathspec. Signed-off-by: Brandon Williams --- git-submodule.sh | 12

[PATCH v3 09/10] submodule--helper init: set submodule..active

2017-03-13 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true to indicate that the submodule is active. Signed-off-by: Brandon Williams --- builtin/submodule--helper.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/submodule--helper.c

[PATCH v3 04/10] submodule--helper clone: check for configured submodules using helper

2017-03-13 Thread Brandon Williams
Use the 'is_submodule_initialized()' helper to check for configured submodules instead of manually checking for the submodule's URL in the config. Signed-off-by: Brandon Williams --- builtin/submodule--helper.c | 15 +++ 1 file changed, 3 insertions(+), 12

Re: Possible git blame bug?

2017-03-13 Thread Domagoj Stolfa
Hello, > >> The question is whether this is a bug or not, as --since= might not > >> be a > >> valid filter. > > > > I do not think blame ever was designed to work with --since, so that > > is indeed the case. > > Actually, I do see that we had a cut-off based on rev->max_age since we >

[PATCH v3 08/10] completion: clone can initialize specific submodules

2017-03-13 Thread Brandon Williams
Signed-off-by: Brandon Williams --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index fc32286a4..eb13433d5 100644 ---

[PATCH v3 07/10] clone: add --submodule-spec= switch

2017-03-13 Thread Brandon Williams
The new switch passes the pathspec to `git submodule update --init-active` which is called after the actual clone is done. Additionally this configures the submodule.active option to be the given pathspec, such that any future invocation of `git submodule update --init-active` will keep up with

[PATCH v3 03/10] submodule sync: use submodule--helper is-active

2017-03-13 Thread Brandon Williams
Signed-off-by: Brandon Williams --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index ab233712d..e2d08595f 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -,7 +,7 @@ cmd_sync()

[PATCH v3 05/10] submodule: decouple url and submodule existence

2017-03-13 Thread Brandon Williams
Currently the submodule..url config option is used to determine if a given submodule exists and is interesting to the user. This however doesn't work very well because the URL is a config option for the scope of a repository, whereas the existence of a submodule is an option scoped to the working

[PATCH v3 02/10] submodule status: use submodule--helper is-active

2017-03-13 Thread Brandon Williams
Signed-off-by: Brandon Williams --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 136e26a2c..ab233712d 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1010,14 +1010,13 @@ cmd_status()

[PATCH v3 01/10] submodule--helper: add is_active command

2017-03-13 Thread Brandon Williams
There are a lot of places where an explicit check for submodule."".url is done to see if a submodule exists. In order to centralize this check introduce a helper which can be used to query if a submodule is active or not. Signed-off-by: Brandon Williams ---

[PATCH v3 00/10] decoupling a submodule's existence and its url

2017-03-13 Thread Brandon Williams
changes in v3: * Droped a patch which tried to use a more accurate URL for deinit. It didn't really fit inside the scope of this series. It may be something we want to revisit later though. * The --init-active flag now ensure that all submodules which are configured to be 'active'

Re: [GSoC][PATCH v2 1/2] path.c: add xdg_cache_home

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > We already have xdg_config_home to format paths relative to > XDG_CONFIG_HOME. Let's provide a similar function xdg_cache_home to do > the same for paths relative to XDG_CACHE_HOME. Nicely explained. > +/** > + * Return a newly allocated string

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Johannes Schindelin
Hi David, Thank you very much for picking this up! On Mon, 13 Mar 2017, David Aguilar wrote: > Detect the null object ID for symlinks in dir-diff so that difftool can > prepare temporary files that matches how git handles symlinks. Maybe a description is needed how the OID can be null in that

Re: bug?: git reset --mixed ignores deinitialized submodules

2017-03-13 Thread David Turner
On Mon, 2017-03-13 at 14:19 -0700, Stefan Beller wrote: > > > The change is not really lost, as you can get it via > > > > > > git checkout HEAD@{1} > > > git submodule update --init > > > > Sure, the commit isn't lost entirely.  But a mixed reset is often > > used > > to mean "go back

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Junio C Hamano
Johannes Schindelin writes: >> > + if (strbuf_readlink(, ce->name, ce_namelen(ce)) == 0) { >> > + strbuf_add(, state->base_dir, state->base_dir_len); >> > + strbuf_add(, ce->name, ce_namelen(ce)); >> > + >> > + write_file_buf(path.buf,

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-13 Thread René Scharfe
Am 13.03.2017 um 14:23 schrieb Zenobiusz Kunegunda: Bisecting: 0 revisions left to test after this (roughly 0 steps) [a26bc613a64ac2c7ee69a50675e61b004a26382d] pretty.c: make git_pretty_formats_config return -1 on git_config_string failure This is what I found with git bisect Strange, I

Re: Possible git blame bug?

2017-03-13 Thread Junio C Hamano
On Mon, Mar 13, 2017 at 1:38 PM, Junio C Hamano wrote: > Domagoj Stolfa writes: > >> The question is whether this is a bug or not, as --since= might not be >> a >> valid filter. > > I do not think blame ever was designed to work with --since, so that

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Johannes Schindelin
Hi Junio, On Mon, 13 Mar 2017, Junio C Hamano wrote: > David Aguilar writes: > > > +static int create_symlink_file(struct cache_entry* ce, struct checkout* > > state) > > Asterisk sticks to variable, not type. If only we had tools to format the code so that authors as well

Re: bug?: git reset --mixed ignores deinitialized submodules

2017-03-13 Thread Stefan Beller
>> The change is not really lost, as you can get it via >> >> git checkout HEAD@{1} >> git submodule update --init > > Sure, the commit isn't lost entirely. But a mixed reset is often used > to mean "go back to before I committed", and here, that's not precisely > what's happening. Well,

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Marc Stevens
I think I now understand. The Makefile indeed seems to fail to correctly rebuild when a header has changed. As the performance branch has removed the 'int bigendian' from SHA1_CTX in lib/sha1.h, the perf-branch and master-branch are binary incompatible. So the command-line utility does not get

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Johannes Schindelin
Hi Junio, On Mon, 13 Mar 2017, Junio C Hamano wrote: > David Aguilar writes: > > > Detect the null object ID for symlinks in dir-diff so that difftool > > can prepare temporary files that matches how git handles symlinks. > > > > Previously, a null object ID would crash

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Jeff King
On Mon, Mar 13, 2017 at 09:47:54PM +0100, Marc Stevens wrote: > Linus: > I would be surprised, the dependencies should be automatically determined. > > BTW Did you make local changes to this perf branch? I can reproduce it with: cd sha1collisiondetection git clean -dqfx ;# make sure we are

Re: [PATCH 12/17] update submodules: add submodule_move_head

2017-03-13 Thread Stefan Beller
On Sat, Mar 11, 2017 at 11:09 PM, Junio C Hamano wrote: > Brandon Williams writes: > >>> diff --git a/submodule.c b/submodule.c >>> index 0b2596e88a..bc5fecf8c5 100644 >>> --- a/submodule.c >>> +++ b/submodule.c >>> @@ -1239,6 +1239,141 @@ int

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Marc Stevens
Linus: I would be surprised, the dependencies should be automatically determined. BTW Did you make local changes to this perf branch? Specifically did you disable the safe hash mode that is on by default? Because if you did not, it might also be something else as all three hashes below are the

Re: Possible git blame bug?

2017-03-13 Thread Domagoj Stolfa
Hello, > > The question is whether this is a bug or not, as --since= might not > > be a > > valid filter. > > I do not think blame ever was designed to work with --since, so that > is indeed the case. > > Making it work with --since= might be a worthy addition. > Patches welcome. Thanks

[GSoC][PATCH v2 1/2] path.c: add xdg_cache_home

2017-03-13 Thread Devin Lehmacher
We already have xdg_config_home to format paths relative to XDG_CONFIG_HOME. Let's provide a similar function xdg_cache_home to do the same for paths relative to XDG_CACHE_HOME. Signed-off-by: Devin Lehmacher --- cache.h | 7 +++ path.c | 15 +++ 2 files

[GSoC][PATCH v2 2/2] credential-cache: use XDG_CACHE_HOME for socket

2017-03-13 Thread Devin Lehmacher
git-credential-cache will now use a socket following the XDG base path specification by default. This increases consistency with other applications and helps keep clutter out of users' home directories. We still check the old socket location, ~/.git-credential-cache/socket first in case the user

[GSoC][PATCH v2 2/2] credential-cache: use XDG_CACHE_HOME for socket

2017-03-13 Thread Devin Lehmacher
git-credential-cache will now use a socket following the XDG base path specification by default. This increases consistency with other applications and helps keep clutter out of users' home directories. We still check the old socket location, ~/.git-credential-cache/socket first in case the user

Re: Possible git blame bug?

2017-03-13 Thread Junio C Hamano
Domagoj Stolfa writes: > The question is whether this is a bug or not, as --since= might not be a > valid filter. I do not think blame ever was designed to work with --since, so that is indeed the case. Making it work with --since= might be a worthy addition.

Re: [PATCH v6 03/12] Prepare setup_discovered_git_directory() the root directory

2017-03-13 Thread Junio C Hamano
Johannes Schindelin writes: > Subject: Re: [PATCH v6 03/12] Prepare setup_discovered_git_directory() the > root directory I do not think you've changed this title throughout the rerolls, but I cannot quite parse it. Would something like this setup.c: only

Re: [PATCH v5 10/11] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Junio C Hamano
Junio C Hamano writes: > The former case may split into two. "Yes I agree that is bad and it > is the same badness as the version without this change", in which > case we may want to leave a "NEEDSWORK" comment in-code so that > people can notice when browsing the code (but

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Linus Torvalds
On Mon, Mar 13, 2017 at 1:12 PM, Marc Stevens wrote: > Indeed, I've committed a fix, and a small bug fix for the new code just now. Unrelated side note: there may be some missing dependencies in the build infrastructure or something, because when I tried Jeff's script that

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Marc Stevens
Indeed, I've committed a fix, and a small bug fix for the new code just now. The merge incorrectly removed some control logic, which caused more unnecessary checks to happen. I already marked this in the PR, but committed a fix only today. BTW as noted in the Readme, the theoretic false positive

[PATCH v6 12/12] setup.c: mention unresolved problems

2017-03-13 Thread Johannes Schindelin
During the review of the `early-config` patch series, two issues have been identified that have been with us forever. The idea of that patch series was to fix the hard-coded (and sometimes wrong) .git/config path when looking for the pager configurations. To that end, the patches refactor the

[PATCH v6 10/12] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Johannes Schindelin
This function now has a new caller in addition to setup_git_directory(): the newly introduced discover_git_directory(). That function wants to discover the current .git/ directory, and in case of a corrupted one simply pretend that there is none to be found. Example: if a stale .git file exists

[PATCH v6 07/12] read_early_config(): avoid .git/config hack when unneeded

2017-03-13 Thread Johannes Schindelin
So far, we only look whether the startup_info claims to have seen a git_dir. However, do_git_config_sequence() (and consequently the git_config_with_options() call used by read_early_config() asks the have_git_dir() function whether we have a .git/ directory, which in turn also looks at git_dir

[PATCH v6 09/12] Add t1309 to test read_early_config()

2017-03-13 Thread Johannes Schindelin
So far, we had no explicit tests of that function. Signed-off-by: Johannes Schindelin --- t/helper/test-config.c | 15 +++ t/t1309-early-config.sh | 50 + 2 files changed, 65 insertions(+) create mode

[PATCH v6 11/12] t1309: document cases where we would want early config not to die()

2017-03-13 Thread Johannes Schindelin
Jeff King came up with a couple examples that demonstrate how the new read_early_config() that looks harder for the current .git/ directory could die() in an undesirable way. Let's add those cases to the test script, to document what we would like to happen when early config encounters problems.

[PATCH v6 06/12] Make read_early_config() reusable

2017-03-13 Thread Johannes Schindelin
The pager configuration needs to be read early, possibly before discovering any .git/ directory. Let's not hide this function in pager.c, but make it available to other callers. Signed-off-by: Johannes Schindelin --- cache.h | 1 + config.c | 31

[PATCH v6 08/12] read_early_config(): really discover .git/

2017-03-13 Thread Johannes Schindelin
Earlier, we punted and simply assumed that we are in the top-level directory of the project, and that there is no .git file but a .git/ directory so that we can read directly from .git/config. However, that is not necessarily true. We may be in a subdirectory. Or .git may be a gitfile. Or the

[PATCH v6 05/12] Introduce the discover_git_directory() function

2017-03-13 Thread Johannes Schindelin
We modified the setup_git_directory_gently_1() function earlier to make it possible to discover the GIT_DIR without changing global state. However, it is still a bit cumbersome to use if you only need to figure out the (possibly absolute) path of the .git/ directory. Let's just provide a

Possible git blame bug?

2017-03-13 Thread Domagoj Stolfa
Hello, yesterday I came across sort of a weird behaviour with git-blame. It would appear when one queries the git blame on a specific file, such as: $ git blame --since= it will blame the entire file on some commit of that year, regardless of the fact whether the commit has actually touched

[PATCH v6 04/12] setup_git_directory_1(): avoid changing global state

2017-03-13 Thread Johannes Schindelin
For historical reasons, Git searches for the .git/ directory (or the .git file) by changing the working directory successively to the parent directory of the current directory, until either anything was found or until a ceiling or a mount point is hit. Further global state may be changed in case

[PATCH v6 03/12] Prepare setup_discovered_git_directory() the root directory

2017-03-13 Thread Johannes Schindelin
Currently, the offset parameter (indicating what part of the cwd parameter corresponds to the current directory after discovering the .git/ directory) is set to 0 when we are running in the root directory. However, in the next patches we will avoid changing the current working directory while

[PATCH v6 00/12] Fix the early config

2017-03-13 Thread Johannes Schindelin
These patches are an attempt to make Git's startup sequence a bit less surprising. The idea here is to refactor setup_git_directory()'s code so that the underlying .git/ directory discovery can be run without changing any global state nor the current working directory, and then to use that

[PATCH v6 01/12] t7006: replace dubious test

2017-03-13 Thread Johannes Schindelin
The idea of the test case "git -p - core.pager is not used from subdirectory" was to verify that the setup_git_directory() function had not been called just to obtain the core.pager setting. However, we are about to fix the early config machinery so that it *does* work, without messing up the

[PATCH v6 02/12] setup_git_directory(): use is_dir_sep() helper

2017-03-13 Thread Johannes Schindelin
It is okay in practice to test for forward slashes in the output of getcwd(), because we go out of our way to convert backslashes to forward slashes in getcwd()'s output on Windows. Still, the correct way to test for a dir separator is by using the helper function we introduced for that very

[PATCH]v2 adding built-in driver for javascript

2017-03-13 Thread sourav mondal
javascript is one of the famous langugae,it's needs a built-in driver. As it was not present in the userdiff & this leads to the patch. first line consists of some of the well used javascript keywords.statements in js use one or many keywords like variable declaration, function

Re: git-push branch confusion caused by user mistake

2017-03-13 Thread Phil Hord
On Mon, Mar 13, 2017 at 1:55 AM Jacob Keller wrote: > On Fri, Mar 10, 2017 at 2:13 PM, Junio C Hamano wrote: > > Phil Hord writes: > >> I think git should be smarter about deducing the dest ref from the > >> source ref if the

Re: Stable GnuPG interface, git should use GPGME

2017-03-13 Thread Christian Neukirchen
"brian m. carlson" writes: > Because the amount of the gpg API we actually use is very small, a user > who wants to use a custom signature program (say, OpenBSD's signify), > can actually write a simple wrapper that mimics it and use that instead. FWIW, I did this,

Re: [PATCH] Put sha1dc on a diet

2017-03-13 Thread Jeff King
On Mon, Mar 13, 2017 at 07:42:17PM +, Dan Shumow wrote: > Marc just made a commit this morning fixing problems with the merge. > Please give the latest in feature/performance a try, as that seems to > eliminate the problem. Yeah, b17728507 makes the problem go away for me. Thanks. FWIW, I

Re: [PATCH v5 10/11] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Junio C Hamano
Johannes Schindelin writes: > PLEASE NOTE: the purpose of this patch series is to allow the same > function (setup_git_directory_gently_1()) to be the work horse for > setup_git_directory() as before, but also for the new > discover_git_directory() function that is

Re: [GSoC][PATCH 1/3] path.c: Add xdg_cache_home to get paths under XDG_CACHE_HOME

2017-03-13 Thread Devin Lehmacher
> And one final note. I notice that we return NULL if the user has no > HOME. But I'm not sure most callers are prepared to handle this. E.g., > if you have no ident set and no HOME, then we will pass NULL to lstat(). > On Linux at least that just gets you EFAULT, but I wouldn't be surprised > if

Re: [PATCH v5 10/11] setup_git_directory_gently_1(): avoid die()ing

2017-03-13 Thread Johannes Schindelin
Hi Junio, PLEASE NOTE: the purpose of this patch series is to allow the same function (setup_git_directory_gently_1()) to be the work horse for setup_git_directory() as before, but also for the new discover_git_directory() function that is introduced to fix read_early_config() to avoid hardconfig

Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use XDG_CACHE_HOME for credentials

2017-03-13 Thread Devin Lehmacher
> They wouldn't. It was my oblique way to say "it is unclear from the > patch description and the code why this is a good idea---it needs to > be explained better" ;-). Ok, I will submit a new patch with a better explanation. Devin

Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use XDG_CACHE_HOME for credentials

2017-03-13 Thread Devin Lehmacher
> I somehow feel that the order of precedence should be the other way > around, though. > > If somebody really wants to use the xdg location and has a socket > already there, using that existing socket would be the right thing > to do. However, when neither ~/.git-credential-cache/socket nor

Re: 'git add --patch' no longer allows you to select files before selecting patches

2017-03-13 Thread Junio C Hamano
Jeff King writes: > My, this seems to be a popular bug. This is the third report already. :) > > The answer to your final question is that it's a bug. The fix is in > c852bd54bd87fdcdc825f5d45c26aa745be13ba6, which is currently in the > "master" branch of git.git. If only more

Re: 'git add --patch' no longer allows you to select files before selecting patches

2017-03-13 Thread Junio C Hamano
Anthony Scian writes: > Similarly the patch sub-command in ‘git add —interactive’ goes > immediately to selecting patches starting with the first file. Is > there a git configuration that would being back the old behaviour? > Why was this changed? Because people are careless

Re: [RFC][PATCH] index-pack: add testcases found using AFL

2017-03-13 Thread Vegard Nossum
On 13/03/2017 18:11, Junio C Hamano wrote: Vegard Nossum writes: However, I think it's more useful to think of these testcases not as "binary test that nobody knows what they are doing", but as "(sometimes invalid) packfiles which tickle interesting code paths in the

Re: 'git add --patch' no longer allows you to select files before selecting patches

2017-03-13 Thread Jeff King
On Mon, Mar 13, 2017 at 02:51:52PM -0400, Anthony Scian wrote: > Similarly the patch sub-command in ‘git add —interactive’ goes > immediately to selecting patches starting with the first file. > Is there a git configuration that would being back the old behaviour? > Why was this changed? My,

Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use XDG_CACHE_HOME for credentials

2017-03-13 Thread Junio C Hamano
Jeff King writes: > On Mon, Mar 13, 2017 at 11:09:11AM -0700, Junio C Hamano wrote: > >> > + if (home_socket) >> > + if (file_exists(home_socket)) >> > + return home_socket; >> > + else >> > + free(home_socket); >> > + >> > +

Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use XDG_CACHE_HOME for credentials

2017-03-13 Thread Jeff King
On Mon, Mar 13, 2017 at 11:09:11AM -0700, Junio C Hamano wrote: > > + if (home_socket) > > + if (file_exists(home_socket)) > > + return home_socket; > > + else > > + free(home_socket); > > + > > + return

Re: [PATCH] difftool: handle changing symlinks in dir-diff mode

2017-03-13 Thread Junio C Hamano
David Aguilar writes: > - if (S_ISLNK(lmode)) { > + if (S_ISLNK(lmode) && !is_null_oid()) { > char *content = read_sha1_file(loid.hash, , ); > add_left_or_right(, src_path, content, 0); >

  1   2   >