[git] diff for doc

This commit is contained in:
Mathieu Maret 2019-06-20 14:20:27 +02:00
parent 07d36f6e29
commit 16ab96e480
2 changed files with 45 additions and 2 deletions

View File

@ -36,17 +36,58 @@
rbi = !sh -c \"git rebase -i `git merge-base $1 HEAD`\" -
cleanbr = remote prune origin
cleanbrshow = remote prune origin --dry-run
cleanupbr = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"
contains = !sh -c 'git branch -a --contains $1' -
wdiff = diff --word-diff=color --unified=1
first = rev-list --max-parents=0 HEAD # or use log --reverse
rebasestash = rebase --autostash # stash before rebase if needed
#Gitlab checkout merge request. e.g. get MR 5 on remote upstream git mr upstream 5
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
#Git reset upstream
ru = "!f() { \
REMOTES=$(git remote); \
REMOTE=\"origin\"; \
case \"$REMOTES\" in \
*upstream*) \
REMOTE=\"upstream\"; \
;; \
esac; \
git fetch $REMOTE; \
git update-ref refs/heads/master refs/remotes/$REMOTE/master; \
git checkout master >/dev/null 2>&1; \
git reset --hard $REMOTE/master >/dev/null 2>&1; \
git checkout - >/dev/null 2>&1; \
}; f"
[branch]
#New branch track remote
#autoSetupMerge = always
#autosetupmerge = always
# Rebase on git pull
#autosetuprebase = always
# in .gitattributes
# *.doc diff=word
# *.xsl diff=excel
# *.xlsx diff=zip
# *.docx diff=wordx
# *.png diff=exif
[diff "odf"]
textconv=odt2txt
[diff "odt"]
textconv=odt2txt
[diff "pandoc"]
textconv=pandoc --to=markdown
prompt = false
[diff "wordx"]
textconv = docx2txt_wrap
[diff "word"]
textconv = catdoc
[diff "excel"]
textconv = strings
[diff "zip"]
textconv = unzip -c -a
[diff "exif"]
textconv = exiftool
[difftool "meld"]
path = /usr/bin/meld
trustExitCode = false

2
scripts/docx2txt_wrap Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docx2txt $1 -