Skip to content

Commit eb8914d

Browse files
committed
Add remote "origin" to point to Salsa in .git/config
to save the user from doing so manually.
1 parent 316d1d0 commit eb8914d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

make.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
410410
if err := runGitCommandIn(dir, "config", "push.default", "matching"); err != nil {
411411
return dir, err
412412
}
413+
414+
originURL := "[email protected]:go-team/packages/" + debsrc + ".git"
415+
log.Printf("Adding remote \"origin\" with URL %q\n", originURL)
416+
if err := runGitCommandIn(dir, "remote", "add", "origin", originURL); err != nil {
417+
return dir, err
418+
}
413419
if err := runGitCommandIn(dir, "config", "--add", "remote.origin.push", "+refs/heads/*:refs/heads/*"); err != nil {
414420
return dir, err
415421
}
@@ -422,7 +428,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
422428
if err != nil {
423429
return dir, fmt.Errorf("Unable to fetch upstream history: %q", err)
424430
}
425-
log.Printf("Adding %q as remote %q\n", u.rr.Repo, u.remote)
431+
log.Printf("Adding remote %q with URL %q\n", u.remote, u.rr.Repo)
426432
if err := runGitCommandIn(dir, "remote", "add", u.remote, u.rr.Repo); err != nil {
427433
return dir, err
428434
}
@@ -953,7 +959,6 @@ func execMake(args []string, usage func()) {
953959
fmt.Printf(" dh-make-golang create-salsa-project %s\n", debsrc)
954960
fmt.Printf("\n")
955961
fmt.Printf("Once you are happy with your packaging, push it to salsa using:\n")
956-
fmt.Printf(" git remote set-url origin [email protected]:go-team/packages/%s.git\n", debsrc)
957962
fmt.Printf(" gbp push\n")
958963
fmt.Printf("\n")
959964

0 commit comments

Comments
 (0)