]> git.phdru.name Git - git-scripts.git/commitdiff
Use `git var GIT_EDITOR` to call editor
authorOleg Broytman <phd@phdru.name>
Thu, 4 Aug 2016 23:44:29 +0000 (02:44 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 4 Aug 2016 23:44:29 +0000 (02:44 +0300)
`git var GIT_EDITOR` is better than ${VISUAL:-${EDITOR:-vi}} because
it takes into account all variables: GIT_EDITOR, VISUAL and EDITOR,
and falls back to the platform's default.

clone2current
edit-description
publish2web
svn/svn2git

index 4927783cbdfd6db59ba9a9526066d323c93f0628..92590b97f73562f4255a2ca31f5e77d9539189d0 100755 (executable)
@@ -25,7 +25,7 @@ cd "$dest_dir" &&
 if [ "`cat \"$source_dir\"/.git/description`" = \
    "Unnamed repository; edit this file 'description' to name the repository." ]
 then
-   "${VISUAL:-${EDITOR:-vi}}" "$source_dir"/.git/description .git/description
+   `git var GIT_EDITOR` "$source_dir"/.git/description .git/description
 else
    cp -p "$source_dir"/.git/description .git
 fi &&
index 547b2480ba2af032bd4999963ced79270bbedb5a..3311bb9cd50269698547a2757e8e2940c2eccd14 100755 (executable)
@@ -2,4 +2,4 @@
 
 exec "`dirname \"$0\"`"/do-all \
    'test "`cat $g/description`" = "Unnamed repository; edit this file '"'"description"'"' to name the repository." &&
-   "${VISUAL:-${EDITOR:-vi}}" "$g"/description < /dev/tty'
+   `git var GIT_EDITOR` "$g"/description < /dev/tty'
index b7bd785d17b33f68678c24b9ecb535fda4ca671f..1847f7a8a4d66db22c3ea977dc69f8fe397dbd52 100755 (executable)
@@ -26,7 +26,7 @@ cp -p "$HOME"/Internet/WWW/htdocs/git.phdru.name/phdru.name/phdru.name.git/git-d
 if [ "`cat \"$source_dir\"/.git/description`" = \
    "Unnamed repository; edit this file 'description' to name the repository." ]
 then
-   "${VISUAL:-${EDITOR:-vi}}" "$source_dir"/.git/description description
+   `git var GIT_EDITOR` "$source_dir"/.git/description description
 else
    cp -p "$source_dir"/.git/description . && chmod a+r description
 fi &&
index dde280f4f77b485960389d3b960100619ddf9e27..5c68c17248f5bad2765fa81eaf128e9cb5c16987 100755 (executable)
@@ -58,4 +58,4 @@ git svn gc &&
 git gc --aggressive &&
 git repack -a -d -f --depth=20 --window=250 &&
 echo "Cloned from $url using git-svn" >.git/description &&
-exec "${VISUAL:-${EDITOR:-vi}}" .git/description
+exec `git var GIT_EDITOR` .git/description