summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-10-05Refactor check_refname_format()Libravatar Michael Haggerty1-40/+55
Among other things, extract a function check_refname_component(). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05Change check_ref_format() to take a flags argumentLibravatar Michael Haggerty20-126/+69
Change check_ref_format() to take a flags argument that indicates what is acceptable in the reference name (analogous to "git check-ref-format"'s "--allow-onelevel" and "--refspec-pattern"). This is more convenient for callers and also fixes a failure in the test suite (and likely elsewhere in the code) by enabling "onelevel" and "refspec-pattern" to be allowed independently of each other. Also rename check_ref_format() to check_refname_format() to make it obvious that it deals with refnames rather than references themselves. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05Change bad_ref_char() to return a boolean valueLibravatar Michael Haggerty1-9/+6
Previously most bad characters were indicated by returning 1, but "*" was special-cased to return 2 instead of 1. One caller examined the return value to see whether the special case occurred. But it is easier (to document and understand) for bad_ref_char() simply to return a boolean value, treating "*" like any other bad character. Special-case the handling of "*" (which only occurs in very specific circumstances) at the caller. The resulting calling code thereby also becomes more transparent. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05git check-ref-format: add options --allow-onelevel and --refspec-patternLibravatar Michael Haggerty3-21/+152
Also add tests of the new options. (Actually, one big reason to add the new options is to make it easy to test check_ref_format(), though the options should also be useful to other scripts.) Interpret the result of check_ref_format() based on which types of refnames are allowed. However, because check_ref_format() can only return a single value, one test case is still broken. Specifically, the case "git check-ref-format --onelevel '*'" incorrectly succeeds because check_ref_format() returns CHECK_REF_FORMAT_ONELEVEL for this refname even though the refname is also CHECK_REF_FORMAT_WILDCARD. The type of check that leads to this failure is used elsewhere in "real" code and could lead to bugs; it will be fixed over the next few commits. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05t1402: add some more testsLibravatar Michael Haggerty1-0/+9
The new tests reflect the status quo. Soon the rule for "*.lock" in refname components will be tightened up. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05get_sha1_hex(): do not read past a NUL characterLibravatar Michael Haggerty2-1/+18
Previously, get_sha1_hex() would read one character past the end of a null-terminated string whose strlen was an even number less than 40. Although the function correctly returned -1 in these cases, the extra memory access might have been to uninitialized (or even, conceivably, unallocated) memory. Add a check to avoid reading past the end of a string. This problem was discovered by Thomas Rast <trast@student.ethz.ch> using valgrind. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-07RelNotes/1.7.7: minor fixesLibravatar Michael J Gruber1-26/+26
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-07Minor update to how-to maintain gitLibravatar Junio C Hamano1-7/+6
A few more parts of this document is stale that needs updating to reflect the reality, but I do not regularly rebase topics that are only in "pu" anymore, which may be noteworthy for a commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Update draft release notes to 1.7.7Libravatar Junio C Hamano1-1/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Merge branch 'rc/histogram-diff'Libravatar Junio C Hamano1-0/+2
* rc/histogram-diff: xdiff/xprepare: initialise xdlclassifier_t cf in xdl_prepare_env()
2011-09-06Merge branch 'cb/maint-ls-files-error-report'Libravatar Junio C Hamano1-10/+12
* cb/maint-ls-files-error-report: t3005: do not assume a particular order of stdout and stderr of git-ls-files
2011-09-06Merge branch 'mh/check-ref-format-print-normalize'Libravatar Junio C Hamano3-4/+13
* mh/check-ref-format-print-normalize: Forbid DEL characters in reference names check-ref-format --print: Normalize refnames that start with slashes
2011-09-06Sync with 1.7.6.2Libravatar Junio C Hamano8-41/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Git 1.7.6.2Libravatar Junio C Hamano4-4/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-06Revert "Merge branch 'cb/maint-quiet-push' into maint"Libravatar Junio C Hamano6-39/+10
This reverts commit ffa69e61d3c5730bd4b65a465efc130b0ef3c7df, reversing changes made to 4a13c4d14841343d7caad6ed41a152fee550261d. Adding a new command line option to receive-pack and feed it from send-pack is not an acceptable way to add features, as there is no guarantee that your updated send-pack will be talking to updated receive-pack. New features need to be added via the capability mechanism negotiated over the protocol. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-02Update draft release notes to 1.7.7Libravatar Junio C Hamano1-2/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-02Merge branch 'js/i18n-scripts-2'Libravatar Junio C Hamano1-35/+14
* js/i18n-scripts-2: bisect: take advantage of gettextln, eval_gettextln.
2011-09-02Merge branch 'tr/maint-t3903-misquoted-command'Libravatar Junio C Hamano1-1/+1
* tr/maint-t3903-misquoted-command: t3903: fix misquoted rev-parse invocation
2011-09-02Merge branch 'bc/bisect-test-use-shell-path'Libravatar Junio C Hamano1-1/+1
* bc/bisect-test-use-shell-path: t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare sh
2011-09-02Merge branch 'va/p4-branch-import-test-update'Libravatar Junio C Hamano1-11/+8
* va/p4-branch-import-test-update: git-p4: simple branch tests edits
2011-09-02Merge branch 'tr/maint-strbuf-grow-nul-termination'Libravatar Junio C Hamano1-4/+5
* tr/maint-strbuf-grow-nul-termination: strbuf_grow(): maintain nul-termination even for new buffer
2011-09-02Merge branch 'tr/maint-ident-to-git-memmove'Libravatar Junio C Hamano1-2/+2
* tr/maint-ident-to-git-memmove: Use memmove in ident_to_git
2011-09-02Merge branch 'tr/maint-format-patch-empty-output'Libravatar Junio C Hamano2-4/+28
* tr/maint-format-patch-empty-output: Document negated forms of format-patch --to --cc --add-headers t4014: "no-add-headers" is actually called "no-add-header" t4014: invoke format-patch with --stdout where intended t4014: check for empty files from git format-patch --stdout
2011-09-02Merge branch 'gb/maint-am-stgit-author-to-from-fix'Libravatar Junio C Hamano1-1/+1
* gb/maint-am-stgit-author-to-from-fix: am: fix stgit patch mangling
2011-09-02Merge branch 'gb/maint-am-patch-format-error-message'Libravatar Junio C Hamano2-1/+15
* gb/maint-am-patch-format-error-message: am: format is in $patch_format, not parse_patch Conflicts: git-am.sh
2011-09-02Merge branch 'ms/daemon-timeout-is-in-seconds'Libravatar Junio C Hamano1-5/+5
* ms/daemon-timeout-is-in-seconds: git-daemon.txt: specify --timeout in seconds
2011-09-02Merge branch 'bg/t5540-osx-grep'Libravatar Junio C Hamano1-2/+6
* bg/t5540-osx-grep: t5540-http-test: shorten grep pattern
2011-09-02Merge branch 'jc/clean-exclude-doc'Libravatar Junio C Hamano2-6/+9
* jc/clean-exclude-doc: Documentation: clarify "git clean -e <pattern>"
2011-09-02Merge branch 'mg/maint-notes-C-doc'Libravatar Junio C Hamano1-2/+5
* mg/maint-notes-C-doc: git-notes.txt: clarify -C vs. copy and -F
2011-09-02Merge branch 'fg/submodule-ff-check-before-push'Libravatar Junio C Hamano7-0/+231
* fg/submodule-ff-check-before-push: push: Don't push a repository with unpushed submodules
2011-09-02Merge branch 'rc/diff-cleanup-records'Libravatar Junio C Hamano1-37/+51
* rc/diff-cleanup-records: xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()
2011-09-02Merge branch 'fk/use-kwset-pickaxe-grep-f'Libravatar Junio C Hamano9-34/+1830
* fk/use-kwset-pickaxe-grep-f: obstack: Fix portability issues Use kwset in grep Use kwset in pickaxe Adapt the kwset code to Git Add string search routines from GNU grep Add obstack.[ch] from EGLIBC 2.10
2011-09-02Merge branch 'en/merge-recursive-2'Libravatar Junio C Hamano10-430/+2170
* en/merge-recursive-2: (57 commits) merge-recursive: Don't re-sort a list whose order we depend upon merge-recursive: Fix virtual merge base for rename/rename(1to2)/add-dest t6036: criss-cross + rename/rename(1to2)/add-dest + simple modify merge-recursive: Avoid unnecessary file rewrites t6022: Additional tests checking for unnecessary updates of files merge-recursive: Fix spurious 'refusing to lose untracked file...' messages t6022: Add testcase for spurious "refusing to lose untracked" messages t3030: fix accidental success in symlink rename merge-recursive: Fix working copy handling for rename/rename/add/add merge-recursive: add handling for rename/rename/add-dest/add-dest merge-recursive: Have conflict_rename_delete reuse modify/delete code merge-recursive: Make modify/delete handling code reusable merge-recursive: Consider modifications in rename/rename(2to1) conflicts merge-recursive: Create function for merging with branchname:file markers merge-recursive: Record more data needed for merging with dual renames merge-recursive: Defer rename/rename(2to1) handling until process_entry merge-recursive: Small cleanups for conflict_rename_rename_1to2 merge-recursive: Fix rename/rename(1to2) resolution for virtual merge base merge-recursive: Introduce a merge_file convenience function merge-recursive: Fix modify/delete resolution in the recursive case ...
2011-09-01git-svn: Teach dcommit --mergeinfo to handle multiple linesLibravatar Bryan Jacobs3-2/+19
"svn dcommit --mergeinfo" replaces the svn:mergeinfo property in an upstream SVN repository with the given text. The svn:mergeinfo property may contain commits originating on multiple branches, separated by newlines. Cause space characters in the mergeinfo to be replaced by newlines, allowing a user to create history representing multiple branches being merged into one. Update the corresponding documentation and add a test for the new functionality. Signed-off-by: Bryan Jacobs <bjacobs@woti.com> Acked-by: Sam Vilain <sam@vilain.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2011-09-01git-svn: fix fetch with moved path when using rewriteRootLibravatar Eric Wong1-1/+1
The matching step in commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9 did not properly account for users of the "rewriteRoot" configuration parameter. ref: <CANWsHyfHtr0EaJtNsDK9UTcmb_AbLg-1jUA-0uWJ-nEeNosb7w@mail.gmail.com> Suggested-by: H Krishnan <hetchkay@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2011-09-01git-svn: New flag to emulate empty directoriesLibravatar Ray Chen3-4/+308
Adds a --preserve-empty-dirs flag to the clone operation that will detect empty directories in the remote Subversion repository and create placeholder files in the corresponding local Git directories. This allows "empty" directories to exist in the history of a Git repository. Also adds the --placeholder-file flag to control the name of any placeholder files created. Default value is ".gitignore". Signed-off-by: Ray Chen <rchen@cs.umd.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
2011-08-31xdiff/xprepare: initialise xdlclassifier_t cf in xdl_prepare_env()Libravatar Tay Ray Chuan1-0/+2
Ensure that the xdl_free_classifier() call on xdlclassifier_t cf is safe even if xdl_init_classifier() isn't called. This may occur in the case where diff is run with --histogram and a call to, say, xdl_prepare_ctx() fails. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-30t6030: use $SHELL_PATH to invoke user's preferred shell instead of bare shLibravatar Brandon Casey1-1/+1
Some platforms (IRIX, Solaris) provide an ancient /bin/sh which chokes on modern shell syntax like $(). SHELL_PATH is provided to allow the user to specify a working sh, let's use it here. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-30bisect: take advantage of gettextln, eval_gettextln.Libravatar Jon Seymour1-35/+14
Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-30Merge branch 'maint'Libravatar Junio C Hamano1-4/+7
* maint: Documentation: clarify effects of -- <path> arguments
2011-08-30t3903: fix misquoted rev-parse invocationLibravatar Thomas Rast1-1/+1
!"git ..." hopefully always succeeds because "git ..." is not the name of any executable. However, that's not what was intended. Unquote it, and while we're at it, also replace ! with test_must_fail since it is a call to git. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-30Documentation: clarify effects of -- <path> argumentsLibravatar Thomas Rast1-4/+7
'git log -- <path>' does not "show commits that affect the specified paths" in a literal sense unless --full-history is given (for example, a file that only existed on a side branch will turn up no commits at all!). Reword it to specify the actual intent of the filtering, and point to the "History Simplification" section. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29strbuf_grow(): maintain nul-termination even for new bufferLibravatar Thomas Rast1-4/+5
In the case where sb is initialized to the slopbuf (through strbuf_init(sb,0) or STRBUF_INIT), strbuf_grow() loses the terminating nul: it grows the buffer, but gives ALLOC_GROW a NULL source to avoid it being freed. So ALLOC_GROW does not copy anything to the new memory area. This subtly broke the call to strbuf_getline in read_next_command() [fast-import.c:1855], which goes strbuf_detach(&command_buf, NULL); # command_buf is now = STRBUF_INIT stdin_eof = strbuf_getline(&command_buf, stdin, '\n'); if (stdin_eof) return EOF; In strbuf_getwholeline, this did strbuf_grow(sb, 0); # loses nul-termination if (feof(fp)) return EOF; strbuf_reset(sb); # this would have nul-terminated! Valgrind found this because fast-import subsequently uses prefixcmp() on command_buf.buf, which after the EOF exit contains only uninitialized memory. Arguably strbuf_getwholeline is also broken, in that it touches the buffer before deciding whether to do any work. However, it seems more futureproof to not let the strbuf API lose the nul-termination by its own fault. So make sure that strbuf_grow() puts in a nul even if it has nowhere to copy it from. This makes strbuf_grow(sb, 0) a semantic no-op as far as readers of the buffer are concerned. Also remove the nul-termination added by strbuf_init, which is made redudant. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29Document negated forms of format-patch --to --cc --add-headersLibravatar Thomas Rast1-1/+8
The negated forms introduced in c426003 (format-patch: add --no-cc, --no-to, and --no-add-headers, 2010-03-07) were not documented anywhere. Add them to the descriptions of the positive forms. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29t4014: "no-add-headers" is actually called "no-add-header"Libravatar Thomas Rast1-2/+2
Since c426003 (format-patch: add --no-cc, --no-to, and --no-add-headers, 2010-03-07) the tests have checked for an option called --no-add-headers introduced by letting the user negate --add-header. However, the parseopt machinery does not automatically pluralize anything, so it is in fact called --no-add-header. Since the option never worked, is not documented anywhere, and implementing an actual --no-add-headers would lead to silly code complications, we just adapt the test to the code. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29t4014: invoke format-patch with --stdout where intendedLibravatar Thomas Rast1-2/+2
The test wrote something along the lines of 0001-foo.patch to output, which of course never contained a signature. Luckily the tested behaviour is actually present. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29t4014: check for empty files from git format-patch --stdoutLibravatar Thomas Rast1-2/+19
Most kinds of failure in 'git format-patch --stdout >output' will result in an empty 'output'. This slips past checks that only verify absence of output, such as the '! grep ...' that are quite prevalent in t4014. Introduce a helper check_patch() that checks that at least From, Date and Subject are present, thus making sure it looks vaguely like a patch (or cover letter) email. Then insert calls to it in all tests that do have positive checks for content. This makes two of the tests fail. Mark them as such; they'll be fixed in a moment. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29Use memmove in ident_to_gitLibravatar Thomas Rast1-2/+2
convert_to_git sets src=dst->buf if any of the preceding conversions actually did any work. Thus in ident_to_git we have to use memmove instead of memcpy as far as src->dst copying is concerned. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29am: fix stgit patch manglingLibravatar Giuseppe Bilotta1-1/+1
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-29git-p4: simple branch tests editsLibravatar Pete Wyckoff1-11/+8
More review comments. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>