summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-10-18diff: introduce diff.<driver>.binaryLibravatar Jeff King4-38/+45
The "diff" gitattribute is somewhat overloaded right now. It can say one of three things: 1. this file is definitely binary, or definitely not (i.e., diff or !diff) 2. this file should use an external diff engine (i.e., diff=foo, diff.foo.command = custom-script) 3. this file should use particular funcname patterns (i.e., diff=foo, diff.foo.(x?)funcname = some-regex) Most of the time, there is no conflict between these uses, since using one implies that the other is irrelevant (e.g., an external diff engine will decide for itself whether the file is binary). However, there is at least one conflicting situation: there is no way to say "use the regular rules to determine whether this file is binary, but if we do diff it textually, use this funcname pattern." That is, currently setting diff=foo indicates that the file is definitely text. This patch introduces a "binary" config option for a diff driver, so that one can explicitly set diff.foo.binary. We default this value to "don't know". That is, setting a diff attribute to "foo" and using "diff.foo.funcname" will have no effect on the binaryness of a file. To get the current behavior, one can set diff.foo.binary to true. This patch also has one additional advantage: it cleans up the interface to the userdiff code a bit. Before, calling code had to know more about whether attributes were false, true, or unset to determine binaryness. Now that binaryness is a property of a driver, we can represent these situations just by passing back a driver struct. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-18diff: unify external diff and funcname parsing codeLibravatar Jeff King4-224/+212
Both sets of code assume that one specifies a diff profile as a gitattribute via the "diff=foo" attribute. They then pull information about that profile from the config as diff.foo.*. The code for each is currently completely separate from the other, which has several disadvantages: - there is duplication as we maintain code to create and search the separate lists of external drivers and funcname patterns - it is difficult to add new profile options, since it is unclear where they should go - the code is difficult to follow, as we rely on the "check if this file is binary" code to find the funcname pattern as a side effect. This is the first step in refactoring the binary-checking code. This patch factors out these diff profiles into "userdiff" drivers. A file with "diff=foo" uses the "foo" driver, which is specified by a single struct. Note that one major difference between the two pieces of code is that the funcname patterns are always loaded, whereas external drivers are loaded only for the "git diff" porcelain; the new code takes care to retain that situation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-18t4012: use test_cmp instead of cmpLibravatar Jeff King1-2/+2
This makes erroneous output slightly easier to see. We also flip the argument order to match our usual style. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-18Merge branch 'pb/commit-where'Libravatar Junio C Hamano2-8/+22
* pb/commit-where: tutorial: update output of git commit reformat informational commit message git commit: Reformat output somewhat builtin-commit.c: show on which branch a commit was added
2008-10-17Merge branch 'maint'Libravatar Junio C Hamano7-6/+101
* maint: t1301-shared-repo.sh: don't let a default ACL interfere with the test git-check-attr(1): add output and example sections xdiff-interface.c: strip newline (and cr) from line before pattern matching t4018-diff-funcname: demonstrate end of line funcname matching flaw t4018-diff-funcname: rework negated last expression test Typo "does not exists" when git remote update remote. remote.c: correct the check for a leading '/' in a remote name Add testcase to ensure merging an early part of a branch is done properly Conflicts: t/t7600-merge.sh
2008-10-16t1301-shared-repo.sh: don't let a default ACL interfere with the testLibravatar Matt McCutchen1-0/+3
This test creates files with several different umasks and expects their permissions to be initialized according to the umask, so a default ACL on the trash directory (which overrides the umask for files created in that directory) causes the test to fail. To avoid that, remove the default ACL if possible with setfacl(1). Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-16git-check-attr(1): add output and example sectionsLibravatar Jonas Fonseca1-0/+50
Plumbing tools should document what output can be expected. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-16xdiff-interface.c: strip newline (and cr) from line before pattern matchingLibravatar Brandon Casey2-2/+12
POSIX doth sayeth: "In the regular expression processing described in IEEE Std 1003.1-2001, the <newline> is regarded as an ordinary character and both a period and a non-matching list can match one. ... Those utilities (like grep) that do not allow <newline>s to match are responsible for eliminating any <newline> from strings before matching against the RE." Thus far git has not been removing the trailing newline from strings matched against regular expression patterns. This has the effect that (quoting Jonathan del Strother) "... a line containing just 'FUNCNAME' (terminated by a newline) will be matched by the pattern '^(FUNCNAME.$)' but not '^(FUNCNAME$)'", and more simply not '^FUNCNAME$'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-16t4018-diff-funcname: demonstrate end of line funcname matching flawLibravatar Brandon Casey1-0/+6
Since the newline is not removed from lines before pattern matching, a pattern cannot match to the end of the line using the '$' operator without using an additional operator which will indirectly match the '\n' character. Introduce a test which should pass, but which does not due to this flaw. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-16t4018-diff-funcname: rework negated last expression testLibravatar Brandon Casey1-1/+2
This test used the non-zero exit status of 'git diff' to indicate that a negated funcname pattern, when placed last, was correctly rejected. The problem with this is that 'git diff' always returns non-zero if it finds differences in the files it is comparing, and the files must contain differences in order to trigger the funcname pattern codepath. Instead of checking for non-zero exit status, make sure the expected error message is printed. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-16Typo "does not exists" when git remote update remote.Libravatar Mikael Magnusson1-1/+1
2008-10-14remote.c: correct the check for a leading '/' in a remote nameLibravatar Brandon Casey1-4/+5
This test is supposed to disallow remote entries in the config file of the form: [remote "/foobar"] ... The leading slash in '/foobar' is not acceptable. Instead it was incorrectly testing that the subkey had no leading '/', which had no effect since the subkey pointer was made to point at a '.' in the preceding lines. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14Add testcase to ensure merging an early part of a branch is done properlyLibravatar Miklos Vajna1-0/+26
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14Add Linux PPC support to the pre-auto-gc example hookLibravatar Miklos Vajna1-0/+3
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14t4018-diff-funcname: add objective-c xfuncname pattern to syntax testLibravatar Brandon Casey1-1/+1
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-13Update draft release notes to 1.6.1Libravatar Junio C Hamano1-7/+46
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-13Merge branch 'maint'Libravatar Junio C Hamano1-2/+19
* maint: Update draft release notes to 1.6.0.3
2008-10-13Update draft release notes to 1.6.0.3Libravatar Junio C Hamano1-2/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-13tests: shell negation portability fixLibravatar Jeff King1-1/+1
Commit 969c8775 introduced a test which uses the non-portable construct: command1 && ! command2 | command3 which must be command1 && ! (command2 | command3) to work on bsd shells (this is another example of bbf08124, which fixed several similar cases). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-12Merge branch 'maint'Libravatar Shawn O. Pearce3-1/+60
* maint: test-lib: fix broken printf git apply --directory broken for new files
2008-10-12test-lib: fix broken printfLibravatar Shawn O. Pearce1-1/+1
b8eecafd888d219633f4c29e8b6a90fc21a46dfd introduced usage of printf without a format string. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12"git diff <tree>{3,}": do not reverse order of argumentsLibravatar Matt McCutchen3-3/+31
According to the message of commit 0fe7c1de16f71312e6adac4b85bddf0d62a47168, "git diff" with three or more trees expects the merged tree first followed by the parents, in order. However, this command reversed the order of its arguments, resulting in confusing diffs. A comment /* Again, the revs are all reverse */ suggested there was a reason for this, but I can't figure out the reason, so I removed the reversal of the arguments. Test case included. Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializerLibravatar Brandon Casey46-197/+91
Many call sites use strbuf_init(&foo, 0) to initialize local strbuf variable "foo" which has not been accessed since its declaration. These can be replaced with a static initialization using the STRBUF_INIT macro which is just as readable, saves a function call, and takes up fewer lines. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12print an error message for invalid pathLibravatar Dmitry Potapov2-3/+5
If verification of path failed, it is always better to print an error message saying this than relying on the caller function to print a meaningful error message (especially when the callee already prints error message for another situation). Because the callers of add_index_entry_with_check() did not print any error message, it resulted that the user would not notice the problem when checkout of an invalid path failed. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12Documentation: remove stale howto/rebase-and-edit.txtLibravatar Thomas Rast1-79/+0
The "rebase and edit" howto predates the much easier solution 'git rebase -i' by two years. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'Libravatar Brandon Casey1-1/+1
Since dbf5e1e9, the '--no-validate' option is a Getopt::Long boolean option. The '--no-' prefix (as in --no-validate) for boolean options is not supported in Getopt::Long version 2.32 which was released with Perl 5.8.0. This version only supports '--no' as in '--novalidate'. More recent versions of Getopt::Long, such as version 2.34, support either prefix. So use the older form in the tests. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-12git apply --directory broken for new filesLibravatar Jeff King2-0/+59
We carefully verify that the input to git-apply is sane, including cross-checking that the filenames we see in "+++" headers match what was provided on the command line of "diff --git". When --directory is used, however, we ended up comparing the unadorned name to one with the prepended root, causing us to complain about a mismatch. We simply need to prepend the root directory, if any, when pulling the name out of the git header. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-10Merge branch 'maint'Libravatar Shawn O. Pearce6-8/+29
* maint: rebase -i: do not fail when there is no commit to cherry-pick test-lib: fix color reset in say_color() fix pread()'s short read in index-pack Conflicts: csum-file.c
2008-10-10rebase -i: do not fail when there is no commit to cherry-pickLibravatar Johannes Schindelin2-1/+13
In case there is no commit to apply (for example because you rebase to upstream and all your local patches have been applied there), do not fail. The non-interactive rebase already behaves that way. Do this by introducing a new command, "noop", which is substituted for an empty commit list, so that deleting the commit list can still abort as before. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-10test-lib: fix color reset in say_color()Libravatar Miklos Vajna1-1/+2
When executing a single test with colors enabled, the cursor was not set back to the previous one, and you had to hit an extra enter to get it back. Work around this problem by calling 'tput sgr0' before printing the final newline. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-10fix pread()'s short read in index-packLibravatar Nicolas Pitre3-6/+14
Since v1.6.0.2~13^2~ the completion of a thin pack uses sha1write() for its ability to compute a SHA1 on the written data. This also provides data buffering which, along with commit 92392b4a45, will confuse pread() whenever an appended object is 1) freed due to memory pressure because of the depth-first delta processing, and 2) needed again because it has many delta children, and 3) its data is still buffered by sha1write(). Let's fix the issue by simply forcing cached data out when such an object is written so it can be pread()'d at leisure. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-09Merge branch 'js/objc-funchdr'Libravatar Shawn O. Pearce2-0/+12
* js/objc-funchdr: Teach git diff about Objective-C syntax
2008-10-09Merge branch 'pb/gitweb'Libravatar Shawn O. Pearce2-31/+187
* pb/gitweb: gitweb: Support for simple project search form gitweb: Make the by_tag filter delve in forks as well gitweb: Support for tag clouds gitweb: Add support for extending the action bar with custom links gitweb: Sort the list of forks on the summary page by age gitweb: Clean-up sorting of project list
2008-10-09Merge branch 'dm/svn-branch'Libravatar Shawn O. Pearce3-2/+128
* dm/svn-branch: Add git-svn branch to allow branch creation in SVN repositories
2008-10-09Merge branch 'bc/xdiffnl'Libravatar Shawn O. Pearce1-1/+11
* bc/xdiffnl: xdiff-interface.c: strip newline (and cr) from line before pattern matching
2008-10-09Merge branch 'dp/cywginstat'Libravatar Shawn O. Pearce9-38/+194
* dp/cywginstat: cygwin: Use native Win32 API for stat mingw: move common functionality to win32.h add have_git_dir() function
2008-10-09Merge branch 'lt/time-reject-fractional-seconds'Libravatar Shawn O. Pearce1-6/+20
* lt/time-reject-fractional-seconds: date/time: do not get confused by fractional seconds
2008-10-09Merge branch 'jc/add-ita'Libravatar Shawn O. Pearce4-6/+65
* jc/add-ita: git-add --intent-to-add (-N)
2008-10-09Merge branch 'mw/sendemail'Libravatar Shawn O. Pearce3-215/+147
* mw/sendemail: bash completion: Add --[no-]validate to "git send-email" send-email: signedoffcc -> signedoffbycc, but handle both Docs: send-email: Create logical groupings for man text Docs: send-email: Create logical groupings for --help text Docs: send-email: Remove unnecessary config variable description Docs: send-email: --chain_reply_to -> --[no-]chain-reply-to send-email: change --no-validate to boolean --[no-]validate Docs: send-email: Man page option ordering Docs: send-email usage text much sexier Docs: send-email's usage text and man page mention same options
2008-10-09Merge branch 'mv/merge-refresh'Libravatar Shawn O. Pearce2-0/+19
* mv/merge-refresh: builtin-merge: refresh the index before calling a strategy
2008-10-09Merge branch 'ph/parseopt'Libravatar Shawn O. Pearce3-80/+74
* ph/parseopt: parse-opt: migrate builtin-merge-file. parse-opt: migrate git-merge-base. parse-opt: migrate fmt-merge-msg.
2008-10-09Merge branch 'rz/grepz'Libravatar Shawn O. Pearce4-3/+26
* rz/grepz: git grep: Add "-z/--null" option as in GNU's grep.
2008-10-09Merge branch 'mg/verboseprune'Libravatar Shawn O. Pearce2-4/+11
* mg/verboseprune: make prune report removed objects on -v
2008-10-09Merge branch 'maint'Libravatar Shawn O. Pearce5-28/+18
* maint: builtin-apply: fix typo leading to stack corruption git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1) builtin-merge.c: allocate correct amount of memory Makefile: do not set NEEDS_LIBICONV for Solaris 8 rebase -i: remove leftover debugging rebase -i: proper prepare-commit-msg hook argument when squashing
2008-10-09Merge branch 'sg/maint-intrebase-msghook' into maintLibravatar Shawn O. Pearce1-6/+11
* sg/maint-intrebase-msghook: rebase -i: remove leftover debugging rebase -i: proper prepare-commit-msg hook argument when squashing
2008-10-09builtin-apply: fix typo leading to stack corruptionLibravatar Imre Deak1-1/+1
This typo led to stack corruption for lines with whitespace fixes and length > 1024. Signed-off-by: Imre Deak <imre.deak@gmail.com> Looks-good-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-09git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1)Libravatar Brandon Casey1-18/+4
The referenced commit tried to fix a flaw in stash's handling of a user supplied invalid ref. i.e. 'git stash apply fake_ref@{0}' should fail instead of applying stash@{0}. But, it did so in a naive way by avoiding the use of the --default option of rev-parse, and instead manually supplied the default revision if the user supplied an empty command line. This prevented a common usage scenario of supplying flags on the stash command line (i.e. non-empty command line) which would be parsed by lower level git commands, without supplying a specific revision. This should fall back to the default revision, but now it causes an error. e.g. 'git stash show -p' The correct fix is to use the --verify option of rev-parse, which fails properly if an invalid ref is supplied, and still allows falling back to a default ref when one is not supplied. Convert stash-drop to use --verify while we're at it, since specifying multiple revisions for any of these commands is also an error and --verify makes it so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-09Merge branch 'jk/maint-soliconv' into maintLibravatar Shawn O. Pearce1-1/+0
* jk/maint-soliconv: Makefile: do not set NEEDS_LIBICONV for Solaris 8
2008-10-09Cleanup in sha1_file.c::cache_or_unpack_entry()Libravatar Miklos Vajna1-4/+2
This patch just removes an unnecessary goto which makes the code easier to read and shorter. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-09builtin-merge.c: allocate correct amount of memoryLibravatar Brandon Casey1-2/+2
Fix two memory allocation errors which allocate space for a pointer rather than enough space for the structure itself. This: struct commit_list *parent = xmalloc(sizeof(struct commit_list *)); should have been this: struct commit_list *parent = xmalloc(sizeof(struct commit_list)); But while we're at it, change the allocation to reference the variable it is allocating memory for to try to prevent a similar mistake, for example if the type is changed, in the future. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>