Skip to contentSkip to conversation

git: add manpages and tab completion support.

PATCH In review Paul Gortmaker 2 participants 4 messages Feb 10, 2015 – Feb 11, 2015

lore
Share & tools
lore
#0 lore raw

cover git: add manpages and tab completion support.

As part of improving the end user experience for installs where the end user interacts directly with the generated filesystem (e.g. the build-appliance) these two commits ensure that we can have real man pages and tab completion for git on the target if desired.

The pre-generated man pages are created by the git folks themselves and hosted right along side of the git tarballs, so updates will be relatively seamless.

Paul.
---

Paul Gortmaker (2):
git: expand recipe to take advantage of pre-gen'd manpages
git: add basic tab completion support

 meta/recipes-devtools/git/git.inc      | 17 ++++++++++++++++-
 meta/recipes-devtools/git/git_2.2.1.bb |  6 ++++--
 2 files changed, 20 insertions(+), 3 deletions(-)
Signature · 1 line
2.2.1
#1 lore raw

PATCH 1/2 git: expand recipe to take advantage of pre-gen'd manpages

These could be created from scratch from git itself, but it requires asciidoc, xsltproc, python bits and too much other baggage. Since the git folks issue a tarball with the manpages for each release, it is simpler to just go get that.

---
 meta/recipes-devtools/git/git.inc      | 11 ++++++++++-
 meta/recipes-devtools/git/git_2.2.1.bb |  6 ++++--
 2 files changed, 14 insertions(+), 3 deletions(-)
meta/recipes-devtools/git/git.inc +10 -1
index 53966287902c..59f1c00521fc 100644
@@ -5,7 +5,9 @@ DEPENDS = "openssl curl zlib expat"
 
 PROVIDES_append_class-native = " git-replacement-native"
 
-SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz"
+SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
+           ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
+
 S = "${WORKDIR}/git-${PV}"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
@@ -30,6 +32,12 @@ do_install () {
 	oe_runmake install DESTDIR="${D}" bindir=${bindir} \
 		template_dir=${datadir}/git-core/templates \
 		GIT_PYTHON_DIR=${D}${datadir}/git-core/python
+	install -d ${D}/${mandir}/man1
+	install -d ${D}/${mandir}/man5
+	install -d ${D}/${mandir}/man7
+	install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
+	install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
+	install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
 }
 
 perl_native_fixup () {
@@ -64,6 +72,7 @@ do_install_append_class-nativesdk() {
 }
 
 FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
+FILES_${PN}-doc = "${mandir}"
 FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"
 
 PERLTOOLS = " \
meta/recipes-devtools/git/git_2.2.1.bb +4 -2
index 2d47cda7752e..d1fcb2758750 100644
@@ -1,7 +1,9 @@
 require git.inc
 
-SRC_URI[md5sum] = "ff41fdb094eed1ec430aed8ee9b9849c"
-SRC_URI[sha256sum] = "367a77d0b10a5070b02a0fb0e942f26f25af61793128e0ddfd5c5c474de93589"
+SRC_URI[tarball.md5sum] = "ff41fdb094eed1ec430aed8ee9b9849c"
+SRC_URI[tarball.sha256sum] = "367a77d0b10a5070b02a0fb0e942f26f25af61793128e0ddfd5c5c474de93589"
+SRC_URI[manpages.md5sum] = "b5ddd262b608804ba4403f0f82d881d7"
+SRC_URI[manpages.sha256sum] = "69dcb3decdb33dd35491935e80f71c40c576b536df4223eb98d5f7ccd9643293"
 
 EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no ac_cv_c_c99_format=yes \
                  ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
Signature · 1 line
2.2.1
#2 lore raw

Re: [PATCH 1/2] git: expand recipe to take advantage of pre-gen'd manpages

Quoted 2 lines · Paul Gortmaker

+FILES_${PN}-doc = "${mandir}"

This is the default value, I removed this line when merging into ross/mut.

Ross

#3 lore raw

PATCH 2/2 git: add basic tab completion support

In reply to Paul Gortmaker

Trying to use git w/o tab completion is especially annoying if you are used to using it elsewhere -- "whatchanged" is simply too annoying to type out in full more than once.

---
 meta/recipes-devtools/git/git.inc | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-devtools/git/git.inc +6 -0
index 59f1c00521fc..53e2ba9aac01 100644
@@ -38,6 +38,8 @@ do_install () {
 	install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
 	install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
 	install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
+	install -d ${D}/${datadir}/bash-completion/completions/
+	install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
 }
 
 perl_native_fixup () {
@@ -95,6 +97,10 @@ PERLTOOLS = " \
     ${datadir}/git-core/templates/hooks/pre-rebase.sample \
 "
 
+# Basic tab completion support
+PACKAGES =+ "${PN}-bash-completion"
+FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions/*"
+
 # Git tools requiring perl
 PACKAGES =+ "${PN}-perltools"
 FILES_${PN}-perltools += " \
Signature · 1 line
2.2.1