Skip to content

Commit 2ec0cb7

Browse files
committed
Merge branch 'maint'
* maint: git-gui: Allow 'git gui version' outside of a repository git-gui: Revert "git-gui: Display all authors of git-gui." git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed." git-gui: Allow committing empty merges
2 parents 0c3b4aa + 756d846 commit 2ec0cb7

File tree

4 files changed

+15
-156
lines changed

4 files changed

+15
-156
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CREDITS-FILE
21
GIT-VERSION-FILE
32
git-citool
43
git-gui

CREDITS-GEN

Lines changed: 0 additions & 71 deletions
This file was deleted.

Makefile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
77
@$(SHELL_PATH) ./GIT-VERSION-GEN
88
-include GIT-VERSION-FILE
99

10+
SCRIPT_SH = git-gui.sh
1011
GITGUI_BUILT_INS = git-citool
11-
ALL_PROGRAMS = git-gui $(GITGUI_BUILT_INS)
12+
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
1213

1314
ifndef SHELL_PATH
1415
SHELL_PATH = /bin/sh
@@ -36,39 +37,33 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
3637
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
3738
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
3839

39-
git-gui: git-gui.sh GIT-VERSION-FILE CREDITS-FILE
40+
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
4041
$(QUIET_GEN)rm -f $@ $@+ && \
41-
sed -n \
42-
-e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
42+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
4343
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
44-
-e '1,/^set gitgui_credits /p' \
4544
$@.sh >$@+ && \
46-
cat CREDITS-FILE >>$@+ && \
47-
sed -e '1,/^set gitgui_credits /d' $@.sh >>$@+ && \
4845
chmod +x $@+ && \
4946
mv $@+ $@
5047

51-
CREDITS-FILE: CREDITS-GEN .FORCE-CREDITS-FILE
52-
$(QUIET_GEN)$(SHELL_PATH) ./CREDITS-GEN
53-
5448
$(GITGUI_BUILT_INS): git-gui
5549
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
5650

51+
# These can record GITGUI_VERSION
52+
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
53+
5754
all:: $(ALL_PROGRAMS)
5855

5956
install: all
6057
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
6158
$(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
6259
$(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
6360

64-
dist-version: CREDITS-FILE
61+
dist-version:
6562
@mkdir -p $(TARDIR)
6663
@echo $(GITGUI_VERSION) > $(TARDIR)/version
67-
@cat CREDITS-FILE > $(TARDIR)/credits
6864

6965
clean::
70-
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE CREDITS-FILE
66+
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
7167

7268
.PHONY: all install dist-version clean
7369
.PHONY: .FORCE-GIT-VERSION-FILE
74-
.PHONY: .FORCE-CREDITS-FILE

git-gui.sh

Lines changed: 6 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ GNU General Public License for more details.
1919
You should have received a copy of the GNU General Public License
2020
along with this program; if not, write to the Free Software
2121
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
22-
set gitgui_credits {
23-
Paul Mackerras
24-
}
2522

2623
######################################################################
2724
##
@@ -302,6 +299,11 @@ proc ask_popup {msg} {
302299
##
303300
## version check
304301

302+
if {{--version} eq $argv || {version} eq $argv} {
303+
puts "git-gui version $appvers"
304+
exit
305+
}
306+
305307
set req_maj 1
306308
set req_min 5
307309

@@ -1171,7 +1173,7 @@ File [short_path $path] cannot be committed by this program.
11711173
}
11721174
}
11731175
}
1174-
if {!$files_ready} {
1176+
if {!$files_ready && ![string match *merge $curType]} {
11751177
info_popup {No changes to commit.
11761178

11771179
You must add at least 1 file before you can commit.
@@ -4492,61 +4494,6 @@ proc do_commit {} {
44924494
commit_tree
44934495
}
44944496

4495-
proc do_credits {} {
4496-
global gitgui_credits
4497-
4498-
set w .credits_dialog
4499-
4500-
toplevel $w
4501-
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
4502-
4503-
label $w.header -text {git-gui Contributors} -font font_uibold
4504-
pack $w.header -side top -fill x
4505-
4506-
frame $w.buttons
4507-
button $w.buttons.close -text {Close} \
4508-
-font font_ui \
4509-
-command [list destroy $w]
4510-
pack $w.buttons.close -side right
4511-
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
4512-
4513-
frame $w.credits
4514-
text $w.credits.t \
4515-
-background [$w.header cget -background] \
4516-
-yscrollcommand [list $w.credits.sby set] \
4517-
-width 20 \
4518-
-height 10 \
4519-
-wrap none \
4520-
-borderwidth 1 \
4521-
-relief solid \
4522-
-padx 5 -pady 5 \
4523-
-font font_ui
4524-
scrollbar $w.credits.sby -command [list $w.credits.t yview]
4525-
pack $w.credits.sby -side right -fill y
4526-
pack $w.credits.t -fill both -expand 1
4527-
pack $w.credits -side top -fill both -expand 1 -padx 5 -pady 5
4528-
4529-
label $w.desc \
4530-
-text "All portions are copyrighted by their respective authors
4531-
and are distributed under the GNU General Public License." \
4532-
-padx 5 -pady 5 \
4533-
-justify left \
4534-
-anchor w \
4535-
-borderwidth 1 \
4536-
-relief solid \
4537-
-font font_ui
4538-
pack $w.desc -side top -fill x -padx 5 -pady 5
4539-
4540-
$w.credits.t insert end "[string trim $gitgui_credits]\n"
4541-
$w.credits.t conf -state disabled
4542-
$w.credits.t see 1.0
4543-
4544-
bind $w <Visibility> "grab $w; focus $w"
4545-
bind $w <Key-Escape> [list destroy $w]
4546-
wm title $w [$w.header cget -text]
4547-
tkwait window $w
4548-
}
4549-
45504497
proc do_about {} {
45514498
global appvers copyright
45524499
global tcl_patchLevel tk_patchLevel
@@ -4563,10 +4510,6 @@ proc do_about {} {
45634510
button $w.buttons.close -text {Close} \
45644511
-font font_ui \
45654512
-command [list destroy $w]
4566-
button $w.buttons.credits -text {Contributors} \
4567-
-font font_ui \
4568-
-command do_credits
4569-
pack $w.buttons.credits -side left
45704513
pack $w.buttons.close -side right
45714514
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
45724515

@@ -5116,8 +5059,6 @@ enable_option branch
51165059
enable_option transport
51175060

51185061
switch -- $subcommand {
5119-
--version -
5120-
version -
51215062
browser -
51225063
blame {
51235064
disable_option multicommit
@@ -5488,11 +5429,6 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
54885429
# -- Not a normal commit type invocation? Do that instead!
54895430
#
54905431
switch -- $subcommand {
5491-
--version -
5492-
version {
5493-
puts "git-gui version $appvers"
5494-
exit
5495-
}
54965432
browser {
54975433
if {[llength $argv] != 1} {
54985434
puts stderr "usage: $argv0 browser commit"

0 commit comments

Comments
 (0)