git: simplify bisect

This commit is contained in:
Rico Sta. Cruz 2015-10-05 04:28:42 +08:00
parent ffd235165e
commit 62a524d54c
4 changed files with 30 additions and 22 deletions

25
git.md
View File

@ -100,29 +100,22 @@ Misc
## Bisect
git bisect start HEAD HEAD~6
git bisect run npm test
git checkout refs/bisect/bad # this is where it screwed up
git bisect reset
### Manual bisection
git bisect start
git bisect bad # current version is bad
git bisect good # current version is good
git checkout HEAD~8
npm test # see if it's good
git bisect good # current version is good
git bisect run npm test
git bisect bad # current version is bad
git bisect reset # abort
### Quicker
git bisect start
git bisect bad # mark commit as bad
git checkout HEAD~10
git bisect good # mark commit as good
git bisect reset # stop
git bisect start HEAD HEAD~10 # same as bad HEAD, good HEAD~10
git bisect run make
git bisect reset
## Searching
git log --grep="fixes things" # search in commit messages

View File

@ -12,7 +12,7 @@ Use https://github.com/settings/tokens/new
```sh
# via ruby
gem install travis
travis encrypt -r user/repo GH_TOKEN=[the token here]
travis encrypt -r user/repo GITHUB_TOKEN=[the token here]
```
### Make it run the deploy script on deploy
@ -23,7 +23,7 @@ script:
- bash ./scripts/deploy-to-gh-pages.sh
env:
global:
- GH_REF: "github.com/user/repo.git"
- GITHUB_REPO: "user/repo"
- secure: "nlnXJW/imf/w..." # <-- from travis-encrypt
```
@ -51,7 +51,7 @@ cd public
git init
git add .
git commit -m "Deploy to Github Pages"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
git push --force --quiet "https://${GITHUB_TOKEN}@$github.com/${GITHUB_REPO}.git" master:gh-pages > /dev/null 2>&1
```
From Ractive, this might be useful in certain cases:

View File

@ -148,7 +148,7 @@ Functions
### Strings
if a =~ '\s*'
subst(str, '.', 'x', 'g')
substitute(str, '.', 'x', 'g')
strpart("abcdef", 3, 2) " == "de" (substring)
strpart("abcdef", 3) " == "def"
stridx("abcdef", "e") " == "e"
@ -166,6 +166,10 @@ Functions
strwidth() " accounts for ambig characters
strdisplaywidth() " accounts for tab stops
toupper(str)
tolower(str)
tr('foo', '_-', ' ')
### Syntax
synstack(line('.'),col('.')) " returns many
@ -187,6 +191,17 @@ Functions
getreg('*')
getregtype('*') " v(char), V(line) <ctrl-v>(block)
Comparisons
-----------
if name ==# 'John' " case-sensitive
if name ==? 'John' " case-insensitive
if name == 'John' " depends on :set ignorecase
" also: is#, is?, >=#, >=?, and so on
if "hello" =~ '.*'
if "hello" !~ '.*'
Executing
---------

View File

@ -11,7 +11,7 @@ title: Vimscript snippets
### Call a function in insert mode
inoremap X <CR>=script#myfunction()<CR>
inoremap X <C-R>=script#myfunction()<CR>
inoremap <F2> <C-R>=MyVimFunc()?'':''<CR>
### Checking plugins