Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Don't package the git-gui credits file anymore
  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
  • Loading branch information
Junio C Hamano committed Mar 13, 2007
2 parents f8a0665 + 65d61e5 commit 9550a9c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 158 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,7 @@ dist: git.spec git-archive
$(TAR) rf $(GIT_TARNAME).tar \
$(GIT_TARNAME)/git.spec \
$(GIT_TARNAME)/version \
$(GIT_TARNAME)/git-gui/version \
$(GIT_TARNAME)/git-gui/credits
$(GIT_TARNAME)/git-gui/version
@rm -rf $(GIT_TARNAME)
gzip -f -9 $(GIT_TARNAME).tar

Expand Down
1 change: 0 additions & 1 deletion git-gui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CREDITS-FILE
GIT-VERSION-FILE
git-citool
git-gui
71 changes: 0 additions & 71 deletions git-gui/CREDITS-GEN

This file was deleted.

23 changes: 9 additions & 14 deletions git-gui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
-include GIT-VERSION-FILE

SCRIPT_SH = git-gui.sh
GITGUI_BUILT_INS = git-citool
ALL_PROGRAMS = git-gui $(GITGUI_BUILT_INS)
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))

ifndef SHELL_PATH
SHELL_PATH = /bin/sh
Expand All @@ -31,39 +32,33 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))

git-gui: git-gui.sh GIT-VERSION-FILE CREDITS-FILE
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)rm -f $@ $@+ && \
sed -n \
-e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
-e '1,/^set gitgui_credits /p' \
$@.sh >$@+ && \
cat CREDITS-FILE >>$@+ && \
sed -e '1,/^set gitgui_credits /d' $@.sh >>$@+ && \
chmod +x $@+ && \
mv $@+ $@

CREDITS-FILE: CREDITS-GEN .FORCE-CREDITS-FILE
$(QUIET_GEN)$(SHELL_PATH) ./CREDITS-GEN

$(GITGUI_BUILT_INS): git-gui
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@

# These can record GITGUI_VERSION
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE

all:: $(ALL_PROGRAMS)

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

dist-version: CREDITS-FILE
dist-version:
@mkdir -p $(TARDIR)
@echo $(GITGUI_VERSION) > $(TARDIR)/version
@cat CREDITS-FILE > $(TARDIR)/credits

clean::
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE CREDITS-FILE
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE

.PHONY: all install dist-version clean
.PHONY: .FORCE-GIT-VERSION-FILE
.PHONY: .FORCE-CREDITS-FILE
76 changes: 6 additions & 70 deletions git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
set gitgui_credits {
Paul Mackerras
}

######################################################################
##
Expand Down Expand Up @@ -302,6 +299,11 @@ proc ask_popup {msg} {
##
## version check

if {{--version} eq $argv || {version} eq $argv} {
puts "git-gui version $appvers"
exit
}

set req_maj 1
set req_min 5

Expand Down Expand Up @@ -1171,7 +1173,7 @@ File [short_path $path] cannot be committed by this program.
}
}
}
if {!$files_ready} {
if {!$files_ready && ![string match *merge $curType]} {
info_popup {No changes to commit.

You must add at least 1 file before you can commit.
Expand Down Expand Up @@ -4492,61 +4494,6 @@ proc do_commit {} {
commit_tree
}

proc do_credits {} {
global gitgui_credits

set w .credits_dialog

toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"

label $w.header -text {git-gui Contributors} -font font_uibold
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.close -text {Close} \
-font font_ui \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

frame $w.credits
text $w.credits.t \
-background [$w.header cget -background] \
-yscrollcommand [list $w.credits.sby set] \
-width 20 \
-height 10 \
-wrap none \
-borderwidth 1 \
-relief solid \
-padx 5 -pady 5 \
-font font_ui
scrollbar $w.credits.sby -command [list $w.credits.t yview]
pack $w.credits.sby -side right -fill y
pack $w.credits.t -fill both -expand 1
pack $w.credits -side top -fill both -expand 1 -padx 5 -pady 5

label $w.desc \
-text "All portions are copyrighted by their respective authors
and are distributed under the GNU General Public License." \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid \
-font font_ui
pack $w.desc -side top -fill x -padx 5 -pady 5

$w.credits.t insert end "[string trim $gitgui_credits]\n"
$w.credits.t conf -state disabled
$w.credits.t see 1.0

bind $w <Visibility> "grab $w; focus $w"
bind $w <Key-Escape> [list destroy $w]
wm title $w [$w.header cget -text]
tkwait window $w
}

proc do_about {} {
global appvers copyright
global tcl_patchLevel tk_patchLevel
Expand All @@ -4563,10 +4510,6 @@ proc do_about {} {
button $w.buttons.close -text {Close} \
-font font_ui \
-command [list destroy $w]
button $w.buttons.credits -text {Contributors} \
-font font_ui \
-command do_credits
pack $w.buttons.credits -side left
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

Expand Down Expand Up @@ -5116,8 +5059,6 @@ enable_option branch
enable_option transport

switch -- $subcommand {
--version -
version -
browser -
blame {
disable_option multicommit
Expand Down Expand Up @@ -5488,11 +5429,6 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
# -- Not a normal commit type invocation? Do that instead!
#
switch -- $subcommand {
--version -
version {
puts "git-gui version $appvers"
exit
}
browser {
if {[llength $argv] != 1} {
puts stderr "usage: $argv0 browser commit"
Expand Down

0 comments on commit 9550a9c

Please sign in to comment.