Skip to content

Commit b10a8fb

Browse files
Merge pull request #40 from rohieb/tig
tig: add subcommand to browse an umpf and its context interactively
2 parents 09bc9e6 + 4487787 commit b10a8fb

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _umpf_completion()
3838
"")
3939
COMPREPLY=( $( compgen -W "${completion_cmds[*]} help" -- $cur ) )
4040
;;
41-
diff|show|tag|build)
41+
diff|show|tag|tig|build)
4242
local -a refs
4343
refs=( $( compgen -W "$( git for-each-ref --format='%(refname:short)' refs/tags refs/heads refs/remotes)" -- $cur ) )
4444
if [ ${#refs[@]} -eq 0 ]; then

umpf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ usage() {
200200
diff <commit-ish> show patches not in any topic branch (not
201201
upstream) and patches missing locally
202202
show <commit-ish> show an useries file from an umpf
203+
tig [umpf] browse an umpf interactively, showing state of
204+
local, remote and remote-tracking topic branches
203205
204206
tag <commit-ish> generate a utag from an umerge
205207
format-patch <utag> generate a useries file and patch stack
@@ -1874,6 +1876,38 @@ do_show() {
18741876
cleanup
18751877
}
18761878
1879+
### namespace: tig ###
1880+
1881+
tig_topic() {
1882+
${GIT} show-ref -s "${content}" >> "${STATE}/refs"
1883+
}
1884+
1885+
tig_release() {
1886+
echo "${content}" >> "${STATE}/refs"
1887+
}
1888+
1889+
tig_hashinfo() {
1890+
echo "${content}" >> "${STATE}/refs"
1891+
}
1892+
1893+
### command: tig ###
1894+
1895+
do_tig () {
1896+
local -a refs
1897+
local base
1898+
1899+
prepare_persistent tig "${@}"
1900+
parse_series tig "${STATE}/series"
1901+
1902+
mapfile -t refs < "${STATE}/refs"
1903+
base="$(<"${STATE}/base-name")"
1904+
1905+
# cut off each ref at base
1906+
tig ^"${base}"^ "${refs[@]}"
1907+
1908+
cleanup
1909+
}
1910+
18771911
### command: init ###
18781912
18791913
do_init() {

0 commit comments

Comments
 (0)