Compare commits

...
6 Commits
12 changed files with 53 additions and 112 deletions
+1
View File
@@ -5,3 +5,4 @@ notes/go.notes
TODO.notes
TODO.md
test/testrepo/
test/repos/repo
Generated
-1
View File
@@ -289,7 +289,6 @@
"github.com/tcnksm/go-gitconfig",
"gopkg.in/src-d/go-git.v4",
"gopkg.in/src-d/go-git.v4/plumbing",
"gopkg.in/src-d/go-git.v4/plumbing/object",
]
solver-name = "gps-cdcl"
solver-version = 1
+1 -1
View File
@@ -1 +1 @@
v0.1.52
v0.1.54
+1 -18
View File
@@ -8,12 +8,10 @@ import (
"os"
"os/exec"
"strings"
"time"
"github.com/jesseduffield/gocui"
gitconfig "github.com/tcnksm/go-gitconfig"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)
var (
@@ -418,22 +416,7 @@ func gitCommit(g *gocui.Gui, message string) (string, error) {
runSubProcess(g, "git", "commit")
return "", nil
}
userName, err := gitconfig.Username()
if userName == "" {
return "", errNoUsername
}
userEmail, err := gitconfig.Email()
_, err = w.Commit(message, &git.CommitOptions{
Author: &object.Signature{
Name: userName,
Email: userEmail,
When: time.Now(),
},
})
if err != nil {
return err.Error(), err
}
return "", nil
return runDirectCommand("git commit -m \"" + message + "\"")
}
func gitPull() (string, error) {
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
# this script makes a repo with lots of commits
# call this command from the test directory:
# ./lots_of_commits.sh; cd testrepo; gg; cd ..
# -e means exit if something fails
# -x means print out simple commands before running them
set -ex
reponame="case_insensitive_checkouts"
rm -rf ${reponame}
mkdir ${reponame}
cd ${reponame}
git init
touch foo
git add foo
git commit -m "init"
git branch -a
git branch test
git branch TEST
git checkout TEST
git checkout TeST
git checkout TesT
git checkout TEsT
git branch -a
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
# this script makes a repo with lots of commits
# call this command from the test directory:
# ./lots_of_commits.sh; cd testrepo; gg; cd ..
# -e means exit if something fails
# -x means print out simple commands before running them
set -ex
reponame="lots_of_commits"
rm -rf ${reponame}
mkdir ${reponame}
cd ${reponame}
git init
i=2
end=100
while [ $i -le $end ]; do
echo "file${i}" > file${i}
git add file${i}
git commit -m file${i}
i=$(($i+1))
done
echo "unstaged change" > file100
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -ex; rm -rf repo; mkdir repo; cd repo
git init
touch foo
git add foo
git commit -m "init"
git branch -a
git branch test
git branch TEST
git checkout TEST
git checkout TeST
git checkout TesT
git checkout TEsT
git branch -a
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
echo "test1"
sleep 1
echo "test2"
sleep 1
echo "test3"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -ex; rm -rf repo; mkdir repo; cd repo
git init
i=2
end=100
while [ $i -le $end ]; do
echo "file${i}" > file${i}
git add file${i}
git commit -m file${i}
i=$(($i+1))
done
echo "unstaged change" > file100
@@ -1,20 +1,5 @@
#!/bin/bash
# this script will make a repo with a master and develop branch, where we end up
# on the master branch and if we try and merge master we get a merge conflict
# call this command from the test directory:
# ./merge_conflict.sh; cd testrepo; gg; cd ..
# -e means exit if something fails
# -x means print out simple commands before running them
set -ex
reponame="merge_conflict"
rm -rf ${reponame}
mkdir ${reponame}
cd ${reponame}
set -ex; rm -rf repo; mkdir repo; cd repo
git init
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -ex; rm -rf repo; mkdir repo; cd repo
git init
cp ../pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "file" > file
git add file
@@ -1,20 +1,5 @@
#!/bin/bash
# this script will make a repo with a master and develop branch, where we end up
# on the master branch and if we try and merge master we get a merge conflict
# call this command from the test directory:
# ./generate_basic_repo.sh; cd testrepo; gg; cd ..
# -e means exit if something fails
# -x means print out simple commands before running them
set -ex
reponame="unicode_characters"
rm -rf ${reponame}
mkdir ${reponame}
cd ${reponame}
set -ex; rm -rf repo; mkdir repo; cd repo
git init