config --global --edit: create a template file if needed
commit9830534e40bd15231357965441d4fe02a6a4810e
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Fri, 25 Jul 2014 19:11:34 +0000 (25 21:11 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Jul 2014 19:23:06 +0000 (25 12:23 -0700)
tree964385ea647fd36afc22d792c8541b460405a838
parent740c281d21ef5b27f6f1b942a4f2fc20f51e8c7e
config --global --edit: create a template file if needed

When the user has no ~/.gitconfig file, git config --global --edit used
to launch an editor on an nonexistant file name.

Instead, create a file with a default content before launching the
editor. The template contains only commented-out entries, to save a few
keystrokes for the user. If the values are guessed properly, the user
will only have to uncomment the entries.

Advanced users teaching newbies can create a minimalistic configuration
faster for newbies. Beginners reading a tutorial advising to run "git
config --global --edit" as a first step will be slightly more guided for
their first contact with Git.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c
cache.h
ident.c