From: Jens Lidestrom <jens@xxxxxxxxxxxx> These procedures are useful for implementing keyboard commands. Keyboard commands don't have access to commits that are selected by the mouse and hence must get info from the selected row. Signed-off-by: Jens Lidestrom <jens@xxxxxxxxxxxx> --- gitk-git/gitk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gitk-git/gitk b/gitk-git/gitk index df3ba2ea99b..6d12e04ca64 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -1333,6 +1333,24 @@ proc commitonrow {row} { return $id } +# Get commits ID of the row that is selected in the GUI +proc selected_line_id {} { + global selectedline + return [commitonrow $selectedline] +} + +# Gets all branche names on the commit that is selected in the GUI, or the +# empty list if there is no branches on that commit. +proc selected_line_heads {} { + global idheads + set id [selected_line_id] + if {[info exists idheads($id)]} { + return $idheads($id) + } else { + return {} + } +} + proc closevarcs {v} { global varctok varccommits varcid parents children global cmitlisted commitidx vtokmod curview numcommits -- gitgitgadget