Created
July 19, 2019 12:57
-
-
Save vkareh/d96e28b46eafe153bd33049b836a4c6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = true | |
[push] | |
default = simple | |
[core] | |
editor = vim | |
excludesfile = ~/.gitignore | |
autocrlf = input | |
[grep] | |
lineNumber = true | |
[diff] | |
tool = meld | |
[merge] | |
tool = meld | |
[alias] | |
st = status -uno | |
dif = diff | |
tree = log --pretty=oneline --abbrev-commit --graph --decorate | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
sync = !git checkout master && git fetch upstream && git pull upstream master && git push | |
backport-file = "!f(){ for f in $(git diff --name-only --diff-filter=A ${1}^1..${1}); do git cat-file -p $(git ls-tree ${1} ${f} | awk '{print $3}') > ${f}; git add ${f}; done; }; f" | |
backport-url = "!f() { echo '\nupstream commit:'; git remote -v | awk '{print $2}' | sed -e 's|:|/|' | sed -e 's|git@|https://|' | sed -e 's|.git$|/commit/|' | uniq; git rev-parse --short ${1}; }; f" | |
backport = "!f(){ git backport-file ${1} ; git difftool -d ${1}^1..${1} & git difftool -d ${1} -- $(git diff --name-only ${1}^1..${1}); git log ${1}^1..${1} | tail --lines=+5 | sed -e 's|^ ||'; git backport-url ${1}; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use the backport commit (using caja as an example)
Now the upstream project is set up as a remote in the downstream. Then:
This will open two instances of
meld
: one with the change within nautilus, as reference, and one instance from nautilus to caja. Think of it as a poor-man's three-way diff. Once the right lines are moved from nautilus to caja, closemeld
and this will show up in terminal:So you copy that thing and run
git commit -a
and paste that, removing the caja line to append the hash to the nautilus URL, ending with the following commit message: