zshrc: Add fl2git command to export Fossil -> Git
This commit is contained in:
parent
6fdf035b54
commit
39eb3eaaf0
1 changed files with 27 additions and 0 deletions
27
zshrc
27
zshrc
|
@ -247,6 +247,33 @@ if which fossil &>/dev/null; then
|
||||||
$=importmarks_fossil \
|
$=importmarks_fossil \
|
||||||
$repo
|
$repo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fl2git() {
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
local gitdir="$1/.git"
|
||||||
|
else
|
||||||
|
local gitdir=$(git rev-parse --show-toplevel)/.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -f "$gitdir/git.marks" ] &&
|
||||||
|
local importmarks_git="--import-marks=$gitdir/git.marks"
|
||||||
|
|
||||||
|
if [ -f "$gitdir/fossil.marks" ]; then
|
||||||
|
local incremental="--incremental"
|
||||||
|
local importmarks_fossil
|
||||||
|
importmarks_fossil="--import-marks $gitdir/fossil.marks"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LC_ALL=C fossil export \
|
||||||
|
--git \
|
||||||
|
$=incremental \
|
||||||
|
--rename-trunk master \
|
||||||
|
--export-marks $gitdir/fossil.marks \
|
||||||
|
$=importmarks_fossil |
|
||||||
|
LC_ALL=C git fast-import \
|
||||||
|
--export-marks=$gitdir/git.marks \
|
||||||
|
$=importmarks_git
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pkgsrc does not like MAKEFLAGS including -j
|
# pkgsrc does not like MAKEFLAGS including -j
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue