From ac3eb1c38420b356b775ed63f7291eb4054d11d9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 10 Jun 2012 00:26:35 -0700 Subject: completion: warn people about duplicated function The __gitdir function is duplicated between completion and prompt scripts, and these definitions should not diverge; otherwise one of them can be subtly broken depending on the order the user's shell dot-sources them. Leave a note to people who may want to touch one copy to make sure they update the other one in sync. Hopefully this line would also appear in the context of the patch to allow reviewers to notice a patch that attempts to update only one of them. Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/completion/git-completion.bash') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index abf8215dd..efcd875f9 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -36,6 +36,8 @@ esac # returns location of .git repo __gitdir () { + # Note: this function is duplicated in git-prompt.sh + # When updating it, make sure you update the other one to match. if [ -z "${1-}" ]; then if [ -n "${__git_dir-}" ]; then echo "$__git_dir" -- cgit v1.2.1