zshrc: Add git2fl command to import Git -> Fossil
This commit is contained in:
parent
84c11996c6
commit
1850ff44ff
1 changed files with 31 additions and 0 deletions
31
zshrc
31
zshrc
|
@ -216,6 +216,37 @@ if which fossil &>/dev/null; then
|
||||||
sed "s/^-.*$/$red&$reset/" | less -FRX
|
sed "s/^-.*$/$red&$reset/" | less -FRX
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git2fl() {
|
||||||
|
local gitdir=$(git rev-parse --show-toplevel)/.git
|
||||||
|
local repo=$(fossil info | awk '/^repository:/ { print $2 }')
|
||||||
|
|
||||||
|
[ -z "$repo" ] && repo="$1"
|
||||||
|
|
||||||
|
[ -n "$repo" -a -f "$repo" ] &&
|
||||||
|
local incremental="--incremental"
|
||||||
|
|
||||||
|
[ -d "$gitdir/git.marks" ] &&
|
||||||
|
local importmarks_git="--import-marks=$gitdir/git.marks"
|
||||||
|
|
||||||
|
if [ -d "$gitdir/fossil.marks" ]; then
|
||||||
|
local importmarks_fossil
|
||||||
|
importmarks_fossil="--import-marks $gitdir/fossil.marks"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LC_ALL=C git fast-export \
|
||||||
|
--signed-tags=warn-strip \
|
||||||
|
--export-marks=$gitdir/git.marks \
|
||||||
|
$=importmarks_git \
|
||||||
|
--all |
|
||||||
|
LC_ALL=C fossil import \
|
||||||
|
--git \
|
||||||
|
$=incremental \
|
||||||
|
--rename-master trunk \
|
||||||
|
--export-marks $gitdir/fossil.marks \
|
||||||
|
$=importmarks_fossil \
|
||||||
|
$repo
|
||||||
|
}
|
||||||
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