Skip to content

Commit 7173ad7

Browse files
committed
Merge branch 'jd/subtree'
* jd/subtree: contrib/subtree: allow adding an annotated tag contrib/subtree/Makefile: clean up rule for "clean" contrib/subtree/Makefile: clean up rules to generate documentation contrib/subtree/Makefile: s/libexecdir/gitexecdir/ contrib/subtree/Makefile: use GIT-VERSION-FILE contrib/subtree/Makefile: scrap unused $(gitdir)
2 parents c8704ad + 6f1871f commit 7173ad7

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

contrib/subtree/Makefile

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@
33

44
prefix ?= /usr/local
55
mandir ?= $(prefix)/share/man
6-
libexecdir ?= $(prefix)/libexec/git-core
7-
gitdir ?= $(shell git --exec-path)
6+
gitexecdir ?= $(prefix)/libexec/git-core
87
man1dir ?= $(mandir)/man1
98

10-
gitver ?= $(word 3,$(shell git --version))
9+
../../GIT-VERSION-FILE: FORCE
10+
$(MAKE) -C ../../ GIT-VERSION-FILE
11+
12+
-include ../../GIT-VERSION-FILE
1113

1214
# this should be set to a 'standard' bsd-type install program
13-
INSTALL ?= install
15+
INSTALL ?= install
16+
RM ?= rm -f
17+
18+
ASCIIDOC = asciidoc
19+
XMLTO = xmlto
1420

15-
ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
16-
MANPAGE_NORMAL_XSL = ../../Documentation/manpage-normal.xsl
21+
ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
22+
MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
1723

1824
GIT_SUBTREE_SH := git-subtree.sh
1925
GIT_SUBTREE := git-subtree
@@ -31,8 +37,8 @@ $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
3137
doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
3238

3339
install: $(GIT_SUBTREE)
34-
$(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
35-
$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(libexecdir)
40+
$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
41+
$(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
3642

3743
install-doc: install-man
3844

@@ -41,19 +47,21 @@ install-man: $(GIT_SUBTREE_DOC)
4147
$(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
4248

4349
$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
44-
xmlto -m $(MANPAGE_NORMAL_XSL) man $^
50+
$(XMLTO) -m $(MANPAGE_XSL) man $^
4551

4652
$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
47-
asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
48-
-agit_version=$(gitver) $^
53+
$(ASCIIDOC) -b docbook -d manpage -f $(ASCIIDOC_CONF) \
54+
-agit_version=$(GIT_VERSION) $^
4955

5056
$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
51-
asciidoc -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
52-
-agit_version=$(gitver) $^
57+
$(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
58+
-agit_version=$(GIT_VERSION) $^
5359

5460
test:
5561
$(MAKE) -C t/ test
5662

5763
clean:
58-
rm -f *~ *.xml *.html *.1
59-
rm -rf subproj mainline
64+
$(RM) $(GIT_SUBTREE)
65+
$(RM) *.xml *.html *.1
66+
67+
.PHONY: FORCE

contrib/subtree/git-subtree.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,9 @@ cmd_add_commit()
558558
commit=$(add_squashed_msg "$rev" "$dir" |
559559
git commit-tree $tree $headp -p "$rev") || exit $?
560560
else
561+
revp=$(peel_committish "$rev") &&
561562
commit=$(add_msg "$dir" "$headrev" "$rev" |
562-
git commit-tree $tree $headp -p "$rev") || exit $?
563+
git commit-tree $tree $headp -p "$revp") || exit $?
563564
fi
564565
git reset "$commit" || exit $?
565566

0 commit comments

Comments
 (0)