Skip to content

Commit

Permalink
dev-vcs/git-imerge: initial import of version 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Ospald committed Aug 13, 2015
1 parent d2db324 commit 6b77a54
Show file tree
Hide file tree
Showing 4 changed files with 314 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-vcs/git-imerge/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST git-imerge-0.7.0.tar.gz 52040 SHA256 0688fe4c13c65c6fa90989c57c04fafe34114889d2d100b6e62538e8f2b0dc02 SHA512 140fd1b056097ff59848c4312ca02a1bd9ff136b7680e25b8575d3824c9b189fb2f8de2b5100966f774f003bb538f1e649e758edf5ab4bd3b1f9b824645738c4 WHIRLPOOL ab8e412039b82d2d057cba7c4ffe3a392653e88cb2b0492cd7a1da57896e59115c5e4d737b6389ddcf177d0c30ef4d4dc0722d9dc16bd93f6647016ff488588f
267 changes: 267 additions & 0 deletions dev-vcs/git-imerge/files/git-imerge.bashcomplete
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
__git_imerge_branches () {
git for-each-ref --format='%(refname)' refs/heads/ refs/remotes/ 2>/dev/null |
sed -e 's!^refs/heads/!!' -e 's!^refs/remotes/!!'
}

__git_imerge_names () {
git for-each-ref --format='%(refname)' refs/imerge/ 2>/dev/null |
sed -e 's/^refs\/imerge\/\(.*\)\/.*/\1/' -e '/manual/d' -e '/auto/d'
}

__git_imerge_goals="\
merge
rebase
rebase-with-history
full
"

__git_imerge_commands="\
start
merge
rebase
continue
finish
diagram
list
init
record
autofill
simplify
remove
reparent
"

__git_imerge_start_options="\
--help
--manual
--name
--branch
--goal
--first-parent
"

__git_imerge_init_options=$__git_imerge_start_options

__git_imerge_continue_options="\
--help
--name
--edit
--no-edit
"

__git_imerge_finish_options="\
--help
--name
--goal
--branch
--force
"

__git_imerge_simplify_options=$__git_imerge_finish_options

__git_imerge_merge_options="\
--help
--name
--goal
--branch
--manual
"

__git_imerge_list_options="\
--help
"

__git_imerge_reparent_options=$__git_imerge_list_options

__git_imerge_record_options="\
--help
--name
--edit
--no-edit
"

__git_imerge_autofill_options="\
--help
--name
"

__git_imerge_diagram_options="\
--help
--name
--commits
--frontier
--html
--color
--no-color
"

__git_imerge_remove_options=$__git_imerge_autofill_options

__git_imerge_rebase_options=$__git_imerge_merge_options

__git-imerge_start_completion() {
case "$1_$cur" in
--help_|--branch_|_--branch=|--name_|_--name=)
return
;;
--goal_*|*_--goal=*)
__gitcomp "$__git_imerge_goals" "" "${cur##--goal=}"
return
;;
*-|*_-*?)
__gitcomp "$__git_imerge_start_options"
return
;;
esac
__gitcomp "$(__git_imerge_branches)"
}

__git-imerge_init_completion() {
__git-imerge_start_completion $1
}

__git-imerge_continue_completion() {
case "$1_$cur" in
--help_)
return
;;
--name_*|*_--name=*)
__gitcomp "$(__git_imerge_names)" "" "${cur##--name=}"
return
;;
esac
__gitcomp "$__git_imerge_continue_options"
}

__git-imerge_finish_completion() {
case "$1_$cur" in
--help_)
return
;;
--goal_*|*_--goal=*)
__gitcomp "$__git_imerge_goals" "" "${cur##--goal=}"
return
;;
--branch_*|*_--branch=*)
__gitcomp "$(__git_imerge_branches)" "" "${cur##--branch=}"
return
;;
--name_*|*_--name=*)
__gitcomp "$(__git_imerge_names)" "" "${cur##--name=}"
return
;;
esac
__gitcomp "$__git_imerge_finish_options"
}

__git-imerge_simplify_completion() {
__git-imerge_finish_completion $1
}

__git-imerge_merge_completion() {
case "$1_$cur" in
--help_|--branch_|_--branch=|--name_|_--name=)
return
;;
--goal_*|*_--goal=*)
__gitcomp "$__git_imerge_goals" "" "${cur##--goal=}"
return
;;
*-|*_-*?)
__gitcomp "$__git_imerge_merge_options"
return
;;
esac
__gitcomp "$(__git_imerge_branches)"
}

__git-imerge_rebase_completion() {
__git-imerge_merge_completion $1
}

__git-imerge_list_completion() {
case "$1" in
--help)
return
;;
esac
__gitcomp "$__git_imerge_list_options"
}

__git-imerge_reparent_completion() {
__git-imerge_list_completion $1
}

__git-imerge_record_completion() {
case "$1_$cur" in
--help_)
return
;;
--name_*|*_--name=*)
__gitcomp "$(__git_imerge_names)" "" "${cur##--name=}"
return
;;
esac
__gitcomp "$__git_imerge_record_options"
}

__git-imerge_autofill_completion() {
case "$1_$cur" in
--help_)
return
;;
--name_*|*_--name=*)
__gitcomp "$(__git_imerge_names)" "" "${cur##--name=}"
return
;;
esac
__gitcomp "$__git_imerge_autofill_options"
}

__git-imerge_remove_completion() {
__git-imerge_autofill_completion $1
}

__git-imerge_diagram_completion() {
case "$1_$cur" in
--help_|--html_|_--html=)
return
;;
--name_*|*_--name=*)
__gitcomp "$(__git_imerge_names)" "" "${cur##--name=}"
return
;;
esac
__gitcomp "$__git_imerge_diagram_options"
}

_git_imerge () {
# Disable default filename completion. Note that "compopt" is only
# available in Bash 4 and newer, so we check for existence before
# trying to use it.
type compopt >/dev/null 2>&1 && compopt +o default +o bashdefault

local i command cur_opt
for ((i=0; i <= ${cword}; i++)); do
if [ -n "$command" ] && [ "${words[i]}" != "$cur" ]; then
cur_opt="${words[i]}"
fi
if [ -z "$command" ] && \
[ "$i" -lt "${cword}" ] && \
[[ "${words[i-1]}" == *"imerge"* ]]
then
command="${words[i]}"
fi
done

if test -z "$command"; then
__gitcomp "$__git_imerge_commands"
return
fi

if [ -z `type -t __git-imerge_"$command"_completion "$cur_opt"` ]; then
return
fi

__git-imerge_"$command"_completion "$cur_opt"
}
38 changes: 38 additions & 0 deletions dev-vcs/git-imerge/git-imerge-0.7.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

PYTHON_COMPAT=( python2_7 python3_3 python3_4 )

inherit bash-completion-r1 python-r1

DESCRIPTION="Incremental merge for git"
HOMEPAGE="https://github.com/mhagger/git-imerge"
SRC_URI="https://github.com/mhagger/git-imerge/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="${PYTHON_DEPS}"
DEPEND="dev-python/docutils"

src_compile() {
rst2html.py README.rst > README.html || die
rst2s5.py \
--theme=small-white \
--current-slide \
doc/presentations/GitMerge-2013/talk.rst doc/presentations/GitMerge-2013/talk.html || die
}

src_install() {
dobin ${PN}
python_replicate_script "${D}"/usr/bin/${PN}
newbashcomp "${FILESDIR}"/git-imerge.bashcomplete git-imerge
dodoc README.rst
dohtml README.html doc/presentations/GitMerge-2013/talk.html
}
8 changes: 8 additions & 0 deletions dev-vcs/git-imerge/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>[email protected]</email>
<name>Julian Ospald</name>
</maintainer>
</pkgmetadata>

0 comments on commit 6b77a54

Please sign in to comment.