Skip to contentSkip to conversation

patches used by git distributors

fyi New Jonathan Nieder 4 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

In an ideal world, each patch applied by downstream distributors would fall into one of two categories: (a) adapting the package to some esoteric distro-specific requirement (i.e., special-interest patches) or (b) in the process of being generalized and reviewed for eventual application upstream, so everyone can benefit from it. Unfortunately that takes time. I should do better --- sorry about that.

As an experiment, here's a quick summary of the patches being used in Debian, for people curious about that and for people interested in grabbing useful patches to polish and not knowing where to start.

(Links point to relevant discussion, not necessarily the patch used):

Frédéric Brière (1):
gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields [1]

Gerrit Pape (1):

      bug#506445: hooks/post-receive-email: set encoding to utf-8 [2]

Jonathan Nieder (12):
remove shebang line from shell libraries [3]
pre-rebase hook: capture documentation in a <<here document [4]
gitk: use symbolic font names "sans" and "monospace"
transport: expose git_tcp_connect and friends in new tcp.h [5]
daemon: make host resolution into a separate function [5]
daemon: move locate_host to tcp.c [5]
tcp: unify ipv4 and ipv6 code paths [5]
daemon: check for errors retrieving IP address [5]
tcp: make dns_resolve return an error code [5]
transport: optionally honor DNS SRV records [5]
srv: make errors less quiet [5]
Makefile: add a knob to turn off hardlinks within same directory [6]

The patches listed above are on the candidate+patches branch of [7]. Questions and improvements can go to [email protected].

A few other packaging projects:

- git://pkgs.fedoraproject.org/git.git master --- 3 patches (using SERVER_NAME for home link, reviving vc-git.el, compatibility with newer cvsps)
- http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/git/files/ ---
1 patch (capping individual reads and writes at INT_MAX chars)
- https://build.opensuse.org/package/files?package=git&project=devel%3Atools%3Ascm
--- 4 patches (a python build fix, making gitweb::prevent_xss default to true, turning off hardlinks for builtins at installation time, protecting COMP_WORDBREAKS from mangling in the completion script)
- http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-vcs/git/files/
--- 1 patch (a NO_CVS knob for the makefile). Very nice.
- http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/scmgit-base/patches/
--- 3 patches (putting CFLAGS at the end of ALL_CFLAGS so it can override BASIC_CFLAGS, setting INSTALLDIRS=vendor in perl makefile, improving tk support on Darwin 8)
- http://www.openbsd.org/cgi-bin/cvsweb/ports/devel/git/patches/ --- 8 patches (updating OpenBSD makefile defaults, using raw perlio in gitweb blob view, removing "set -e" in t9117, passing --text [well, -a] to grep in t9200, avoiding nonportable regex \+ in t9400)
- ftp://ftp.cygwin.org/pub/cygwin/release/git/git-1.7.5.1-1-src.tar.bz2 --- 3 patches (tcl 8.4.1 support, updating Cygwin makefile defaults, case-insensitive path comparison in makefile, special Windows-specific wish script preamble)

[1] http://thread.gmane.org/gmane.comp.version-control.git/142160
[2] http://thread.gmane.org/gmane.comp.version-control.git/181737
[3] http://bugs.debian.org/368792
[4] http://thread.gmane.org/gmane.comp.version-control.git/150737
[5] http://thread.gmane.org/gmane.comp.version-control.git/175106
[6] http://thread.gmane.org/gmane.comp.version-control.git/183361
[7] http://smarden.org/git/git.git
gitweb: http://repo.or.cz/w/git/debian.org

#1 lore raw

Hi Jonathan,

Thanks for putting this together.

Quoted 7 lines · Jonathan Nieder

In an ideal world, each patch applied by downstream distributors would fall into one of two categories: (a) adapting the package to some esoteric distro-specific requirement (i.e., special-interest patches) or (b) in the process of being generalized and reviewed for eventual application upstream, so everyone can benefit from it. Unfortunately that takes time. I should do better --- sorry about that.

Quoted 5 lines

A few other packaging projects:

- git://pkgs.fedoraproject.org/git.git master --- 3 patches (using SERVER_NAME for home link, reviving vc-git.el, compatibility with newer cvsps)

To review the patches we have in Fedora/EPEL:

- git-1.5-gitweb-home-link.patch¹

This predates my involvement in git packaging. The default for ++GITWEB_HOME_LINK_STR++ is projects. The patch just uses
git://$SERVER_NAME if SERVER_NAME is available, falling back to projects if it is not.

I'm not sure exactly why that's an improvement over using projects, to be honest. It's only a text string and it links to the gitweb home, not to the contents of the string, so whether it reads projects or
git://$SERVER_NAME it takes the user to the same place. Definitely doesn't seem like something we'd want to push into gitweb and I'm wondering why we even want to carry it in Fedora/EPEL at this point in the morning. :)

- git-1.7-el5-emacs-support.patch²

This is only applied to builds for EL-5, where emacs is too old for the current emacs git support. From the commit message:

This is the vc-git.el from 1.6.4.1, the last version to include it. Most uses will be better served by the vc-git.el which is provided by emacs >= 22.2, but on EL-5 we don't have the luxury of a modern emacs.

Basically, to not break emacs support for folks who were using git-1.5.x from EPEL, we had to provide something to allow us to push git-1.7.x. It seems there are relatively few emacs-git users running EL-5, as getting testers for this was difficult. At the same time, we've gotten 0 bug reports. So it either works about as well as it did with git-1.5.x or no one uses it to notice that it doesn't work.

- git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch³

This one became necessary when Fedora moved to cvsps 2.2b1 and git cvsimport got noisy⁴. As cvsps is pretty much dead upstream, it didn't seem like this patch was worthy of inclusion in git.

If any of these seem like candidates for inclusion, I'm happy to properly submit them.

¹ http://pkgs.fedoraproject.org/gitweb/?p=git.git;a=blob;f=git-1.5-gitweb-home-link.patch;hb=HEAD
² http://pkgs.fedoraproject.org/gitweb/?p=git.git;a=blob;f=git-1.7-el5-emacs-support.patch;hb=HEAD
³ http://pkgs.fedoraproject.org/gitweb/?p=git.git;a=blob;f=git-cvsimport-Ignore-cvsps-2.2b1-Branches-output.patch;hb=HEAD
⁴ https://bugzilla.redhat.com/490602

Signature · 5 lines
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dope will get you through times of no money better than money will get
you through times of no dope.
    -- Freewheelin' Franklin
#2 lore raw
In reply to Jonathan Nieder

Jonathan Nieder <[email protected]> writes:

Note that I didn't check any of the patches that are not linked in references section.

Quoted 5 lines

Gerrit Pape (1):

      bug#506445: hooks/post-receive-email: set encoding to utf-8 [2]

Jonathan Nieder (12):
remove shebang line from shell libraries [3]

If this is about git-sh-setup, I think it is probably a good idea to upstream it.

Quoted 1 line

pre-rebase hook: capture documentation in a <<here document [4]

I do not mind this but if you are to do so you should remove the "exit 0" before that block.

Quoted 8 lines

transport: expose git_tcp_connect and friends in new tcp.h [5]
daemon: make host resolution into a separate function [5]
daemon: move locate_host to tcp.c [5]
tcp: unify ipv4 and ipv6 code paths [5]
daemon: check for errors retrieving IP address [5]
tcp: make dns_resolve return an error code [5]
transport: optionally honor DNS SRV records [5]
srv: make errors less quiet [5]

It seems that this received almost no interest from anybody. I suspect that the reason was because the cover letter was poorly written that people did not realize the need for it.

Quoted 1 line

Makefile: add a knob to turn off hardlinks within same directory [6]

I think the real fix for this issue should be either made in btrfs or even better "tar x", instead of forcing everybody who consumes a tarball to use symlink or copies. That is, work-around should be made when a _particular_ recipient wants to extract a tarball that stores hardlinks to the same inode than the filesystem the recipient _happens_ to be trying to extract it on, not before.

#3 lore raw

Junio C Hamano <[email protected]> writes:

-ECANNOTPARSE, sorry.

... That is, work-around should be made when a _particular_ recipient wants to extract a tarball that stores more hardlinks to the same inode than the filesystem the recipient _happens_ to be trying to extract it on supports.

#4 lore raw

PATCH 1/1 pre-rebase hook: capture documentation in a <<here document

In reply to Junio C Hamano

Without this change, the sample hook does not pass a syntax check (sh -n):

  $ sh -n hooks--pre-rebase.sample 
  hooks--pre-rebase.sample: line 101: syntax error near unexpected token `('
  hooks--pre-rebase.sample: line 101: `   merged into it again (either directly or indirectly).'

---

Quoted 6 lines · Junio C Hamano
Quoted 1 line · Jonathan Nieder

pre-rebase hook: capture documentation in a <<here document [4]

I do not mind this but if you are to do so you should remove the "exit 0" before that block.

Done. ;)

Thanks, and sorry for the slow reply.

Jonathan

 templates/hooks--pre-rebase.sample |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
templates/hooks--pre-rebase.sample +3 -3
index 053f1111..b7f81c19 100755
@@ -88,9 +88,7 @@ else
 	exit 1
 fi
 
-exit 0
-
-################################################################
+<<\DOC_END
 
 This sample hook safeguards topic branches that have been
 published from being rewound.
@@ -167,3 +165,5 @@ To compute (2):
 	git rev-list master..topic
 
 	if this is empty, it is fully merged to "master".
+
+DOC_END
Signature · 1 line
1.7.9.2
#5 lore raw
In reply to Jonathan Nieder
Quoted 56 lines · Jonathan Nieder

Hi,

In an ideal world, each patch applied by downstream distributors would fall into one of two categories: (a) adapting the package to some esoteric distro-specific requirement (i.e., special-interest patches) or (b) in the process of being generalized and reviewed for eventual application upstream, so everyone can benefit from it.  Unfortunately that takes time.  I should do better --- sorry about that.

As an experiment, here's a quick summary of the patches being used in Debian, for people curious about that and for people interested in grabbing useful patches to polish and not knowing where to start.

(Links point to relevant discussion, not necessarily the patch used):

Frédéric Brière (1):
     gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields [1]

Gerrit Pape (1):
     bug#506445: hooks/post-receive-email: set encoding to utf-8 [2]

Jonathan Nieder (12):
     remove shebang line from shell libraries [3]
     pre-rebase hook: capture documentation in a <<here document [4]
     gitk: use symbolic font names "sans" and "monospace"
     transport: expose git_tcp_connect and friends in new tcp.h [5]
     daemon: make host resolution into a separate function [5]
     daemon: move locate_host to tcp.c [5]
     tcp: unify ipv4 and ipv6 code paths [5]
     daemon: check for errors retrieving IP address [5]
     tcp: make dns_resolve return an error code [5]
     transport: optionally honor DNS SRV records [5]
     srv: make errors less quiet [5]
     Makefile: add a knob to turn off hardlinks within same directory [6]

The patches listed above are on the candidate+patches branch of [7]. Questions and improvements can go to [email protected].

A few other packaging projects:

 - git://pkgs.fedoraproject.org/git.git master --- 3 patches (using SERVER_NAME for home link, reviving vc-git.el, compatibility with newer cvsps)
 - http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/git/files/ ---
  1 patch (capping individual reads and writes at INT_MAX chars)
 - https://build.opensuse.org/package/files?package=git&project=devel%3Atools%3Ascm
  --- 4 patches (a python build fix, making gitweb::prevent_xss default to true, turning off hardlinks for builtins at installation time, protecting COMP_WORDBREAKS from mangling in the completion script)
 - http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-vcs/git/files/
  --- 1 patch (a NO_CVS knob for the makefile).  Very nice.
 - http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/scmgit-base/patches/
  --- 3 patches (putting CFLAGS at the end of ALL_CFLAGS so it can override BASIC_CFLAGS, setting INSTALLDIRS=vendor in perl makefile, improving tk support on Darwin 8)

Quoted 9 lines

 - http://www.openbsd.org/cgi-bin/cvsweb/ports/devel/git/patches/ --- 8 patches (updating OpenBSD makefile defaults, using raw perlio in gitweb blob view, removing "set -e" in t9117, passing --text [well, -a] to grep in t9200, avoiding nonportable regex \+ in t9400)
 - ftp://ftp.cygwin.org/pub/cygwin/release/git/git-1.7.5.1-1-src.tar.bz2 --- 3 patches (tcl 8.4.1 support, updating Cygwin makefile defaults, case-insensitive path comparison in makefile, special Windows-specific wish script preamble)

Here's what we have for msysGit (the commits themselves can be found in git://github.com/msysgit/git.git devel):

$ git log --no-merges --first-parent --oneline 319312f..origin/devel
9e47e31 Unicode console: fix font warning on Vista and Win7
778774d MSVC: require pton and ntop emulation
a49c818 MSVC: fix winansi.c compile errors
9ca8039 MSVC: fix poll-related macro redefines
0a6d148 MSVC: Remove unneeded header stubs
18f5b9e Compile fix for MSVC: Include <io.h>
fd6f6aa Compile fix for MSVC: Do not include sys/resources.h
ae69aaf Handle the branch.<name>.rebase value 'interactive'
5d1168b Teach 'git pull' to handle --rebase=interactive
5d6f1d9 Windows: define S_ISUID properly
5084033 Fixed wrong path delimiter in exe finding
77a30da gitweb (SyntaxHighlighter): interpret #l<line-number>
4654bdd Only switch on the line number toggle when highlighting is activated
3efcd98 Gitweb: add support for Alex Gorbatchev's SyntaxHighlighter in
Javascript
1d9ac66 MinGW: disable CRT command line globbing
e0f2492 Win32: move main macro to a function
8258c82 Win32: fix potential multi-threading issue
c45b052 Win32 dirent: improve dirent implementation
ab7ab7a Win32 dirent: clarify #include directives
9d46513 Win32 dirent: change FILENAME_MAX to MAX_PATH
18cf321 Win32 dirent: remove unused dirent.d_reclen member
2741409 Win32 dirent: remove unused dirent.d_ino member
a27af5c Revert "MinGW: Add missing file mode bit defines"
3e4b790 submodule: Fix t7400, t7405, t7406 for msysGit
f72cc9a t5407: Fix line-ending dependency in post-rewrite.args
77de716 submodule: Use cat instead of echo to avoid DOS line-endings
fece0cb t3102: Windows filesystems may not use a literal asterisk in filenames.
d3abd84 Disable test on MinGW that challenges its bash quoting
3f65607 MinGW: Skip test redirecting to fd 4
2e1f250 mingw: do not hide bare repositories
8089c85c Git.pm: Use stream-like writing in cat_blob()
d3d677e Amend "git grep -O -i: if the pager is 'less', pass the '-i' option"
ed7b275 git grep -O -i: if the pager is 'less', pass the '-i' option
30d3f9e Handle new t1501 test case properly with MinGW
64f7bec Do not compile compat/**/*.c with -Wold-style-definition
68acf50 Fix old-style function declaration
aa1c11f Make CFLAGS more strict
c592e94 grep -I: do not bother to read known-binary files
352f3d0 Let deny.currentBranch=updateInstead ignore submodules
5cf00b3 add -e: ignore dirty submodules
bf239f8 Handle http.* config variables pointing to files gracefully on Windows
621a958 Gitweb: make line number toggling work for Firefox and Safari
ff19df4 gitweb: Allow line number toggling with Javascript
feab003 Give commit message reencoding for output on MinGW a chance
6f86c3e Warn if the Windows console font doesn't support Unicode
bfcdc94 Detect console streams more reliably on Windows
9b505ab Support Unicode console output on Windows
e3356ac Enable color output in Windows cmd.exe
3bef266 Fix another invocation of git from gitk with an overly long command-line
d0a4bbe git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
7602e52 Make mingw_offset_1st_component() behave consistently for all paths.
1c072a6 config.c: trivial fix for compile-time warning
1f3a4f8 Allow using UNC path for git repository
3d08379 work around misdetection of stdin attached to a tty
fef92f8 git am: ignore dirty submodules
d23ce6f t7602: cope with CR/LF
3649391 Add a Windows-specific fallback to getenv("HOME");
ede54b1 send-email: handle Windows paths for display just like we do
for processing
32eefc4 send-email: accept absolute path even on Windows
6274596 Add a few more values for receive.denyCurrentBranch
2afff36 Work around funny CR issue
b81e593 mingw: add tests for the hidden attribute on the git directory
f9445e4 Work around the command line limit on Windows
59e0e60 git-gui: provide question helper for retry fallback on Windows
9e89381 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
40e6ef7 criss cross rename failure workaround
d24ec01 When initializing .git/, record the current setting of core.hideDotFiles
c40046b core.hidedotfiles: hide '.git' dir by default
73afc46 MinGW: Add missing file mode bit defines

Some of these might be useful for upstream as well...