summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* refs: write packed_refs file using stdiojk/write-packed-refs-via-stdioJeff King2014-09-103-23/+33
| | | | | | | | | | | | | | | | | | | | We write each line of a new packed-refs file individually using a write() syscall (and sometimes 2, if the ref is peeled). Since each line is only about 50-100 bytes long, this creates a lot of system call overhead. We can instead open a stdio handle around our descriptor and use fprintf to write to it. The extra buffering is not a problem for us, because nobody will read our new packed-refs file until we call commit_lock_file (by which point we have flushed everything). On a pathological repository with 8.5 million refs, this dropped the time to run `git pack-refs` from 20s to 6s. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update draft release notes to 2.2Junio C Hamano2014-09-091-3/+42
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'sp/pack-protocol-doc-on-shallow'Junio C Hamano2014-09-091-1/+1
|\ | | | | | | | | * sp/pack-protocol-doc-on-shallow: Document LF appearing in shallow command during send-pack/receive-pack
| * Document LF appearing in shallow command during send-pack/receive-packsp/pack-protocol-doc-on-shallowShawn Pearce2014-08-281-1/+1
| | | | | | | | | | | | | | | | The implementation sends an LF, but the protocol documentation was missing this detail. Signed-off-by: Shawn Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'tf/imap-send-create'Junio C Hamano2014-09-092-51/+33
|\ \ | | | | | | | | | | | | | | | * tf/imap-send-create: imap-send: create target mailbox if it is missing imap-send: clarify CRAM-MD5 vs LOGIN documentation
| * | imap-send: create target mailbox if it is missingtf/imap-send-createTony Finch2014-08-251-50/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MUAs delete their "drafts" folder when it is empty, so git imap-send should be able to create it if necessary. This change checks that the folder exists immediately after login and tries to create it if it is missing. There was some vestigial code to handle a [TRYCREATE] response from the server when an APPEND target is missing. However this code never ran (the create and trycreate flags were never set) and when I tried to make it run I found that the code had already thrown away the contents of the message it was trying to append. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | imap-send: clarify CRAM-MD5 vs LOGIN documentationTony Finch2014-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Explicitly mention that leaving imap.authMethod unset makes git imap-send use the basic IMAP plaintext LOGIN command. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/prompt-stash-could-be-packed'Junio C Hamano2014-09-091-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prompt script checked $GIT_DIR/ref/stash file to see if there is a stash, which was a no-no. * jk/prompt-stash-could-be-packed: git-prompt: do not look for refs/stash in $GIT_DIR
| * | | git-prompt: do not look for refs/stash in $GIT_DIRjk/prompt-stash-could-be-packedJeff King2014-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since dd0b72c (bash prompt: use bash builtins to check stash state, 2011-04-01), git-prompt checks whether we have a stash by looking for $GIT_DIR/refs/stash. Generally external programs should never do this, because they would miss packed-refs. That commit claims that packed-refs does not pack refs/stash, but that is not quite true. It does pack the ref, but due to a bug, fails to prune the ref. When we fix that bug, we would want to be doing the right thing here. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'tb/pretty-format-cd-date-format'Junio C Hamano2014-09-091-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation update. * tb/pretty-format-cd-date-format: pretty: note that %cd respects the --date= option
| * | | | pretty: note that %cd respects the --date= optiontb/pretty-format-cd-date-formatThomas Braun2014-08-211-1/+1
| |/ / / | | | | | | | | | | | | | | | | Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'rs/inline-compat-path-macros'Junio C Hamano2014-09-091-6/+22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * rs/inline-compat-path-macros: turn path macros into inline function
| * | | | turn path macros into inline functionrs/inline-compat-path-macrosRené Scharfe2014-08-181-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use static inline functions instead of macros for has_dos_drive_prefix, offset_1st_component, is_dir_sep and find_last_dir_sep in order to let the compiler do type checking. The definitions of offset_1st_component and is_dir_sep are switched around because the former uses the latter. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'rs/clean-menu-item-defn'Junio C Hamano2014-09-091-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * rs/clean-menu-item-defn: clean: use f(void) instead of f() to declare a pointer to a function without arguments
| * | | | | clean: use f(void) instead of f() to declare a pointer to a function without ↵rs/clean-menu-item-defnRené Scharfe2014-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments Explicitly state that menu_item functions like clean_cmd don't take any arguments by using void instead of an empty parameter list. Found using gcc -Wstrict-prototypes. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jc/config-mak-document-darwin-vs-macosx'Junio C Hamano2014-09-091-0/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/config-mak-document-darwin-vs-macosx: config.mak.uname: add hint on uname_R for MacOS X config.mak.uname: set NO_APPLE_COMMON_CRYPTO on older systems
| * | | | | | config.mak.uname: add hint on uname_R for MacOS Xjc/config-mak-document-darwin-vs-macosxJunio C Hamano2014-08-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I always have to scratch my head every time I see this cryptic pattern "[15678]\."; leave a short note to remind the maintainer and the reviewers. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | config.mak.uname: set NO_APPLE_COMMON_CRYPTO on older systemskm/no-apple-common-crypto-on-darwin-8-and-belowKyle J. McKay2014-08-151-0/+1
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Older MacOS systems prior to 10.5 do not have the CommonCrypto support Git uses so set NO_APPLE_COMMON_CRYPTO on those systems. Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'sb/mailsplit-dead-code-removal'Junio C Hamano2014-09-091-11/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/mailsplit-dead-code-removal: mailsplit.c: remove dead code
| * | | | | | mailsplit.c: remove dead codesb/mailsplit-dead-code-removalStefan Beller2014-08-131-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was found by coverity. (Id: 290001) The variable 'output' is assigned to a value after all gotos to the corrupt label. Remove the goto by moving the errorhandling code to the condition, which detects the error. Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Helped-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'so/rebase-doc'Junio C Hamano2014-09-091-5/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | May need further updates to the description to explain what makes various modes of operation to decide that the request can become a "no-op". * so/rebase-doc: Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op
| * | | | | | | Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-opSergey Organov2014-08-121-5/+2
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Current branch is a descendant of the commit you are rebasing onto" does not necessarily mean "rebase" requires "--force". For a plain vanilla "history flattening" rebase, the rebase can be done without forcing if there is a merge between the tip of the branch being rebased and the commit you are rebasing onto, even if the tip is descendant of the other. [jc: reworded both the text and the log description] Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'sb/prepare-revision-walk-error-check'Junio C Hamano2014-09-093-3/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/prepare-revision-walk-error-check: prepare_revision_walk(): check for return value in all places
| * | | | | | | prepare_revision_walk(): check for return value in all placessb/prepare-revision-walk-error-checkStefan Beller2014-08-123-3/+7
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even the documentation tells us: You should check if it returns any error (non-zero return code) and if it does not, you can start using get_revision() to do the iteration. In preparation for this commit, I grepped all occurrences of prepare_revision_walk and added error messages, when there were none. Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'sb/blame-msg-i18n'Junio C Hamano2014-09-091-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/blame-msg-i18n: builtin/blame.c: add translation to warning about failed revision walk
| * | | | | | | builtin/blame.c: add translation to warning about failed revision walksb/blame-msg-i18nStefan Beller2014-08-121-1/+1
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'nd/strbuf-utf8-replace'Junio C Hamano2014-09-092-0/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nd/strbuf-utf8-replace: utf8.c: fix strbuf_utf8_replace() consuming data beyond input string
| * | | | | | | utf8.c: fix strbuf_utf8_replace() consuming data beyond input stringnd/strbuf-utf8-replaceNguyễn Thái Ngọc Duy2014-08-112-0/+10
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main loop in strbuf_utf8_replace() could summed up as: while ('src' is still valid) { 1) advance 'src' to copy ANSI escape sequences 2) advance 'src' to copy/replace visible characters } The problem is after #1, 'src' may have reached the end of the string (so 'src' points to NUL) and #2 will continue to copy that NUL as if it's a normal character. Because the output is stored in a strbuf, this NUL accounted in the 'len' field as well. Check after #1 and break the loop if necessary. The test does not look obvious, but the combination of %>>() should make a call trace like this show_log() pretty_print_commit() format_commit_message() strbuf_expand() format_commit_item() format_and_pad_commit() strbuf_utf8_replace() where %C(auto)%d would insert a color reset escape sequence in the end of the string given to strbuf_utf8_replace() and show_log() uses fwrite() to send everything to stdout (including the incorrect NUL inserted by strbuf_utf8_replace) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'sb/plug-leaks'Junio C Hamano2014-09-092-3/+5
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/plug-leaks: clone.c: don't leak memory in cmd_clone remote.c: don't leak the base branch name in format_tracking_info
| * | | | | | | clone.c: don't leak memory in cmd_clonesb/plug-leaksStefan Beller2014-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Free the refspec. Found by scan.coverity.com (Id: 1127806) Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | remote.c: don't leak the base branch name in format_tracking_infoStefan Beller2014-08-101-3/+3
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by scan.coverity.com (Id: 1127809) Signed-off-by: Stefan Beller <stefanbeller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'rs/refresh-beyond-symlink'Junio C Hamano2014-09-092-0/+51
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git add x" where x that used to be a directory has become a symbolic link to a directory misbehaved. * rs/refresh-beyond-symlink: read-cache: check for leading symlinks when refreshing index
| * | | | | | | read-cache: check for leading symlinks when refreshing indexrs/refresh-beyond-symlinkRené Scharfe2014-08-102-0/+51
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't add paths with leading symlinks to the index while refreshing; we only track those symlinks themselves. We already ignore them while preloading (see read_index_preload.c). Reported-by: Nikolay Avdeev <avdeev@math.vsu.ru> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'la/init-doc'Junio C Hamano2014-09-091-39/+46
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * la/init-doc: Documentation: git-init: flesh out example Documentation: git-init: template directory: reword and cross-reference Documentation: git-init: reword parenthetical statements Documentation: git-init: --separate-git-dir: clarify Documentation: git-init: template directory: reword Documentation: git-init: list items facelift Documentation: git-init: typographical fixes
| * | | | | | | Documentation: git-init: flesh out examplela/init-docLinus Arver2014-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a third step `git commit` after adding files for the first time. Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: template directory: reword and cross-referenceLinus Arver2014-08-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: reword parenthetical statementsLinus Arver2014-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: --separate-git-dir: clarifyLinus Arver2014-08-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use shorter sentences to describe what actually happens. We describe what the term "Git symbolic link" actually means. Also, we separate out the description of the behavioral change upon reinitialization into its own paragraph. Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: template directory: rewordLinus Arver2014-08-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: list items faceliftLinus Arver2014-08-081-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No textual change. Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation: git-init: typographical fixesLinus Arver2014-08-081-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use backticks when we quote something that the user should literally use. Signed-off-by: Linus Arver <linusarver@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jk/stash-list-p'Junio C Hamano2014-09-092-1/+43
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach "git stash list -p" to show the difference between the base commit version and the working tree version, which is in line with what "git show" gives. * jk/stash-list-p: stash: default listing to working-tree diff
| * | | | | | | | stash: default listing to working-tree diffjk/stash-list-pJeff King2014-08-072-1/+43
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you list stashes, you can provide arbitrary git-log options to change the display. However, adding just "-p" does nothing, because each stash is actually a merge commit. This implementation detail is easy to forget, leading to confused users who think "-p" is not working. We can make this easier by defaulting to "--first-parent -m", which will show the diff against the working tree. This omits the index portion of the stash entirely, but it's simple and it matches what "git stash show" provides. People who are more clueful about stash's true form can use "--cc" to override the "-m", and the "--first-parent" will then do nothing. For diffs, it only affects non-combined diffs, so "--cc" overrides it. And for the traversal, we are walking the linear reflog anyway, so we do not even care about the parents. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'mm/log-branch-desc-plug-leak'Junio C Hamano2014-09-091-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mm/log-branch-desc-plug-leak: builtin/log.c: fix minor memory leak
| * | | | | | | | builtin/log.c: fix minor memory leakmm/log-branch-desc-plug-leakMatthieu Moy2014-08-071-0/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'lf/bundle-exclusion'Junio C Hamano2014-09-092-3/+6
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git bundle create" with date-range specification were meant to exclude tags outside the range * lf/bundle-exclusion: bundle: fix exclusion of annotated tags
| * | | | | | | | bundle: fix exclusion of annotated tagslf/bundle-exclusionLukas Fleischer2014-08-072-3/+6
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit c9a42c4 (bundle: allow rev-list options to exclude annotated tags, 2009-01-02), support for excluding annotated tags outside the specified date range was added. However, the wrong order of parameters was chosen when calling memchr(). Fix this by swapping the character to search for with the maximum length parameter. Also cover this behavior with an additional test. Signed-off-by: Lukas Fleischer <git@cryptocrack.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jc/apply-ws-prefix'Junio C Hamano2014-09-093-63/+96
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying a patch not generated by Git in a subdirectory used to check the whitespace breakage using the attributes for incorrect paths. Also whitespace checks were performed even for paths excluded via "git apply --exclude=<path>" mechanism. * jc/apply-ws-prefix: apply: omit ws check for excluded paths apply: hoist use_patch() helper for path exclusion up apply: use the right attribute for paths in non-Git patches
| * | | | | | | | apply: omit ws check for excluded pathsjc/apply-ws-prefixJunio C Hamano2014-08-072-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whitespace breakages are checked while the patch is being parsed. Disable them at the beginning of parse_chunk(), where each individual patch is parsed, immediately after we learn the name of the file the patch applies to and before we start parsing the diff contained in the patch. One may naively think that we should be able to not just skip the whitespace checks but simply fast-forward to the next patch without doing anything once use_patch() tells us that this patch is not going to be used. But in reality we cannot really skip much of the parsing in order to do such a "fast-forward", primarily because parsing "@@ -k,l +m,n @@" lines and counting the input lines is how we determine the boundaries of individual patches. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | apply: hoist use_patch() helper for path exclusion upJunio C Hamano2014-08-071-38/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will be adding a caller to the function a bit earlier in this file in a later patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>