@matheusbsbs / matheus-bagliano / commits / 2f1a955b99
Fork 0

git-gui: Include the subject in the status bar after commit

Now that the command line git-commit has made displaying the subject (first line) of the newly created commit popular we can easily do the same thing here in git-gui, without the ugly part of forking off a child process to obtain that first line. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Apr 28, 2007 at 20:49 UTC 2f1a955b99954fd18c512244e1321dc4cff856b4
1 file changed +4 -3
git-gui.sh
+4 -3
@@ -1317,10 +1317,11 @@ A rescan will be automatically started now.
1317 }
1318 set i [string first "\n" $msg]
1319 if {$i >= 0} {
1320 - append reflogm {: } [string range $msg 0 [expr {$i - 1}]]
1320 + set subject [string range $msg 0 [expr {$i - 1}]]
1321 } else {
1322 - append reflogm {: } $msg
1322 + set subject $msg
1323 }
1324 + append reflogm {: } $subject
1325 set cmd [list git update-ref -m $reflogm HEAD $cmt_id $curHEAD]
1326 if {[catch {eval exec $cmd} err]} {
1327 error_popup "update-ref failed:\n\n$err"
@@ -1414,7 +1415,7 @@ A rescan will be automatically started now.
1415 unlock_index
1416 reshow_diff
1417 set ui_status_value \
1417 - "Changes committed as [string range $cmt_id 0 7]."
1418 + "Created commit [string range $cmt_id 0 7]: $subject"
1419 }
1420
1421 ######################################################################