Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 04, 2015 at 10:55:32AM -0800, Junio C Hamano wrote:

> >> +	int ignore_sighup = 0;
> >> +	git_config_get_bool("credentialcache.ignoresighup", &ignore_sighup);
> >> +
> >
> > Style-wise, I think the declaration should go above the options-list.
> 
> I was about to merge this to 'master', following your last issue of
> "What's cooking" report.
> 
> I was puzzled that git_config_get_bool() is used here without even
> checking if we are inside any Git repository and wondered if it was
> correct.  I'd imagine this is not a problem, as this process is
> spawned by "credential-cache" that was spawned by somebody (either
> push or fetch) who has read $GIT_DIR/config for credential.helper to
> determine that credential-cache needs to be used.

That does not have to be the case; I imagine most people would put
credential.helper in their ~/.gitconfig.

But I'm not sure I understand how that is relevant. The config subsystem
should work just fine whether we are in a repository or not (and if not,
return results only from system and user-wide config).

This probably _does_ trigger setup_git_env() when it was not otherwise
called, and it will back to looking at ".git/config" for the repo-level
config. That may fail to find the file if we are in a bare repository,
or a subdirectory of the working tree. IOW, I suspect this:

  git init --bare foo.git
  cd foo.git
  git config credential.helper cache
  git config credentialcache.ignoreSIGHUP true ;# goes into local config
  git fetch https://example.com/foo.git

may fail to respect the ignoreSIGHUP option.

I guess the solution would be to setup_git_director_gently() in the
daemon process.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]