summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-05-26t: test subject handling in format-patch / am pipelineJeff King
Commit a1f6baa (format-patch: wrap long header lines, 2011-02-23) changed format-patch's behavior with respect to long header lines, but made no accompanying changes to the receiving side. It was thought that "git am" would handle these folded subjects fine, but there is a regression when using "am -k". Let's add a test documenting this. While we're at it, let's give more complete test coverage to document what should be happening in each case. We test three types of subjects: a short one, one long enough to require wrapping, and a multiline subject. For each, we test these three combinations: format-patch | am format-patch -k | am format-patch -k | am -k We don't bother testing "format-patch | am -k", which is nonsense (you will be adding in [PATCH] cruft to each subject). This reveals the regression above (long subjects have linebreaks introduced via "format-patch -k | am -k"), as well as an existing non-optimal behavior (multiline subjects are not preserved using "-k"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14format-patch: wrap email addresses after long namesJeff King
We already wrap names in "from" headers, which tend to be the long part of an address. But it's also possible for a long name to not be wrapped, but to make us want to wrap the email address. For example (imagine for the sake of readability we want to wrap at 50 characters instead of 78): From: this is my really long git name <foo@example.com> The name does not overflow the line, but the name and email together do. So we would rather see: From: this is my really long git name <git@example.com> Because we wrap the name separately during add_rfc2047, we neglected this case. Instead, we should see how long the final line of the wrapped name ended up, and decide whether or not to wrap based on that. We can't break the address into multiple parts, so we either leave it with the name, or put it by itself on a line. Test by Erik Faye-Lund. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-24format-patch: rfc2047-encode newlines in headersJeff King
These should generally never happen, as we already concatenate multiples in subjects into a single line. But let's be defensive, since not encoding them means we will output malformed headers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-23format-patch: wrap long header linesJeff King
Subject and identity headers may be arbitrarily long. In the past, we just assumed that single-line headers would be reasonably short. For multi-line subjects that we squish into a single line, we just "pre-folded" the data in pp_title_line by adding a newline and indentation. There were two problems. One is that, although rare, single-line messages can actually be longer than the recommended line-length limits. The second is that the pre-folding interacted badly with rfc2047 encoding, leading to malformed headers. Instead, let's stop pre-folding the subject lines, and just fold everything based on length in add_rfc2047, whether it is encoded or not. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-23strbuf: add fixed-length version of add_wrapped_textJeff King
The function strbuf_add_wrapped_text takes a NUL-terminated string. This makes it annoying to wrap strings we have as a pointer and a length. Refactoring strbuf_add_wrapped_text and all of its sub-functions to handle fixed-length strings turned out to be really ugly. So this implementation is lame; it just strdups the text and operates on the NUL-terminated version. This should be fine as the strings we are wrapping are generally pretty short. If it becomes a problem, we can optimize later. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-31Git 1.7.4v1.7.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27Don't pass "--xhtml" to hightlight in gitweb.perl script.Adam Tkac
The "--xhtml" option is supported only in highlight < 3.0. There is no option to enforce (X)HTML output format compatible with both highlight < 3.0 and highlight >= 3.0. However default output format is HTML so we don't need to explicitly specify it. Signed-off-by: Adam Tkac <atkac@redhat.com> Helped-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27Merge branch 'maint'Junio C Hamano
* maint: rebase -i: clarify in-editor documentation of "exec" tests: sanitize more git environment variables fast-import: treat filemodify with empty tree as delete rebase: give a better error message for bogus branch rebase: use explicit "--" with checkout Conflicts: t/t9300-fast-import.sh
2011-01-27rebase -i: clarify in-editor documentation of "exec"Jonathan Nieder
The hints in the current "instruction sheet" template look like so: # Rebase 3f14246..a1d7e01 onto 3f14246 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. # This does not make it clear that the format of each line is <insn> <commit id> <explanatory text that will be printed> but the reader will probably infer that from the automatically generated pick examples above it. What about the "exec" instruction? By analogy, I might imagine that the format of that line is "exec <command> <explanatory text>", and the "x <cmd>" hint does not address that question (at first I read it as taking an argument <cmd> that is the name of a shell). Meanwhile, the mention of <cmd> makes the hints harder to scan as a table. So remove the <cmd> and add some words to remind the reader that "exec" runs a command named by the rest of the line. To make room, it is left to the manpage to explain that that command is run using $SHELL and that nonzero status from that command will pause the rebase. Wording from Junio. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27tests: sanitize more git environment variablesJeff King
These variables should generally not be set in one's environment, but they do get set by rebase, which means doing an interactive rebase like: pick abcd1234 foo exec make test will cause false negatives in the test suite. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27Merge branch 'jn/fast-import-empty-tree-removal' into maintJunio C Hamano
* jn/fast-import-empty-tree-removal: fast-import: treat filemodify with empty tree as delete
2011-01-27fast-import: treat filemodify with empty tree as deleteJonathan Nieder
Normal git processes do not allow one to build a tree with an empty subtree entry without trying hard at it. This is in keeping with the general UI philosophy: git tracks content, not empty directories. v1.7.3-rc0~75^2 (2010-06-30) changed that by making it easy to include an empty subtree in fast-import's active commit: M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 subdir One can trigger this by reading an empty tree (for example, the tree corresponding to an empty root commit) and trying to move it to a subtree. It is better and more closely analogous to 'git read-tree --prefix' to treat such commands as requests to remove the subtree. Noticed-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27rebase: give a better error message for bogus branchJeff King
When you give a non-existent branch to git-rebase, it spits out the usage. This can be confusing, since you may understand the usage just fine, but simply have made a mistake in the branch name. Before: $ git rebase origin bogus Usage: git rebase ... After: $ git rebase origin bogus fatal: no such branch: bogus Usage: git rebase ... Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27rebase: use explicit "--" with checkoutJeff King
In the case of a ref/pathname conflict, checkout will already do the right thing and checkout the ref. However, for a non-existant ref, this has two advantages: 1. If a file with that pathname exists, rebase will refresh the file from the index and then rebase the current branch instead of producing an error. 2. If no such file exists, the error message using an explicit "--" is better: # before $ git rebase -i origin bogus error: pathspec 'bogus' did not match any file(s) known to git. Could not checkout bogus # after $ git rebase -i origin bogus fatal: invalid reference: bogus Could not checkout bogus The problems seem to be trigger-able only through "git rebase -i", as regular git-rebase checks the validity of the branch parameter as a ref very early on. However, it doesn't hurt to be defensive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24Git 1.7.4-rc3v1.7.4-rc3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24Merge branch 'as/userdiff-pascal'Junio C Hamano
* as/userdiff-pascal: userdiff: match Pascal class methods
2011-01-24Merge branch 'jn/setup-fixes'Junio C Hamano
* jn/setup-fixes: t1510: fix typo in the comment of a test Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase Subject: setup: officially support --work-tree without --git-dir tests: compress the setup tests tests: cosmetic improvements to the repo-setup test t/README: hint about using $(pwd) rather than $PWD in tests Fix expected values of setup tests on Windows
2011-01-24t1510: fix typo in the comment of a testJonathan Nieder
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecaseJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-21Subject: setup: officially support --work-tree without --git-dirJonathan Nieder
The original intention of --work-tree was to allow people to work in a subdirectory of their working tree that does not have an embedded .git directory. Because their working tree, which their $cwd was in, did not have an embedded .git, they needed to use $GIT_DIR to specify where it is, and because this meant there was no way to discover where the root level of the working tree was, so we needed to add $GIT_WORK_TREE to tell git where it was. However, this facility has long been (mis)used by people's scripts to start git from a working tree _with_ an embedded .git directory, let git find .git directory, and then pretend as if an unrelated directory were the associated working tree of the .git directory found by the discovery process. It happens to work in simple cases, and is not worth causing "regression" to these scripts. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-21Documentation: do not treat reset --keep as a special caseJonathan Nieder
The current treatment of "git reset --keep" emphasizes how it differs from --hard (treatment of local changes) and how it breaks down into plumbing (git read-tree -m -u HEAD <commit> followed by git update-ref HEAD <commit>). This can discourage people from using it, since it might seem to be a complex or niche option. Better to emphasize what the --keep flag is intended for --- moving the index and worktree from one commit to another, like "git checkout" would --- so the reader can make a more informed decision about the appropriate situations in which to use it. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-20Correctly report corrupted objectsBjörn Steinbrink
The errno check added in commit 3ba7a06 "A loose object is not corrupt if it cannot be read due to EMFILE" only checked for whether errno is not ENOENT and thus incorrectly treated "no error" as an error condition. Because of that, it never reached the code path that would report that the object is corrupted and instead caused funny errors like: fatal: failed to read object 333c4768ce595793fdab1ef3a036413e2a883853: Success So we have to extend the check to cover the case in which the object file was successfully read, but its contents are corrupted. Reported-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19tests: compress the setup testsJonathan Nieder
New test helpers: - setup_repo, to initialize a repository or gitfile pointing to a repository, with core.bare and core.worktree set as specified; - try_case, to run setup from a given directory and validate the result, with GIT_DIR and GIT_WORK_TREE set as specified; - try_repo, to initialize a repository and call "try_case" from the toplevel and a subdirectory; - run_wt_tests, to run a battery of tests that check for sane behavior when GIT_WORK_TREE is set to various positions relative to the .git dir and cwd. Use these helpers to make the test shorter, less repetitive, and (one hopes) easier to understand and modify. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19tests: cosmetic improvements to the repo-setup testJonathan Nieder
Give an overview in "sh t1510-repo-setup.sh --help" output. Waste some vertical and horizontal space for clearer code. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19Merge branch 'maint'Junio C Hamano
* maint: exec_cmd: remove unused extern
2011-01-19exec_cmd: remove unused externErik Faye-Lund
This definition was added by commit 77cb17e9, but it's left unused since commit 511707d. Remove the left-over definition. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19Merge branch 'jn/gitweb-no-logo' into maintJunio C Hamano
* jn/gitweb-no-logo: gitweb: make logo optional
2011-01-19Merge branch 'jk/diff-driver-binary-doc' into maintJunio C Hamano
* jk/diff-driver-binary-doc: docs: explain diff.*.binary option
2011-01-19Merge branch 'tr/submodule-relative-scp-url' into maintJunio C Hamano
* tr/submodule-relative-scp-url: submodule: fix relative url parsing for scp-style origin
2011-01-19Merge branch 'rj/maint-difftool-cygwin-workaround' into maintJunio C Hamano
* rj/maint-difftool-cygwin-workaround: difftool: Fix failure on Cygwin
2011-01-19Merge branch 'rj/maint-test-fixes' into maintJunio C Hamano
* rj/maint-test-fixes: t9501-*.sh: Fix a test failure on Cygwin lib-git-svn.sh: Add check for mis-configured web server variables lib-git-svn.sh: Avoid setting web server variables unnecessarily t9142: Move call to start_httpd into the setup test t3600-rm.sh: Don't pass a non-existent prereq to test #15
2011-01-19Merge branch 'jn/maint-gitweb-pathinfo-fix' into maintJunio C Hamano
* jn/maint-gitweb-pathinfo-fix: gitweb: Fix handling of whitespace in generated links
2011-01-19Merge branch 'ak/describe-exact' into maintJunio C Hamano
* ak/describe-exact: describe: Delay looking up commits until searching for an inexact match describe: Store commit_names in a hash table by commit SHA1 describe: Do not use a flex array in struct commit_name describe: Use for_each_rawref
2011-01-19Merge branch 'jn/maint-fast-import-object-reuse' into maintJunio C Hamano
* jn/maint-fast-import-object-reuse: fast-import: insert new object entries at start of hash bucket
2011-01-19Merge branch 'jn/submodule-b-current' into maintJunio C Hamano
* jn/submodule-b-current: git submodule: Remove now obsolete tests before cloning a repo git submodule -b ... of current HEAD fails
2011-01-19Merge branch 'jc/maint-svn-info-test-fix' into maintJunio C Hamano
* jc/maint-svn-info-test-fix: t9119: do not compare "Text Last Updated" line from "svn info"
2011-01-19Merge branch 'nd/maint-relative' into maintJunio C Hamano
* nd/maint-relative: get_cwd_relative(): do not misinterpret root path
2011-01-19Documentation/fast-import: put explanation of M 040000 <dataref> "" in contextJonathan Nieder
Omit needless words ("Additionally ... <path> may also" is redundant). While at it, place the explanation of this special case after the general rules for paths to provide the reader with some context. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19svndump.c: Fix a printf format compiler warningRamsay Jones
In particular, on systems that define uint32_t as an unsigned long, gcc complains as follows: CC vcs-svn/svndump.o vcs-svn/svndump.c: In function `svndump_read': vcs-svn/svndump.c:215: warning: int format, uint32_t arg (arg 2) In order to suppress the warning we use the C99 format specifier macro PRIu32 from <inttypes.h>. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18remote-ext: do not segfault for blank linesJonathan Nieder
Instead of stripping space characters past the beginning of the line and overflowing a buffer, stop at the beginning of the line (mimicking the corresponding fix in remote-fd). The argument to isspace does not need to be cast explicitly because git isspace takes care of that already. Noticed-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18Documentation/fast-import: capitalize beginning of sentenceJonathan Nieder
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-16ll-merge: simplify opts == NULL caseJonathan Nieder
As long as sizeof(struct ll_merge_options) is small, there is not much reason not to keep a copy of the default merge options in the BSS section. In return, we get clearer code and one less stack frame in the opts == NULL case. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13Git 1.7.4-rc2v1.7.4-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13Merge branch 'jn/gitweb-no-logo'Junio C Hamano
* jn/gitweb-no-logo: gitweb: make logo optional
2011-01-13Merge branch 'jn/perl-funcname'Junio C Hamano
* jn/perl-funcname: userdiff/perl: catch BEGIN/END/... and POD as headers diff: funcname and word patterns for perl
2011-01-13Merge branch 'sr/gitweb-hilite-more'Junio C Hamano
* sr/gitweb-hilite-more: gitweb: remove unnecessary test when closing file descriptor gitweb: add extensions to highlight feature map
2011-01-13Merge branch 'rj/svn-test'Junio C Hamano
* rj/svn-test: lib-git-svn.sh: Move web-server handling code into separate function
2011-01-13Merge branch 'rj/test-fixes'Junio C Hamano
* rj/test-fixes: t4135-*.sh: Skip the "backslash" tests on cygwin t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW t3032-*.sh: Pass the -b (--binary) option to sed on cygwin t6038-*.sh: Pass the -b (--binary) option to sed on cygwin Conflicts: t/t3032-merge-recursive-options.sh
2011-01-13Merge branch 'jk/diff-driver-binary-doc'Junio C Hamano
* jk/diff-driver-binary-doc: docs: explain diff.*.binary option
2011-01-13Merge branch 'jn/t9010-work-around-broken-svnadmin'Junio C Hamano
* jn/t9010-work-around-broken-svnadmin: t9010: svnadmin can fail even if available