Skip to content

Instantly share code, notes, and snippets.

@uprego
Created September 25, 2017 11:47
Show Gist options
  • Save uprego/19fb0f8f6c32c2e345ec38bd5c7b8dbe to your computer and use it in GitHub Desktop.
Save uprego/19fb0f8f6c32c2e345ec38bd5c7b8dbe to your computer and use it in GitHub Desktop.
gitk multi stash patch - debian stretch
# pwd && echo && diff -u gitk-deb9-vanilla gitk-deb9-multistash; echo; ls -l | grep gitk
/usr/bin
--- gitk-deb9-vanilla 2017-08-09 06:49:17.000000000 +0000
+++ gitk-deb9-multistash 2017-09-25 11:30:11.386472474 +0000
@@ -296,6 +296,12 @@
set revs HEAD
} elseif {[lsearch -exact $revs --all] >= 0} {
lappend revs HEAD
+ set stashesfd [open [concat | \
+ git stash list --pretty=format:%H] r]
+ while {[gets $stashesfd stashline ] >= 0} {
+ lappend revs $stashline
+ }
+ catch {close $stashesfd}
}
if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
# we get stdout followed by stderr in $err
@@ -1780,7 +1786,8 @@
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
}
- set refd [open [list | git show-ref -d] r]
+ set refd [open [list | \
+ git show-ref -d | grep -v { refs/stash}] r]
while {[gets $refd line] >= 0} {
if {[string index $line 40] ne " "} continue
set id [string range $line 0 39]
@@ -1813,6 +1820,17 @@
}
}
catch {close $refd}
+ set stashesidsrefsfd [open [list | \
+ git stash list {--pretty=format:%H %gD}] r]
+ while {[gets $stashesidsrefsfd line] >= 0} {
+ if {[string index $line 40] ne " "} continue
+ set id [string range $line 0 39]
+ set ref [string range $line 41 end]
+ set name [string range $ref 5 end]
+ set otherrefids($name) $id
+ lappend idotherrefs($id) $name
+ }
+ catch {close $stashesidsrefsfd}
set mainhead {}
set mainheadid {}
catch {
lrwxrwxrwx 1 root root 20 Sep 25 11:31 gitk -> gitk-deb9-multistash
-rwxr-xr-x 1 root root 349506 Sep 25 11:30 gitk-deb9-multistash
-rwxr-xr-x 1 root root 348800 Aug 9 06:49 gitk-deb9-vanilla
# _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment