Skip to content

Commit b4d2b04

Browse files
author
Junio C Hamano
committed
Merge git-gui
This merges git-gui project of Shawn as a subproject of git.git at git-gui/ subdirectory. This merge only melds two histories together. The toplevel Makefile does not even know about git-gui yet. Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parents 4853534 + 0960f7d commit b4d2b04

File tree

5 files changed

+6065
-0
lines changed

5 files changed

+6065
-0
lines changed

git-gui/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GIT-VERSION-FILE
2+
git-citool
3+
git-gui

git-gui/GIT-VERSION-GEN

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
3+
GVF=GIT-VERSION-FILE
4+
DEF_VER=v0.5.GIT
5+
6+
LF='
7+
'
8+
9+
# First try git-describe, then see if there is a version file
10+
# (included in release tarballs), then default
11+
if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
12+
case "$VN" in
13+
*$LF*) (exit 1) ;;
14+
v[0-9]*) : happy ;;
15+
esac
16+
then
17+
VN=$(echo "$VN" | sed -e 's/-/./g');
18+
elif test -f version
19+
then
20+
VN=$(cat version) || VN="$DEF_VER"
21+
else
22+
VN="$DEF_VER"
23+
fi
24+
25+
VN=$(expr "$VN" : v*'\(.*\)')
26+
27+
dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
28+
case "$dirty" in
29+
'')
30+
;;
31+
*)
32+
VN="$VN-dirty" ;;
33+
esac
34+
35+
if test -r $GVF
36+
then
37+
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
38+
else
39+
VC=unset
40+
fi
41+
test "$VN" = "$VC" || {
42+
echo >&2 "GIT_VERSION = $VN"
43+
echo "GIT_VERSION = $VN" >$GVF
44+
}
45+
46+

git-gui/Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
all::
2+
3+
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
4+
@$(SHELL_PATH) ./GIT-VERSION-GEN
5+
-include GIT-VERSION-FILE
6+
7+
SCRIPT_SH = git-gui.sh
8+
GITGUI_BUILT_INS = git-citool
9+
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
10+
11+
ifndef SHELL_PATH
12+
SHELL_PATH = /bin/sh
13+
endif
14+
15+
gitexecdir := $(shell git --exec-path)
16+
INSTALL = install
17+
18+
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
19+
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
20+
21+
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
22+
23+
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
24+
rm -f $@ $@+
25+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
26+
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
27+
$@.sh >$@+
28+
chmod +x $@+
29+
mv $@+ $@
30+
31+
$(GITGUI_BUILT_INS): git-gui
32+
rm -f $@ && ln git-gui $@
33+
34+
# These can record GIT_VERSION
35+
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
36+
37+
all:: $(ALL_PROGRAMS)
38+
39+
install: all
40+
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
41+
$(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
42+
$(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
43+
44+
clean::
45+
rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
46+
47+
.PHONY: all install clean
48+
.PHONY: .FORCE-GIT-VERSION-FILE

git-gui/TODO

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Items outstanding:
2+
3+
* Add file to .gitignore or info/excludes.
4+
5+
* Populate the pull menu with local branches.
6+
7+
* Make use of the new default merge data stored in repo-config.
8+
9+
* Checkout a different local branch.
10+
11+
* Push any local branch to a remote branch.
12+
13+
* Merge any local branches through a real merge UI.
14+
15+
* Allow user to define keyboard shortcuts for frequently used fetch
16+
or merge operations. Or maybe just define a keyboard shortcut
17+
for default fetch/default merge of current branch is enough;
18+
but I do know a few users who merge a couple of common branches
19+
also into the same branch so one default isn't quite enough.
20+
21+
* Better organize fetch/push/pull console windows.
22+
23+
* Clone UI (to download a new repository).
24+
25+
* Remotes editor (for .git/config format only).
26+
27+
* Show a shortlog of the last couple of commits in the main window,
28+
to give the user warm fuzzy feelings that we have their data
29+
saved. Actually this may be the set of commits not yet in
30+
the upstream (aka default merge branch remote repository).
31+
32+
* GUI configuration editor for options listed in
33+
git.git/Documentation/config.txt. Ideally this would
34+
parse that file and generate the options dialog from
35+
the documentation itself, and include the help text
36+
from the documentation as part of the UI somehow.
37+
38+
Known bugs:
39+
40+
* git-gui sometimes just closes on Windows with no error message.
41+
I'm not sure what the problem is here. I suspect the wish
42+
process is just terminating due to a segfault or something,
43+
as the do_quit proc in git-gui doesn't run. It often seems to
44+
occur while writing a commit message in the buffer. Odd.

0 commit comments

Comments
 (0)