summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-09-20diff: fix "multiple regexp" semantics to find hunk header commentLibravatar Junio C Hamano2-8/+11
When multiple regular expressions are concatenated with "\n", they were traditionally AND'ed together, and only a line that matches _all_ of them is taken as a match. This however is unwieldy when multiple regexp feature is used to specify alternatives. This fixes the semantics to take the first match. A nagative pattern, if matches, makes the line to fail as before. A match with a positive pattern will be the final match, and what it captures in $1 is used as the hunk header comment. We could write alternatives using "|" in ERE, but the machinery can only use captured $1 as the hunk header comment (or $0 if there is no match in $1), so you cannot write: "junk ( A | B ) | garbage ( C | D )" and expect both "junk" and "garbage" to get stripped with the existing code. With this fix, you can write it as: "junk ( A | B ) \n garbage ( C | D )" and the way capture works would match the user expectation more naturally. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19diff: use extended regexp to find hunk headersLibravatar Junio C Hamano1-3/+3
Using ERE elements such as "|" (alternation) by backquoting in BRE is a GNU extension and should not be done in portable programs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk-header-fixLibravatar Junio C Hamano1-14/+17
* bc/maint-diff-hunk-header-fix: diff: use extended regexp to find hunk headers Conflicts: diff.c
2008-09-19diff: use extended regexp to find hunk headersLibravatar Junio C Hamano1-14/+17
Using ERE elements such as "|" (alternation) by backquoting in BRE is a GNU extension and should not be done in portable programs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk-header-fixLibravatar Junio C Hamano37-123/+266
* bc/maint-diff-hunk-header-fix: diff.*.xfuncname which uses "extended" regex's for hunk header selection diff.c: associate a flag with each pattern and use it for compiling regex diff.c: return pattern entry pointer rather than just the hunk header pattern Cosmetical command name fix Start conforming code to "git subcmd" style part 3 t9700/test.pl: remove File::Temp requirement t9700/test.pl: avoid bareword 'STDERR' in 3-argument open() GIT 1.6.0.2 Fix some manual typos. Use compatibility regex library also on FreeBSD Use compatibility regex library also on AIX Update draft release notes for 1.6.0.2 Use compatibility regex library for OSX/Darwin git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl Git.pm: Use File::Temp->tempfile instead of ->new t7501: always use test_cmp instead of diff Start conforming code to "git subcmd" style part 2 diff: Help "less" hide ^M from the output checkout: do not check out unmerged higher stages randomly Conflicts: Documentation/git.txt Documentation/gitattributes.txt Makefile diff.c t/t7201-co.sh
2008-09-18diff.*.xfuncname which uses "extended" regex's for hunk header selectionLibravatar Brandon Casey3-3/+8
Currently, the hunk headers produced by 'diff -p' are customizable by setting the diff.*.funcname option in the config file. The 'funcname' option takes a basic regular expression. This functionality was designed using the GNU regex library which, by default, allows using backslashed versions of some extended regular expression operators, even in Basic Regular Expression mode. For example, the following characters, when backslashed, are interpreted according to the extended regular expression rules: ?, +, and |. As such, the builtin funcname patterns were created using some extended regular expression operators. Other platforms which adhere more strictly to the POSIX spec do not interpret the backslashed extended RE operators in Basic Regular Expression mode. This causes the pattern matching for the builtin funcname patterns to fail on those platforms. Introduce a new option 'xfuncname' which uses extended regular expressions, and advertise it _instead_ of funcname. Since most users are on GNU platforms, the majority of funcname patterns are created and tested there. Advertising only xfuncname should help to avoid the creation of non-portable patterns which work with GNU regex but not elsewhere. Additionally, the extended regular expressions may be less ugly and complicated compared to the basic RE since many common special operators do not need to be backslashed. For example, the GNU Basic RE: ^[ ]*\\(\\(public\\|static\\).*\\)$ becomes the following Extended RE: ^[ ]*((public|static).*)$ Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18diff.c: associate a flag with each pattern and use it for compiling regexLibravatar Brandon Casey3-12/+15
This is in preparation for allowing extended regular expression patterns. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18diff.c: return pattern entry pointer rather than just the hunk header patternLibravatar Brandon Casey1-27/+28
This is in preparation for associating a flag with each pattern which will control how the pattern is interpreted. For example, as a basic or extended regular expression. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15Cosmetical command name fixLibravatar Heikki Orsila1-1/+1
If we came from git.c the first arg would be "archive". "git-archive" isn't a bug because cmd_archive() doesn't check the first arg. Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15Start conforming code to "git subcmd" style part 3Libravatar Heikki Orsila9-19/+19
User notifications are presented as 'git cmd', and code comments are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'. Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15t9700/test.pl: remove File::Temp requirementLibravatar Brandon Casey1-10/+13
The object oriented version of File::Temp is a rather new incarnation it seems. The File::Temp man page for v5.8.0 says "(NOT YET IMPLEMENTED)" in the 'Objects' section. Instead of creating a file with a unique name in the system TMPDIR, we can create our own temporary file with a static name and use that instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> on RHEL 3, Perl 5.8.0 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15t9700/test.pl: avoid bareword 'STDERR' in 3-argument open()Libravatar Brandon Casey1-1/+1
Some versions of perl complain when 'STDERR' is used as the third argument in the 3-argument form of open(). Convert to the 2-argument form which is described for duping STDERR in my second edition camel book. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> on RHEL 3, Perl 5.8.0 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-12GIT 1.6.0.2Libravatar Junio C Hamano2-2/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-12Merge branch 'ho/maint-dashless' into maintLibravatar Junio C Hamano5-14/+14
* ho/maint-dashless: Start conforming code to "git subcmd" style part 2
2008-09-12Fix some manual typos.Libravatar Ralf Wildenhues3-3/+3
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-11Use compatibility regex library also on FreeBSDLibravatar Jeff King1-0/+2
Commit 3632cfc24 makes the same change for Darwin; however, the problem also exists on FreeBSD. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-11Use compatibility regex library also on AIXLibravatar Johannes Sixt1-0/+2
This augments 3632cfc24 (Use compatibility regex library on Darwin, 2008-09-07), which already carries a "Tested-by" statement for AIX, but that test was actually done with this patch included. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Tested-by: Mike Ralphson <mike@abacus.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Update draft release notes for 1.6.0.2Libravatar Junio C Hamano1-2/+22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Use compatibility regex library for OSX/DarwinLibravatar Arjen Laarhoven6-2/+10
The standard libc regex library on OSX does not support alternation in POSIX Basic Regular Expression mode. This breaks the diff.funcname functionality on OSX. To fix this, we use the GNU regex library which is already present in the compat/ diretory for the MinGW port. However, simply adding compat/ to the COMPAT_CFLAGS variable causes a conflict between the system fnmatch.h and the one present in compat/. To remedy this, move the regex and fnmatch functionality to their own subdirectories in compat/ so they can be included seperately. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Tested-by: Mike Ralphson <mike@abacus.co.uk> (AIX) Tested-by: Johannes Sixt <johannes.sixt@telecom.at> (MinGW) Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10git-svn: Fixes my() parameter list syntax error in pre-5.8 PerlLibravatar Marcus Griep1-1/+1
Signed-off-by: Marcus Griep <marcus@griep.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Git.pm: Use File::Temp->tempfile instead of ->newLibravatar Marcus Griep2-14/+32
Perl 5.8.0 ships with File::Temp 0.13, which does not have the new() interface introduced in 0.14, as pointed out by Tom G. Christensen. This modifies Git.pm to use the more established tempfile() interface and updates 'git svn' to match. Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net> Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10t7501: always use test_cmp instead of diffLibravatar Miklos Vajna1-6/+6
This should make the output more readable (by default using diff -u) when some tests fail. Also changed the diff order from "current expected" to "expected current". Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Merge branch 'jc/maint-log-grep' into maintLibravatar Junio C Hamano4-17/+114
* jc/maint-log-grep: log --author/--committer: really match only with name part
2008-09-10Merge branch 'jc/maint-hide-cr-in-diff-from-less' into maintLibravatar Junio C Hamano3-3/+34
* jc/maint-hide-cr-in-diff-from-less: diff: Help "less" hide ^M from the output
2008-09-10Merge branch 'jc/maint-checkout-fix' into maintLibravatar Junio C Hamano2-1/+50
* jc/maint-checkout-fix: checkout: do not check out unmerged higher stages randomly
2008-09-10Merge branch 'np/maint-safer-pack' into maintLibravatar Junio C Hamano6-55/+112
* np/maint-safer-pack: fixup_pack_header_footer(): use nicely aligned buffer sizes index-pack: use fixup_pack_header_footer()'s validation mode pack-objects: use fixup_pack_header_footer()'s validation mode improve reliability of fixup_pack_header_footer() pack-objects: improve returned information from write_one()
2008-09-09Start conforming code to "git subcmd" style part 2Libravatar Heikki Orsila5-14/+14
User notifications are presented as 'git cmd', and code comments are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'. Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-07Teach "git diff -p" to locate PHP class methodsLibravatar Andreas Ericsson2-2/+5
Otherwise it will always print the class-name rather than the name of the function inside that class. While we're at it, reorder the gitattributes manpage to list the built-in funcname pattern names in alphabetical order. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06Update draft release notes for 1.6.1Libravatar Junio C Hamano1-2/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano3-119/+164
* git://git.bogomips.org/git-svn: git-svn: set auto_props when renaming files t9124: clean up chdir usage git-svn: fix 'info' tests for unknown items git-svn: match SVN 1.5 behaviour of info' on unknown item git svn info: always quote URLs in 'info' output git svn info: make info relative to the current directory git svn info: tests: fix ptouch argument order in setup git svn info: tests: use test_cmp instead of git-diff git svn info: tests: do not use set -e git svn info: tests: let 'init' test run with SVN 1.5 git svn: catch lack of upstream info for dcommit earlier git-svn: check error code of send_txstream git-svn: Send deltas during commits git-svn: Introduce SVN::Git::Editor::_chg_file_get_blob git-svn: extract base blob in generate_diff
2008-09-06git-svn: set auto_props when renaming filesLibravatar Paul Talacko2-0/+18
Patch-by: Paul Talacko <gnuruandstuff@yahoo.co.uk>: <http://article.gmane.org/gmane.comp.version-control.git/95006> > Hello, > > There's an issue in git-svn as autoprops are not applied to > renamed files, only to added files. > > This patch fixes the bug. [ew: added test case] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06t9124: clean up chdir usageLibravatar Eric Wong1-4/+2
Spawn subshells when running things in subdirectories instead of chdir-ing to the path of an undefined variable, which is confusing. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06Merge updated git-gui and gitk that call each otherLibravatar Junio C Hamano9-120/+943
Merge git://repo.or.cz/git-gui and git://git.kernel.org/pub/scm/gitk/gitk * git://repo.or.cz/git-gui: git-gui: Show special diffs for complex conflict cases. git-gui: Make F5 reselect a diff, if an untracked file is selected. git-gui: Reimplement and enhance auto-selection of diffs. git-gui: Support conflict states _U & UT. git-gui: Support more merge tools. git-gui: Don't allow staging files with conflicts. git-gui: Support calling merge tools. git-gui: Support resolving conflicts via the diff context menu. git-gui: Mark forgotten strings for translation. git-gui: Allow specifying an initial line for git gui blame. git-gui: Better positioning in Blame Parent Commit git-gui: Support passing blame to a parent commit. git-gui: Support starting gitk from Gui Blame git-gui: Teach git gui about file type changes * git://git.kernel.org/pub/scm/gitk/gitk: gitk: Add menu item for calling git gui blame gitk: Add option to specify the default commit on command line
2008-09-06Merge branch 'maint'Libravatar Junio C Hamano10-388/+477
* maint: Update draft release notes for 1.6.0.2 stash: refresh the index before deciding if the work tree is dirty Mention the fact that 'git annotate' is only for backward compatibility. "blame -c" should be compatible with "annotate" git-gui: Fix diff parsing for lines starting with "--" or "++" git-gui: Fix string escaping in po2msg.sh git gui: show diffs with a minimum of 1 context line git-gui: update all remaining translations to French. git-gui: Update french translation
2008-09-06Update draft release notes for 1.6.0.2Libravatar Junio C Hamano1-3/+20
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06stash: refresh the index before deciding if the work tree is dirtyLibravatar Junio C Hamano1-0/+3
Unlike the case where the user does have a real change in the work tree, refusing to work because of unclean stat information is not very helpful. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
2008-09-06Merge branch 'maint' of git://repo.or.cz/git-gui into maintLibravatar Junio C Hamano5-381/+431
* 'maint' of git://repo.or.cz/git-gui: git-gui: Fix diff parsing for lines starting with "--" or "++" git-gui: Fix string escaping in po2msg.sh git gui: show diffs with a minimum of 1 context line git-gui: update all remaining translations to French. git-gui: Update french translation
2008-09-05git-svn: fix 'info' tests for unknown itemsLibravatar Thomas Rast1-48/+25
The previous tests all expected the results from SVN and Git to be identical, and expected both to return success. This cannot be guaranteed: SVN changed the message style between 1.4 and 1.5, and in 1.5, sets a failure exit code. Change the tests to verify that 'git svn info <item>' sets a failure exit code, and that its output contains the file name. This should hopefully catch all other errors. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: match SVN 1.5 behaviour of info' on unknown itemLibravatar Thomas Rast1-2/+2
Previously 'git svn info unknown-file' only announced its failure (in the SVN 1.4 style, "not a versioned resource"), and exited successfully. It is desirable to actually exit with failure, so change the code to exit(1) under this condition. Since that is already halfway SVN 1.5 compatibility, also change the error output to match 1.5. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: always quote URLs in 'info' outputLibravatar Thomas Rast2-17/+38
Changes 'git svn info' to always URL-escape the 'URL' and 'Repository' fields and --url output, like SVN (at least 1.5) does. Note that reusing the escape_url() further down in Git::SVN::Ra is not possible because it only triggers for http(s) URLs. I did not know whether extending it to all schemes would break SVN access anywhere, so I made a new one that quotes in all schemes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: make info relative to the current directoryLibravatar Thomas Rast2-3/+16
Previously 'git svn info <path>' would always treat the <path> as relative to the working directory root, with a default of ".". This does not match the behaviour of 'svn info'. Prepend $(git rev-parse --show-prefix) to the path used inside cmd_info to make it relative to the current working directory. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: tests: fix ptouch argument order in setupLibravatar Thomas Rast1-4/+4
The arguments must be <gitwc-path> <svnwc-path>, otherwise it fails to update the timestamps (without setting a failure exit code) and results in bad test output later on. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: tests: use test_cmp instead of git-diffLibravatar Thomas Rast1-22/+22
git-diff does not appear to return the correct exit values, and gives a false success for more than half (!) of the tests due to the space in "trash directory" which git-svn fails to encode. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: tests: do not use set -eLibravatar Thomas Rast1-2/+0
Exiting in the middle of a test confuses the test suite, which will just say "FATAL: Unexpected exit with code 1" in response to a failed test, instead of actually diagnosing failure and continuing with the next test. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: tests: let 'init' test run with SVN 1.5Libravatar Thomas Rast1-2/+2
Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn: catch lack of upstream info for dcommit earlierLibravatar Thomas Rast1-4/+4
Since 711521e 'git svn dcommit' attempts to use the upstream information to determine the SVN URL, before it verifies that it even found an upstream. Move up the corresponding check. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: check error code of send_txstreamLibravatar Eric Wong1-1/+5
Not checking the error code of a function used to transform and send data makes me nervous. It currently returns "undef" on success; so die if we get any result other than "undef" because it's likely something went wrong somewhere. I really wish this function returned an MD5 like send_stream (or better yet, SHA1) for verification. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: Send deltas during commitsLibravatar Florian Weimer1-5/+13
Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: Introduce SVN::Git::Editor::_chg_file_get_blobLibravatar Florian Weimer1-12/+19
Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: extract base blob in generate_diffLibravatar Florian Weimer1-3/+4
We need the base blob to compute a delta to be sent to the server. Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>