summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2016-12-19Merge branch 'bb/unicode-9.0'Junio C Hamano
The character width table has been updated to match Unicode 9.0 * bb/unicode-9.0: unicode_width.h: update the width tables to Unicode 9.0 update_unicode.sh: remove the plane filter update_unicode.sh: automatically download newer definition files update_unicode.sh: pin the uniset repo to a known good commit update_unicode.sh: remove an unnecessary subshell level update_unicode.sh: move it into contrib/update-unicode
2016-12-19Merge branch 'nd/rebase-forget'Junio C Hamano
"git rebase" learned "--quit" option, which allows a user to remove the metadata left by an earlier "git rebase" that was manually aborted without using "git rebase --abort". * nd/rebase-forget: rebase: add --quit to cleanup rebase, leave everything else untouched
2016-12-14update_unicode.sh: remove the plane filterBeat Bolli
The uniset upstream has accepted my patches that eliminate the Unicode plane offsets from the output in '--32' mode. Remove the corresponding filter in update_unicode.sh. This also fixes the issue that the plane offsets were not removed from the second uniset call. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-14update_unicode.sh: automatically download newer definition filesBeat Bolli
Checking just for the unicode data files' existence is not sufficient; we should also download them if a newer version exists on the Unicode consortium's servers. Option -N of wget does this nicely for us. Reviewed-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-14update_unicode.sh: pin the uniset repo to a known good commitBeat Bolli
The uniset upstream has added more commits that for example change the hexadecimal output in '--32' mode to decimal. Let's pin the repo to a commit that still outputs the width tables in the format we want. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-14update_unicode.sh: remove an unnecessary subshell levelBeat Bolli
After the move into contrib/update-unicode, we no longer create the unicode directory to have a clean working folder. Instead, the directory of the script is used. This means that the subshell can be removed. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-14update_unicode.sh: move it into contrib/update-unicodeBeat Bolli
As it's used only by a tiny minority of the Git developer population, this script does not belong into the main Git source directory. Move it into contrib/ and adjust the paths to account for the new location. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-11rebase: add --quit to cleanup rebase, leave everything else untouchedNguyễn Thái Ngọc Duy
There are occasions when you decide to abort an in-progress rebase and move on to do something else but you forget to do "git rebase --abort" first. Or the rebase has been in progress for so long you forgot about it. By the time you realize that (e.g. by starting another rebase) it's already too late to retrace your steps. The solution is normally rm -r .git/<some rebase dir> and continue with your life. But there could be two different directories for <some rebase dir> (and it obviously requires some knowledge of how rebase works), and the ".git" part could be much longer if you are not at top-dir, or in a linked worktree. And "rm -r" is very dangerous to do in .git, a mistake in there could destroy object database or other important data. Provide "git rebase --quit" for this use case, mimicking a precedent that is "git cherry-pick --quit". Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-01Merge branch 'rs/cocci'Junio C Hamano
Improve the rule to convert "unsigned char [20]" into "struct object_id *" in contrib/coccinelle/ * rs/cocci: cocci: avoid self-references in object_id transformations
2016-11-01cocci: avoid self-references in object_id transformationsRené Scharfe
The object_id functions oid_to_hex, oid_to_hex_r, oidclr, oidcmp, and oidcpy are defined as wrappers of their legacy counterparts sha1_to_hex, sha1_to_hex_r, hashclr, hashcmp, and hashcpy, respectively. Make sure that the Coccinelle transformations for converting legacy function calls are not applied to these wrappers themselves, which would result in tautological declarations. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-31Merge branch 'ls/filter-process'Junio C Hamano
The smudge/clean filter API expect an external process is spawned to filter the contents for each path that has a filter defined. A new type of "process" filter API has been added to allow the first request to run the filter for a path to spawn a single process, and all filtering need is served by this single process for multiple paths, reducing the process creation overhead. * ls/filter-process: contrib/long-running-filter: add long running filter example convert: add filter.<driver>.process option convert: prepare filter.<driver>.process option convert: make apply_filter() adhere to standard Git error handling pkt-line: add functions to read/write flush terminated packet streams pkt-line: add packet_write_gently() pkt-line: add packet_flush_gently() pkt-line: add packet_write_fmt_gently() pkt-line: extract set_packet_header() pkt-line: rename packet_write() to packet_write_fmt() run-command: add clean_on_exit_handler run-command: move check_pipe() from write_or_die to run_command convert: modernize tests convert: quote filter names in error messages
2016-10-28Merge branch 'jc/cocci-xstrdup-or-null' into maintJunio C Hamano
Code cleanup. * jc/cocci-xstrdup-or-null: cocci: refactor common patterns to use xstrdup_or_null()
2016-10-28Merge branch 'rs/cocci' into maintJunio C Hamano
Code cleanup. * rs/cocci: use strbuf_add_unique_abbrev() for adding short hashes, part 3 remove unnecessary NULL check before free(3) coccicheck: make transformation for strbuf_addf(sb, "...") more precise use strbuf_add_unique_abbrev() for adding short hashes, part 2 use strbuf_addstr() instead of strbuf_addf() with "%s", part 2 gitignore: ignore output files of coccicheck make target use strbuf_addstr() for adding constant strings to a strbuf, part 2 add coccicheck make target contrib/coccinelle: fix semantic patch for oid_to_hex_r()
2016-10-26Merge branch 'jc/cocci-xstrdup-or-null'Junio C Hamano
Code cleanup. * jc/cocci-xstrdup-or-null: cocci: refactor common patterns to use xstrdup_or_null()
2016-10-26Merge branch 'mm/credential-libsecret'Junio C Hamano
A new credential helper that talks via "libsecret" with implementations of XDG Secret Service API has been added to contrib/credential/. * mm/credential-libsecret: contrib: add credential helper for libsecret
2016-10-17Merge branch 'rs/cocci'Junio C Hamano
Code cleanup. * rs/cocci: use strbuf_add_unique_abbrev() for adding short hashes, part 3 remove unnecessary NULL check before free(3)
2016-10-17contrib/long-running-filter: add long running filter exampleLars Schneider
Add a simple pass-thru filter as example implementation for the Git filter protocol version 2. See Documentation/gitattributes.txt, section "Filter Protocol" for more info. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-12cocci: refactor common patterns to use xstrdup_or_null()Junio C Hamano
d64ea0f83b ("git-compat-util: add xstrdup_or_null helper", 2015-01-12) added a handy wrapper that allows us to get a duplicate of a string or NULL if the original is NULL, but a handful of codepath predate its introduction or just weren't aware of it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-11Merge branch 'rs/copy-array' into maintJunio C Hamano
Code cleanup. * rs/copy-array: use COPY_ARRAY add COPY_ARRAY
2016-10-11contrib: add credential helper for libsecretMantas Mikulėnas
This is based on the existing gnome-keyring helper, but instead of libgnome-keyring (which was specific to GNOME and is deprecated), it uses libsecret which can support other implementations of XDG Secret Service API. Passes t0303-credential-external.sh. Signed-off-by: Mantas Mikulėnas <grawity@gmail.com> Reviewed-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-10Merge branch 'cp/completion-negative-refs'Junio C Hamano
The command-line completion script (in contrib/) learned to complete "git cmd ^mas<HT>" to complete the negative end of reference to "git cmd ^master". * cp/completion-negative-refs: completion: support excluding refs
2016-10-10Merge branch 'rs/qsort'Junio C Hamano
We call "qsort(array, nelem, sizeof(array[0]), fn)", and most of the time third parameter is redundant. A new QSORT() macro lets us omit it. * rs/qsort: show-branch: use QSORT use QSORT, part 2 coccicheck: use --all-includes by default remove unnecessary check before QSORT use QSORT add QSORT
2016-10-10remove unnecessary NULL check before free(3)René Scharfe
free(3) handles NULL pointers just fine. Add a semantic patch for removing unnecessary NULL checks before calling this function, and apply it on the code base. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-06Merge branch 'rs/cocci'Junio C Hamano
Code clean-up with help from coccinelle tool continues. * rs/cocci: coccicheck: make transformation for strbuf_addf(sb, "...") more precise use strbuf_add_unique_abbrev() for adding short hashes, part 2 use strbuf_addstr() instead of strbuf_addf() with "%s", part 2 gitignore: ignore output files of coccicheck make target
2016-10-03Merge branch 'rs/copy-array'Junio C Hamano
Code cleanup. * rs/copy-array: use COPY_ARRAY add COPY_ARRAY
2016-10-03coccicheck: make transformation for strbuf_addf(sb, "...") more preciseRené Scharfe
We can replace strbuf_addf() calls that just add a simple string with calls to strbuf_addstr() to make the intent clearer. We need to be careful if that string contains printf format specifications like %%, though, as a simple replacement would change the output. Add checks to the semantic patch to make sure we only perform the transformation if the second argument is a string constant (possibly translated) that doesn't contain any percent signs. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-29remove unnecessary check before QSORTRené Scharfe
Add a semantic patch for removing checks similar to the one that QSORT already does internally and apply it to the code base. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-29add QSORTRené Scharfe
Add the macro QSORT, a convenient wrapper for qsort(3) that infers the size of the array elements and supports the convention of initializing empty arrays with a NULL pointer, which we use in some places. Calling qsort(3) directly with a NULL pointer is undefined -- even with an element count of zero -- and allows the compiler to optimize away any following NULL checks. Using the macro avoids such surprises. Add a semantic patch as well to demonstrate the macro's usage and to automate the transformation of trivial cases. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27use strbuf_add_unique_abbrev() for adding short hashes, part 2René Scharfe
Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs instead of taking detours through find_unique_abbrev() and its static buffer. This is shorter and a bit more efficient. 1eb47f167d65d1d305b9c196a1bb40eb96117cb1 already converted six cases, this patch covers three more. A semantic patch for Coccinelle is included for easier checking for new cases that might be introduced in the future. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27use strbuf_addstr() instead of strbuf_addf() with "%s", part 2René Scharfe
Replace uses of strbuf_addf() for adding strings with more lightweight strbuf_addstr() calls. This is shorter and makes the intent clearer. bc57b9c0cc5a123365a922fa1831177e3fd607ed already converted three cases, this patch covers two more. A semantic patch for Coccinelle is included for easier checking for new cases that might be introduced in the future. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27gitignore: ignore output files of coccicheck make targetRené Scharfe
Helped-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26Merge branch 'rs/cocci'Junio C Hamano
Code cleanup. * rs/cocci: use strbuf_addstr() for adding constant strings to a strbuf, part 2 add coccicheck make target contrib/coccinelle: fix semantic patch for oid_to_hex_r()
2016-09-25use COPY_ARRAYRené Scharfe
Add a semantic patch for converting certain calls of memcpy(3) to COPY_ARRAY() and apply that transformation to the code base. The result is shorter and safer code. For now only consider calls where source and destination have the same type, or in other words: easy cases. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-15use strbuf_addstr() for adding constant strings to a strbuf, part 2René Scharfe
Replace uses of strbuf_addf() for adding strings with more lightweight strbuf_addstr() calls. This makes the intent clearer and avoids potential issues with printf format specifiers. 02962d36845b89145cd69f8bc65e015d78ae3434 already converted six cases, this patch covers eleven more. A semantic patch for Coccinelle is included for easier checking for new cases that might be introduced in the future. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-15contrib/coccinelle: fix semantic patch for oid_to_hex_r()René Scharfe
Both sha1_to_hex_r() and oid_to_hex_r() take two parameters, so use two expressions in the semantic patch for transforming calls of the former to the latter one. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-31diff-highlight: avoid highlighting combined diffsJeff King
The algorithm in diff-highlight only understands how to look at two sides of a diff; it cannot correctly handle combined diffs with multiple preimages. Often highlighting does not trigger at all for these diffs because the line counts do not match up. E.g., if we see: - ours -theirs ++resolved we would not bother highlighting; it naively looks like a single line went away, and then a separate hunk added another single line. But of course there are exceptions. E.g., if the other side deleted the line, we might see: - ours ++resolved which looks like we dropped " ours" and added "+resolved". This is only a small highlighting glitch (we highlight the space and the "+" along with the content), but it's also the tip of the iceberg. Even if we learned to find the true content here (by noticing we are in a 3-way combined diff and marking _two_ characters from the front of the line as uninteresting), there are other more complicated cases where we really do need to handle a 3-way hunk. Let's just punt for now; we can recognize combined diffs by the presence of extra "@" symbols in the hunk header, and treat them as non-diff content. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-31diff-highlight: add multi-byte testsJeff King
Now that we have a test suite for diff highlight, we can show off the improvements from 8d00662 (diff-highlight: do not split multibyte characters, 2015-04-03). While we're at it, we can also add another case that _doesn't_ work: combining code points are treated as their own unit, which means that we may stick colors between them and the character they are modifying (with the result that the color is not shown in an xterm, though it's possible that other terminals err the other way, and show the color but not the accent). There's no fix here, but let's document it as a failure. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-31diff-highlight: ignore test cruftJeff King
These are the same as in the normal t/.gitignore, with the exception of ".prove", as our Makefile does not support it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29diff-highlight: add support for --graph outputBrian Henderson
Signed-off-by: Brian Henderson <henderson.bj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29diff-highlight: add failing test for handling --graph outputBrian Henderson
Signed-off-by: Brian Henderson <henderson.bj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29diff-highlight: add some testsBrian Henderson
Signed-off-by: Brian Henderson <henderson.bj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-24completion: support excluding refsChris Packham
Allow completion of refs with a ^ prefix. This allows completion of commands like 'git log HEAD ^origin/master'. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-17git-multimail: update to release 1.4.0Matthieu Moy
Changes are described in CHANGES. Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr> Contributions-by: Irfan Adilovic <irfanadilovic@gmail.com> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-12Merge branch 'vs/typofix'Junio C Hamano
* vs/typofix: Spelling fixes
2016-08-12Merge branch 'js/import-tars-hardlinks'Junio C Hamano
"import-tars" fast-import script (in contrib/) used to ignore a hardlink target and replaced it with an empty file, which has been corrected to record the same blob as the other file the hardlink is shared with. * js/import-tars-hardlinks: import-tars: support hard links
2016-08-12Merge branch 'vs/completion-branch-fully-spelled-d-m-r'Junio C Hamano
* vs/completion-branch-fully-spelled-d-m-r: completion: complete --delete, --move, and --remotes for git branch
2016-08-11Spelling fixesVille Skyttä
<BAD> <CORRECTED> accidently accidentally commited committed dependancy dependency emtpy empty existance existence explicitely explicitly git-upload-achive git-upload-archive hierachy hierarchy indegee indegree intial initial mulitple multiple non-existant non-existent precendence. precedence. priviledged privileged programatically programmatically psuedo-binary pseudo-binary soemwhere somewhere successfull successful transfering transferring uncommited uncommitted unkown unknown usefull useful writting writing Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-10Merge branch 'jk/completion-diff-submodule'Junio C Hamano
* jk/completion-diff-submodule: completion: add completion for --submodule=* diff option
2016-08-10Merge branch 'jt/format-patch-from-config'Junio C Hamano
"git format-patch" learned format.from configuration variable to specify the default settings for its "--from" option. * jt/format-patch-from-config: format-patch: format.from gives the default for --from
2016-08-10Merge branch 'cp/completion-clone-recurse-submodules' into maintJunio C Hamano
* cp/completion-clone-recurse-submodules: completion: add option '--recurse-submodules' to 'git clone'