summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-02-12sequencer.c: teach append_signoff how to detect duplicate s-o-bBrandon Casey
Teach append_signoff how to detect a duplicate s-o-b in the commit footer. This is in preparation to unify the append_signoff implementations in log-tree.c and sequencer.c. Fixes test in t3511. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12sequencer.c: always separate "(cherry picked from" from commit bodyBrandon Casey
Start treating the "(cherry picked from" line added by cherry-pick -x the same way that the s-o-b lines are treated. Namely, separate them from the main commit message body with an empty line. Introduce tests to test this functionality. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12sequencer.c: require a conforming footer to be preceded by a blank lineBrandon Casey
Currently, append_signoff() performs a search for the last line of the commit buffer by searching back from the end until it hits a newline. If it reaches the beginning of the buffer without finding a newline, that means either the commit message was empty, or there was only one line in it. In this case, append_signoff will skip the call to has_conforming_footer since it already knows that it is necessary to append a newline before appending the sob. Let's perform this function inside of has_conforming_footer where it appropriately belongs and generalize it so that we require that the footer paragraph be an actual distinct paragraph separated by a blank line. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footerBrandon Casey
When 'cherry-pick -s' is used to append a signed-off-by line to a cherry picked commit, it does not currently detect the "(cherry picked from..." that may have been appended by a previous 'cherry-pick -x' as part of the s-o-b footer and it will insert a blank line before appending a new s-o-b. Let's detect "(cherry picked from...)" as part of the footer so that we will produce this: Signed-off-by: A U Thor <author@example.com> (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter <committer@example.com> instead of this: Signed-off-by: A U Thor <author@example.com> (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter <committer@example.com> [with improvements from Jonathan Nieder] Signed-off-by: Brandon Casey <bcasey@nvidia.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12t/t3511: add some tests of 'cherry-pick -s' functionalityBrandon Casey
Add some tests to ensure that 'cherry-pick -s' operates in the following manner: * Inserts a blank line before appending a s-o-b to a commit message that does not contain a s-o-b footer * Does not mistake first line "subject: description" as a s-o-b footer * Does not mistake single word message body as conforming to rfc2822 * Appends a s-o-b when last s-o-b in footer does not match committer s-o-b, even when committer's s-o-b exists elsewhere in footer. * Does not append a s-o-b when last s-o-b matches committer s-o-b * Correctly detects a non-conforming footer containing a mix of s-o-b like elements and s-o-b elements. (marked "expect failure") Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12t/test-lib-functions.sh: allow to specify the tag name to test_commitBrandon Casey
The <message> part of test_commit() may not be appropriate for a tag name. So let's allow test_commit to accept a fourth argument to specify the tag name. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12commit, cherry-pick -s: remove broken support for multiline rfc2822 fieldsBrandon Casey
Starting with c1e01b0c (commit: More generous accepting of RFC-2822 footer lines, 2009-10-28), "git commit -s" carefully parses the last paragraph of each commit message to check if it consists only of RFC2822-style headers, in which case the signoff will be added as a new line in the same list: Reported-by: Reporter <reporter@example.com> Signed-off-by: Author <author@example.com> Acked-by: Lieutenant <lt@example.com> It even included support for accepting indented continuation lines for multiline fields. Unfortunately the multiline field support is broken because it checks whether buf[k] (the first character of the *next* line) instead of buf[i] is a whitespace character. The result is that any footer with a continuation line is not accepted, since the last continuation line neither starts with an RFC2822 field name nor is followed by a continuation line. That this has remained broken for so long is good evidence that nobody actually needed multiline fields. Rip out the broken continuation support. There should be no functional change. [Thanks to Jonathan Nieder for the excellent commit message] Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12sequencer.c: rework search for start of footer to improve clarityJonathan Nieder
This code sequence is somewhat difficult to read. Let's rewrite it and add some comments to improve clarity. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26Update draft release notes to 1.8.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26Merge branch 'rr/submodule-diff-config'Junio C Hamano
Allow "git diff --submodule=log" to set to be the default via configuration. * rr/submodule-diff-config: submodule: display summary header in bold diff: rename "set" variable diff: introduce diff.submodule configuration variable Documentation: move diff.wordRegex from config.txt to diff-config.txt
2012-11-26Merge branch 'nd/maint-compat-fnmatch-fix'Junio C Hamano
* nd/maint-compat-fnmatch-fix: compat/fnmatch: fix off-by-one character class's length check
2012-11-26Merge branch 'bc/do-not-recurse-in-die'Junio C Hamano
* bc/do-not-recurse-in-die: usage.c: detect recursion in die routines and bail out immediately
2012-11-26Merge branch 'mk/complete-tcsh'Junio C Hamano
* mk/complete-tcsh: tcsh-completion re-using git-completion.bash
2012-11-26Merge branch 'jh/update-ref-d-through-symref'Junio C Hamano
"update-ref -d --deref SYM" to delete a ref through a symbolic ref that points to it did not remove it correctly. * jh/update-ref-d-through-symref: Fix failure to delete a packed ref through a symref t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
2012-11-26Merge branch 'lt/diff-stat-show-0-lines'Junio C Hamano
We failed to mention a file without any content change but whose permission bit was modified, or (worse yet) a new file without any content in the "git diff --stat" output. * lt/diff-stat-show-0-lines: Fix "git diff --stat" for interesting - but empty - file changes
2012-11-26Merge branch 'sg/complete-help-undup'Junio C Hamano
* sg/complete-help-undup: completion: remove 'help' duplicate from porcelain commands
2012-11-26Sync with 1.8.0.1Junio C Hamano
2012-11-26Git 1.8.0.1v1.8.0.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26Merge branch 'jk/checkout-out-of-unborn' into maintJunio C Hamano
* jk/checkout-out-of-unborn: checkout: print a message when switching unborn branches
2012-11-26Merge branch 'cn/config-missing-path' into maintJunio C Hamano
* cn/config-missing-path: config: don't segfault when given --path with a missing value
2012-11-26Merge branch 'jk/maint-gitweb-xss' into maintJunio C Hamano
Fixes an XSS vulnerability in gitweb. * jk/maint-gitweb-xss: gitweb: escape html in rss title
2012-11-25Completion must sort before using uniqMarc Khouzam
The user can be presented with invalid completion results when trying to complete a 'git checkout' command. This can happen when using a branch name prefix that matches multiple remote branches. For example, if available branches are: master remotes/GitHub/maint remotes/GitHub/master remotes/origin/maint remotes/origin/master When performing completion on 'git checkout ma' the user will be given the choices: maint master However, 'git checkout maint' will fail in this case, although completion previously said 'maint' was valid. Furthermore, when performing completion on 'git checkout mai', no choices will be suggested. So, the user is first told that the branch name 'maint' is valid, but when trying to complete 'mai' into 'maint', that completion is no longer valid. The completion results should never propose 'maint' as a valid branch name, since 'git checkout' will refuse it. The reason for this bug is that the uniq program only works with sorted input. The man page states "uniq prints the unique lines in a sorted file". When __git_refs uses the guess heuristic employed by checkout for tracking branches it wants to consider remote branches but only if the branch name is unique. To do that, it calls 'uniq -u'. However the input given to 'uniq -u' is not sorted. Therefore, in the above example, when dealing with 'git checkout ma', "__git_refs '' 1" will find the following list: master maint master maint master which, when passed to 'uniq -u' will remain the same. Therefore 'maint' will be wrongly suggested as a valid option. When dealing with 'git checkout mai', the list will be: maint maint which happens to be sorted and will be emptied by 'uniq -u', properly ignoring 'maint'. A solution for preventing the completion script from suggesting such invalid branch names is to first call 'sort' and then 'uniq -u'. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-21Update draft release notes for 1.8.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-21Merge branch 'esr/maint-doc-fast-import'Junio C Hamano
* esr/maint-doc-fast-import: doc/fast-import: clarify how content states are built
2012-11-21Merge branch 'wtk/submodule-doc-fixup'Junio C Hamano
* wtk/submodule-doc-fixup: git-submodule: wrap branch option with "<>" in usage strings.
2012-11-21Merge branch 'so/prompt-command'Junio C Hamano
Updates __git_ps1 so that it can be used as $PROMPT_COMMAND, instead of being used for command substitution in $PS1, to embed color escape sequences in its output. * so/prompt-command: coloured git-prompt: paint detached HEAD marker in red Fix up colored git-prompt show color hints based on state of the git tree Allow __git_ps1 to be used in PROMPT_COMMAND
2012-11-21Merge branch 'jk/config-ignore-duplicates'Junio C Hamano
Drop duplicate detection from "git-config --get"; this lets it better match the internal config callbacks, which clears up some corner cases with includes. * jk/config-ignore-duplicates: builtin/config.c: Fix a sparse warning git-config: use git_config_with_options git-config: do not complain about duplicate entries git-config: collect values instead of immediately printing git-config: fix regexp memory leaks on error conditions git-config: remove memory leak of key regexp t1300: test "git config --get-all" more thoroughly t1300: remove redundant test t1300: style updates
2012-11-21Merge branch 'jk/maint-http-half-auth-fetch'Junio C Hamano
Finishing touches to squelch a compiler warning. * jk/maint-http-half-auth-fetch: remote-curl.c: Fix a compiler warning
2012-11-21remote-curl.c: Fix a compiler warningRamsay Jones
In particular, gcc issues an "'gzip_size' might be used uninitialized" warning (-Wuninitialized). However, this warning is a false positive, since the 'gzip_size' variable would not, in fact, be used uninitialized. In order to suppress the warning, we simply initialise the variable to zero in it's declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20compat/fnmatch: fix off-by-one character class's length checkNguyễn Thái Ngọc Duy
Character class "xdigit" is the only one that hits 6 character limit defined by CHAR_CLASS_MAX_LENGTH. All other character classes are 5 character long and therefore never caught by this. This should make xdigit tests in t3070 pass on Windows. Reported-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Sixth batch for 1.8.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Merge branch 'ml/cygwin-mingw-headers'Junio C Hamano
Make git compile on cygwin with newer header files. * ml/cygwin-mingw-headers: USE CGYWIN_V15_WIN32API as macro to select api for cygwin Update cygwin.c for new mingw-64 win32 api headers
2012-11-20Merge branch 'jk/checkout-out-of-unborn'Junio C Hamano
* jk/checkout-out-of-unborn: checkout: print a message when switching unborn branches
2012-11-20Merge branch 'cn/config-missing-path'Junio C Hamano
"git config --path $key" segfaulted on "[section] key" (a boolean "true" spelled without "=", not "[section] key = true"). * cn/config-missing-path: config: don't segfault when given --path with a missing value
2012-11-20Merge branch 'jl/submodule-rm'Junio C Hamano
* jl/submodule-rm: docs: move submodule section
2012-11-20Merge branch 'mg/replace-resolve-delete'Junio C Hamano
Be more user friendly to people using "git replace -d". * mg/replace-resolve-delete: replace: parse revision argument for -d
2012-11-20Merge branch 'jk/maint-gitweb-xss'Junio C Hamano
Fixes an XSS vulnerability in gitweb. * jk/maint-gitweb-xss: gitweb: escape html in rss title
2012-11-20Merge branch 'rh/maint-gitweb-highlight-ext'Junio C Hamano
Fixes a clever misuse of perl's list interpretation. * rh/maint-gitweb-highlight-ext: gitweb.perl: fix %highlight_ext mappings
2012-11-20Merge branch 'pw/maint-p4-rcs-expansion-newline'Junio C Hamano
I do not have p4 to play with, but looks obviously correct to me. * pw/maint-p4-rcs-expansion-newline: git p4: RCS expansion should not span newlines
2012-11-20Merge branch 'mh/alt-odb-string-list-cleanup'Junio C Hamano
Cleanups in the alternates code. Fixes a potential bug and makes the code much cleaner. * mh/alt-odb-string-list-cleanup: link_alt_odb_entries(): take (char *, len) rather than two pointers link_alt_odb_entries(): use string_list_split_in_place()
2012-11-20Merge branch 'ta/doc-cleanup'Junio C Hamano
* ta/doc-cleanup: Documentation: build html for all files in technical and howto Documentation/howto: convert plain text files to asciidoc Documentation/technical: convert plain text files to asciidoc Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txt Shorten two over-long lines in git-bisect-lk2009.txt by abbreviating some sha1 Split over-long synopsis in git-fetch-pack.txt into several lines
2012-11-20Merge branch 'kb/preload-index-more'Junio C Hamano
Use preloadindex in more places, which has a nice speedup on systems with slow stat calls (and even on Linux). * kb/preload-index-more: update-index/diff-index: use core.preloadindex to improve performance
2012-11-20Merge branch 'jk/maint-http-half-auth-fetch'Junio C Hamano
Fixes fetch from servers that ask for auth only during the actual packing phase. This is not really a recommended configuration, but it cleans up the code at the same time. * jk/maint-http-half-auth-fetch: remote-curl: retry failed requests for auth even with gzip remote-curl: hoist gzip buffer size to top of post_rpc
2012-11-20Sync with maintJunio C Hamano
* maint: Further preparation for 1.8.0.1
2012-11-20Further preparation for 1.8.0.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Merge branch 'mg/maint-pull-suggest-upstream-to' into maintJunio C Hamano
* mg/maint-pull-suggest-upstream-to: push/pull: adjust missing upstream help text to changed interface
2012-11-20Merge branch 'mm/maint-doc-commit-edit' into maintJunio C Hamano
* mm/maint-doc-commit-edit: Document 'git commit --no-edit' explicitly
2012-11-20Merge branch 'as/maint-doc-fix-no-post-rewrite' into maintJunio C Hamano
* as/maint-doc-fix-no-post-rewrite: commit: fixup misplacement of --no-post-rewrite description
2012-11-20Merge branch 'rs/lock-correct-ref-during-delete' into maintJunio C Hamano
* rs/lock-correct-ref-during-delete: refs: lock symref that is to be deleted, not its target
2012-11-20Merge branch 'rf/maint-mailmap-off-by-one' into maintJunio C Hamano
* rf/maint-mailmap-off-by-one: mailmap: avoid out-of-bounds memory access