summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2016-10-17contrib/long-running-filter: add long running filter exampleLibravatar Lars Schneider1-0/+128
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-08-31diff-highlight: avoid highlighting combined diffsLibravatar Jeff King2-1/+38
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 testsLibravatar Jeff King1-1/+35
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 cruftLibravatar Jeff King1-0/+2
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 outputLibravatar Brian Henderson2-7/+14
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 outputLibravatar Brian Henderson1-0/+62
Signed-off-by: Brian Henderson <henderson.bj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29diff-highlight: add some testsLibravatar Brian Henderson3-0/+190
Signed-off-by: Brian Henderson <henderson.bj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-17git-multimail: update to release 1.4.0Libravatar Matthieu Moy6-276/+725
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'Libravatar Junio C Hamano4-5/+5
* vs/typofix: Spelling fixes
2016-08-12Merge branch 'js/import-tars-hardlinks'Libravatar Junio C Hamano1-11/+20
"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'Libravatar Junio C Hamano1-3/+3
* vs/completion-branch-fully-spelled-d-m-r: completion: complete --delete, --move, and --remotes for git branch
2016-08-11Spelling fixesLibravatar Ville Skyttä4-5/+5
<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'Libravatar Junio C Hamano1-0/+19
* jk/completion-diff-submodule: completion: add completion for --submodule=* diff option
2016-08-10Merge branch 'jt/format-patch-from-config'Libravatar Junio C Hamano1-0/+1
"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-09completion: add completion for --submodule=* diff optionLibravatar Jacob Keller1-0/+19
Teach git-completion.bash to complete --submodule= for git commands which take diff options. Also teach completion for git-log to support --diff-algorithms as well. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-09completion: complete --delete, --move, and --remotes for git branchLibravatar Ville Skyttä1-3/+3
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-08Merge branch 'cp/completion-clone-recurse-submodules'Libravatar Junio C Hamano1-0/+1
* cp/completion-clone-recurse-submodules: completion: add option '--recurse-submodules' to 'git clone'
2016-08-08Merge branch 'da/subtree-modernize'Libravatar Junio C Hamano1-286/+391
Style fixes for "git subtree" (in contrib/). * da/subtree-modernize: subtree: adjust function definitions to match CodingGuidelines subtree: adjust style to match CodingGuidelines
2016-08-03Merge branch 'jk/git-jump'Libravatar Junio C Hamano2-3/+11
"git jump" script (in contrib/) has been updated a bit. * jk/git-jump: contrib/git-jump: fix typo in README contrib/git-jump: add whitespace-checking mode contrib/git-jump: fix greedy regex when matching hunks
2016-08-03Merge branch 'pm/build-persistent-https-with-recent-go'Libravatar Junio C Hamano1-2/+4
The build procedure for "git persistent-https" helper (in contrib/) has been updated so that it can be built with more recent versions of Go. * pm/build-persistent-https-with-recent-go: contrib/persistent-https: use Git version for build label contrib/persistent-https: update ldflags syntax for Go 1.7+
2016-08-03Merge branch 'da/subtree-2.9-regression'Libravatar Junio C Hamano2-8/+25
"git merge" in Git v2.9 was taught to forbid merging an unrelated lines of history by default, but that is exactly the kind of thing the "--rejoin" mode of "git subtree" (in contrib/) wants to do. "git subtree" has been taught to use the "--allow-unrelated-histories" option to override the default. * da/subtree-2.9-regression: subtree: fix "git subtree split --rejoin" t7900-subtree.sh: fix quoting and broken && chains
2016-08-03import-tars: support hard linksLibravatar Johannes Schindelin1-11/+20
Previously, we simply treated hard links as if they were plain files with size 0, ignoring the link type "1" and hence the link target. What we should do instead, of course, is to use the link target to get at the import mark for the contents, even if we cannot recreate the hard link per se, as Git has no concept of hard links. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-01format-patch: format.from gives the default for --fromLibravatar Josh Triplett1-0/+1
This helps users who would prefer format-patch to default to --from, and makes it easier to change the default in the future. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-28Merge branch 'nd/worktree-lock'Libravatar Junio C Hamano1-1/+4
"git worktree prune" protected worktrees that are marked as "locked" by creating a file in a known location. "git worktree" command learned a dedicated command pair to create and remove such a file, so that the users do not have to do this with editor. * nd/worktree-lock: worktree.c: find_worktree() search by path suffix worktree: add "unlock" command worktree: add "lock" command worktree.c: add is_worktree_locked() worktree.c: add is_main_worktree() worktree.c: add find_worktree()
2016-07-27subtree: adjust function definitions to match CodingGuidelinesLibravatar David Aguilar1-68/+34
We prefer a space between the function name and the parentheses, and no space inside the parentheses. The opening "{" should also be on the same line. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-27subtree: adjust style to match CodingGuidelinesLibravatar David Aguilar1-218/+357
Prefer "test" over "[ ... ]", use double-quotes around variables, break long lines, and properly indent "case" statements. Helped-by: Johannes Sixt <j6t@kdbg.org> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-27completion: add option '--recurse-submodules' to 'git clone'Libravatar Chris Packham1-0/+1
Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-26subtree: fix "git subtree split --rejoin"Libravatar David Aguilar2-0/+17
"git merge" in v2.9 prevents merging unrelated histories. "git subtree split --rejoin" creates unrelated histories when creating a split repo from a raw sub-directory that did not originate from an invocation of "git subtree add". Restore the original behavior by passing --allow-unrelated-histories when merging subtrees. This ensures that the synthetic history created by "git subtree split" can be merged. Add a test to ensure that this feature works as advertised. Reported-by: Brett Cundal <brett.cundal@iugome.com> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-26t7900-subtree.sh: fix quoting and broken && chainsLibravatar David Aguilar1-8/+8
Allow whitespace in arguments to subtree_test_create_repo. Add missing && chains. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22contrib/git-jump: fix typo in READMELibravatar Jeff King1-1/+1
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22contrib/git-jump: add whitespace-checking modeLibravatar Jeff King2-1/+9
If you have whitespace errors in lines you've introduced, it can be convenient to be able to jump directly to them for fixing. You can't quite use "git jump diff" for this, because though it passes arbitrary options to "git diff", it expects to see an actual unified diff in the output. Whereas "git diff --check" actually produces lines that look like compiler quickfix lines already, meaning we just need to run it and feed the output directly to the editor. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22contrib/git-jump: fix greedy regex when matching hunksLibravatar Jeff King1-1/+1
The hunk-header regex looks for "\+\d+" to find the post-image line numbers, but it skips the pre-image line numbers with a simple ".*". That means we may greedily eat the post-image numbers and match a "\+\d" further on, in the funcname text. For example, commit 6b9c38e has this hunk header: diff --git a/t/t0006-date.sh b/t/t0006-date.sh [...] @@ -50,8 +50,8 @@ check_show iso-local "$TIME" '2016-06-15 14:13:20 +0000' If you run: git checkout 6b9c38e git jump diff HEAD^ t/ it will erroneously match "+0000" as the starting line number and jump there, rather than line 50. We can fix it by just making the "skip" regex non-greedy, taking the first "+" we see, which should be the post-image line information. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22contrib/persistent-https: use Git version for build labelLibravatar Parker Moore1-1/+1
The previous method simply used the UNIX timestamp of when the binary was built as its build label. $ make && ./git-remote-persistent-http -print_label 1469061546 This patch aims to align the label for this binary with the Git version contained in the GIT-VERSION-FILE. This gives a better sense of the version of the binary as it can be mapped to a particular revision or release of Git itself. For example: $ make && ./git-remote-persistent-http -print_label 2.9.1.275.g75676c8 Discussion of this patch is available on a related thread in the mailing list surrounding this package called "contrib/persistent-https: update ldflags syntax for Go 1.7+". The gmane.org link is: http://article.gmane.org/gmane.comp.version-control.git/299653/ Signed-off-by: Parker Moore <parkrmoore@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22contrib/persistent-https: update ldflags syntax for Go 1.7+Libravatar Parker Moore1-1/+3
Running `make all` in `contrib/persistent-https` results in a failure on Go 1.7 and above. Specifically, the error is: go build -o git-remote-persistent-https \ -ldflags "-X main._BUILD_EMBED_LABEL 1468613136" # _/Users/parkr/github/git/contrib/persistent-https /usr/local/Cellar/go/1.7rc1/libexec/pkg/tool/darwin_amd64/link: -X flag requires argument of the form importpath.name=value make: *** [git-remote-persistent-https] Error 2 This `name=value` syntax for the -X flag was introduced in Go v1.5 (released Aug 19, 2015): - release notes: https://golang.org/doc/go1.5#link - commit: https://github.com/golang/go/commit/12795c02f3d6fc54ece09a86e70aaa40a94d5131 In Go v1.7, support for the old syntax was removed: - release notes: https://tip.golang.org/doc/go1.7#compiler - commit: https://github.com/golang/go/commit/51b624e6a29b135ce0fadb22b678acf4998ff16f Add '=' between the symbol and its value for recent versions of Go, while leaving it out for older ones. Signed-off-by: Parker Moore <parkrmoore@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-19Merge branch 'bc/cocci'Libravatar Junio C Hamano2-0/+97
Conversion from unsigned char sha1[20] to struct object_id continues. * bc/cocci: diff: convert prep_temp_blob() to struct object_id merge-recursive: convert merge_recursive_generic() to object_id merge-recursive: convert leaf functions to use struct object_id merge-recursive: convert struct merge_file_info to object_id merge-recursive: convert struct stage_data to use object_id diff: rename struct diff_filespec's sha1_valid member diff: convert struct diff_filespec to struct object_id coccinelle: apply object_id Coccinelle transformations coccinelle: convert hashcpy() with null_sha1 to hashclr() contrib/coccinelle: add basic Coccinelle transforms hex: add oid_to_hex_r()
2016-07-08worktree: add "unlock" commandLibravatar Nguyễn Thái Ngọc Duy1-1/+1
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-08worktree: add "lock" commandLibravatar Nguyễn Thái Ngọc Duy1-1/+4
Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06Merge branch 'nd/worktree-cleanup-post-head-protection'Libravatar Junio C Hamano1-0/+23
Further preparatory clean-up for "worktree" feature continues. * nd/worktree-cleanup-post-head-protection: worktree: simplify prefixing paths worktree: avoid 0{40}, too many zeroes, hard to read worktree.c: use is_dot_or_dotdot() git-worktree.txt: keep subcommand listing in alphabetical order worktree.c: rewrite mark_current_worktree() to avoid strbuf completion: support git-worktree
2016-07-06Merge branch 'nb/gnome-keyring-build' into maintLibravatar Junio C Hamano1-2/+3
Build improvements for gnome-keyring (in contrib/) * nb/gnome-keyring-build: gnome-keyring: Don't hard-code pkg-config executable
2016-07-06Merge branch 'vs/prompt-avoid-unset-variable' into maintLibravatar Junio C Hamano1-3/+3
The git-prompt scriptlet (in contrib/) was not friendly with those who uses "set -u", which has been fixed. * vs/prompt-avoid-unset-variable: git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
2016-06-28contrib/coccinelle: add basic Coccinelle transformsLibravatar brian m. carlson2-0/+97
Coccinelle (http://coccinelle.lip6.fr/) is a program which performs mechanical transformations on C programs using semantic patches. These semantic patches can be used to implement automatic refactoring and maintenance tasks. Add a set of basic semantic patches to convert common patterns related to the struct object_id transformation, as well as a README. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27Merge branch 'tb/complete-status'Libravatar Junio C Hamano1-1/+97
The completion script (in contrib/) learned to complete "git status" options. * tb/complete-status: completion: add git status completion: add __git_get_option_value helper completion: factor out untracked file modes into a variable
2016-06-27Merge branch 'nb/gnome-keyring-build'Libravatar Junio C Hamano1-2/+3
Build improvements for gnome-keyring (in contrib/) * nb/gnome-keyring-build: gnome-keyring: Don't hard-code pkg-config executable
2016-06-27Merge branch 'vs/prompt-avoid-unset-variable'Libravatar Junio C Hamano1-3/+3
The git-prompt scriptlet (in contrib/) was not friendly with those who uses "set -u", which has been fixed. * vs/prompt-avoid-unset-variable: git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
2016-06-14gnome-keyring: Don't hard-code pkg-config executableLibravatar Heiko Becker1-2/+3
Helpful if your pkg-config executable has a prefix based on the architecture, for example. Signed-off-by: Heiko Becker <heirecka@exherbo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10completion: add git statusLibravatar Thomas Braun1-0/+50
Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10completion: add __git_get_option_value helperLibravatar Thomas Braun1-0/+44
This function allows to search the commmand line and config files for an option, long and short, with mandatory value. The function would return e.g. for the command line "git status -uno --untracked-files=all" the result "all" regardless of the config option. Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10completion: factor out untracked file modes into a variableLibravatar Thomas Braun1-1/+3
Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_shaLibravatar Ville Skyttä1-3/+3
When the shell is in "nounset" or "set -u" mode, referencing unset or null variables results in an error. Protect $ZSH_VERSION and $BASH_VERSION against that, and initialize $short_sha before use. Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-24completion: support git-worktreeLibravatar Nguyễn Thái Ngọc Duy1-0/+23
This adds bare-bone completion support for git-worktree. More advanced completion (e.g. ref completion in git-worktree-add) can be added later. --force completion in "worktree add" is left out because that option should be handled with care. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>