Skip to content

Commit 5e03393

Browse files
committed
Add warning when source version control system is not git
1 parent 56436ac commit 5e03393

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmd/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type sourceVCSConfig struct {
3737
AutoCommit bool
3838
AutoPush bool
3939
Init interface{}
40+
NotGit bool
4041
Pull interface{}
4142
}
4243

cmd/root.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"os"
6+
"path/filepath"
67
"strings"
78

89
"github.com/coreos/go-semver/semver"
@@ -93,6 +94,13 @@ func init() {
9394
"warning: to disable this warning, set gpg.recipient in your config file instead\n",
9495
)
9596
}
97+
if config.SourceVCS.Command != "" && !config.SourceVCS.NotGit && !strings.Contains(filepath.Base(config.SourceVCS.Command), "git") {
98+
rootCmd.Printf("" +
99+
"warning: it looks like you are using a version control system that is not git which will be deprecated in v2\n" +
100+
"warning: please report this at https://github.com/twpayne/chezmoi/issues/459\n" +
101+
"warning: to disable this warning, set sourceVCS.notGit = true in your config file\n",
102+
)
103+
}
96104
case os.IsNotExist(err):
97105
default:
98106
printErrorAndExit(err)

0 commit comments

Comments
 (0)