@@ -1267,6 +1267,24 @@ proc commit_committree {fd_wt curHEAD msg} {
12671267 return
12681268 }
12691269
1270+ # -- Verify this wasn't an empty change.
1271+ #
1272+ if {$commit_type eq {normal}} {
1273+ set old_tree [git rev-parse " $PARENT ^{tree}" ]
1274+ if {$tree_id eq $old_tree } {
1275+ info_popup {No changes to commit.
1276+
1277+ No files were modified by this commit and it
1278+ was not a merge commit.
1279+
1280+ A rescan will be automatically started now.
1281+ }
1282+ unlock_index
1283+ rescan {set ui_status_value {No changes to commit.}}
1284+ return
1285+ }
1286+ }
1287+
12701288 # -- Build the message.
12711289 #
12721290 set msg_p [gitdir COMMIT_EDITMSG]
@@ -1281,14 +1299,8 @@ proc commit_committree {fd_wt curHEAD msg} {
12811299 # -- Create the commit.
12821300 #
12831301 set cmd [list git commit-tree $tree_id ]
1284- set parents [concat $PARENT $MERGE_HEAD ]
1285- if {[llength $parents ] > 0} {
1286- foreach p $parents {
1287- lappend cmd -p $p
1288- }
1289- } else {
1290- # git commit-tree writes to stderr during initial commit.
1291- lappend cmd 2>/dev/null
1302+ foreach p [concat $PARENT $MERGE_HEAD ] {
1303+ lappend cmd -p $p
12921304 }
12931305 lappend cmd <$msg_p
12941306 if {[catch {set cmt_id [eval exec $cmd ]} err]} {
@@ -5256,6 +5268,12 @@ if {[is_enabled branch]} {
52565268 -font font_ui
52575269 lappend disable_on_lock [list .mbar.branch entryconf \
52585270 [.mbar.branch index last] -state]
5271+
5272+ .mbar.branch add command -label {Reset...} \
5273+ -command do_reset_hard \
5274+ -font font_ui
5275+ lappend disable_on_lock [list .mbar.branch entryconf \
5276+ [.mbar.branch index last] -state]
52595277}
52605278
52615279# -- Commit Menu
@@ -5330,6 +5348,34 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
53305348 [list .mbar.commit entryconf [.mbar.commit index last] -state]
53315349}
53325350
5351+ # -- Merge Menu
5352+ #
5353+ if {[is_enabled branch]} {
5354+ menu .mbar.merge
5355+ .mbar.merge add command -label {Local Merge...} \
5356+ -command do_local_merge \
5357+ -font font_ui
5358+ lappend disable_on_lock \
5359+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
5360+ .mbar.merge add command -label {Abort Merge...} \
5361+ -command do_reset_hard \
5362+ -font font_ui
5363+ lappend disable_on_lock \
5364+ [list .mbar.merge entryconf [.mbar.merge index last] -state]
5365+
5366+ }
5367+
5368+ # -- Transport Menu
5369+ #
5370+ if {[is_enabled transport]} {
5371+ menu .mbar.fetch
5372+
5373+ menu .mbar.push
5374+ .mbar.push add command -label {Push...} \
5375+ -command do_push_anywhere \
5376+ -font font_ui
5377+ }
5378+
53335379if {[is_MacOSX]} {
53345380 # -- Apple Menu (Mac OS X only)
53355381 #
@@ -5502,28 +5548,6 @@ pack .branch.l1 -side left
55025548pack .branch.cb -side left -fill x
55035549pack .branch -side top -fill x
55045550
5505- if {[is_enabled branch]} {
5506- menu .mbar.merge
5507- .mbar.merge add command -label {Local Merge...} \
5508- -command do_local_merge \
5509- -font font_ui
5510- lappend disable_on_lock \
5511- [list .mbar.merge entryconf [.mbar.merge index last] -state]
5512- .mbar.merge add command -label {Abort Merge...} \
5513- -command do_reset_hard \
5514- -font font_ui
5515- lappend disable_on_lock \
5516- [list .mbar.merge entryconf [.mbar.merge index last] -state]
5517-
5518-
5519- menu .mbar.fetch
5520-
5521- menu .mbar.push
5522- .mbar.push add command -label {Push...} \
5523- -command do_push_anywhere \
5524- -font font_ui
5525- }
5526-
55275551# -- Main Window Layout
55285552#
55295553panedwindow .vpane -orient vertical
0 commit comments