Re: git should not use a default user.email config value

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

 



On Wed, Aug 14, 2013 at 09:09:05AM +0200, Michael Haggerty wrote:

> Gaaak!  Let me again plead for supporting a post-clone hook rather than
> inventing some crazy config-file syntax that is becoming ever more
> complicated.  A post-clone hook would make all of these things that have
> been suggested pretty easy, and would also open lots of other
> possibilities, all without further changes in git.core, like (I'm just
> brainstorming here):

My problem with a post-clone hook is that it only runs once, and then
potentially goes stale.  For example:

>     ln -s $(HOME)/.githooks/* .git/hooks

Because of the symlink, this tracks hooks as they are updated, but what
happens when you add a new hook (or delete one)? You have to manually
hunt down each repository using it and update the links. You can get it
around it by replacing and symlinking the whole hook directory, though.

>     case "$(git --version)" in
>     *.1.[78].*)
>         git config include.path "$(HOME)/.gitinclude
>         ;;
>     esac

What happens when you upgrade (or downgrade) your git, or even use
multiple versions interleaved? You need to revisit this version check.

>     echo "(cd $(pwd) && git gc)" >>"$(HOME)/cron.weekly/git-gc"

What happens when you move your repository to a different directory? You
have to manually fix up the generated cron script.

>     case "$remote" in
>     *.work.com/*)
>         git config user.email me@xxxxxxxx
>         ;;
>     *.github.com/*)
>         git config user.email me@xxxxxxxxxx
>         ;;
>     *)
>         echo '### Remember to set user.email ###'
>         ;;
>     esac

What happens when you update your address? You have to manually fix up
each repository.

I agree that running arbitrarily shell code is the most flexible thing,
but I think in many cases users would prefer to have something that
makes decisions at runtime, rather than having to remember to update
existing repositories with changes. That can be shell code, too, though
there are complications (performance and security come to mind).

I do not see the two features as necessarily an either-or; they can
accomplish the same thing, but with different tradeoffs in complexity
for the user.

-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]