summaryrefslogtreecommitdiff
path: root/git-cvsexportcommit.perl
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'js/maint-cvsexport'Junio C Hamano2008-02-201-8/+32
|\ | | | | | | | | | | | | | | | | * js/maint-cvsexport: cvsexportcommit: be graceful when "cvs status" reorders the arguments Conflicts: t/t9200-git-cvsexportcommit.sh
| * cvsexportcommit: be graceful when "cvs status" reorders the argumentsJohannes Schindelin2008-02-191-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In my use cases, "cvs status" sometimes reordered the passed filenames, which often led to a misdetection of a dirty state (when it was in reality a clean state). I finally tracked it down to two filenames having the same basename. So no longer trust the order of the results blindly, but actually check the file name. Since "cvs status" only returns the basename (and the complete path on the server which is useless for our purposes), run "cvs status" several times with lists consisting of files with unique (chomped) basenames. Be a bit clever about new files: these are reported as "no file <blabla>", so in order to discern it from existing files, prepend "no file " to the basename. In other words, one call to "cvs status" will not ask for two files "blabla" (which does not yet exist) and "no file blabla" (which exists). This patch makes cvsexportcommit slightly slower, when the list of changed files has non-unique basenames, but at least it is accurate now. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIRJohan Herland2008-02-121-6/+5
|/ | | | | | | | | | | | When using the '-w $cvsdir' option to cvsexportcommit, it will chdir into $cvsdir before executing several other git commands. If $GIT_DIR is set to a relative path (e.g. '.'), the git commands executed by cvsexportcommit will naturally fail. Therefore, ensure that $GIT_DIR is absolute before the chdir to $cvsdir. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsexportcommit: fix massive commitsJeff King2007-12-141-14/+23
| | | | | | | | | | | | | | | | | | | | | Because we feed the changed filenames to CVS on the command line, it was possible for massive commits to overflow the system exec limits. Instead, we now do an xargs-like split of the arguments. This means that we lose some of the atomicity of calling CVS in one shot. Since CVS commits are not atomic, but the CVS protocol is, the possible effects of this are not clear; however, since CVS doesn't provide a different interface, this is our only option for large commits (short of writing a CVS client library). The argument size limit is arbitrarily set to 64kB. This should be high enough to trigger only in rare cases where it is necessary, so normal-sized commits are not affected by the atomicity change. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsexportcommit: Add switch to specify CVS workdirRobin Rosenberg2007-11-011-12/+27
| | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'bk/maint-cvsexportcommit'Junio C Hamano2007-11-011-3/+10
|\ | | | | | | | | * bk/maint-cvsexportcommit: cvsexportcommit: fix for commits that do not have parents
| * cvsexportcommit: fix for commits that do not have parentsBrad King2007-10-311-3/+10
| | | | | | | | | | | | | | | | | | | | Previously commits without parents would fail to export with a message indicating that the commits had more than one parent. Instead we should use the --root option for git-diff-tree in place of a parent. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Shawn O. Pearce2007-10-191-0/+11
|\ \ | |/ | | | | | | | | | | | | | | | | * maint: Further 1.5.3.5 fixes described in release notes Avoid invoking diff drivers during git-stash attr: fix segfault in gitattributes parsing code Define NI_MAXSERV if not defined by operating system Ensure we add directories in the correct order Avoid scary errors about tagged trees/blobs during git-fetch
| * Ensure we add directories in the correct orderAlex Bennee2007-10-181-0/+11
| | | | | | | | | | | | | | CVS gets understandably upset if you try and add a subdirectory before it's parent directory. This patch fixes that. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | git-cvsexportcommit.perl: git-apply no longer needs --binaryMichael Witten2007-10-161-2/+2
| | | | | | | | | | Signed-off-by: Michael Witten <mfwitten@mit.edu> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | cvsexportcommit: get rid of temporary directoryJohannes Schindelin2007-10-161-5/+0
|/ | | | | | | | | Since commit e86ad71fe5f53ae4434566bd09ea4256090e5a3a we do not use a temporary directory in cvsexportcommit. So there is no need to set one up. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* cvsexportcommit: avoid racy CVS problem.Robin Rosenberg2007-07-241-0/+5
| | | | | | | | | | | | If git cvsexportcommit is executed fast enough in sequence, the CVS timestamps could end up being the same. CVS tries to fix this by sleeping until the CPU clock changes seconds. Unfortunately, the CPU clock and the file system clock are not necessarily the same, so the timestamps could be the same anyway. When that happens CVS may not recognize changed files and cvs will forget to commit some files. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* War on whitespaceJunio C Hamano2007-06-071-1/+1
| | | | | | | | | This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add option to cvs update before exportRobin Rosenberg2007-05-241-2/+6
| | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Optimized cvsexportcommit: calling 'cvs status' once instead of once per ↵Steffen Prohaska2007-05-141-15/+30
| | | | | | | | | | | | | touched file. Runtime is now independent of the number of modified files. The old implementation executed 'cvs status' for each file touched by the patch to be applied. The new code calls 'cvs status' only once with all touched files and parses cvs's output to collect all available status information. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* cvsexportcommit -p : fix the usage of git-apply -C.Tomash Brechko2007-04-091-3/+8
| | | | | | | | | Unlike 'patch --fuzz=NUM', which specifies the number of lines allowed to mismatch, 'git-apply -CNUM' requests the match of NUM lines of context. Omitting -C requests full context match, and that's what should be used for cvsexportcommit -p. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'maint'Junio C Hamano2007-02-281-1/+2
|\ | | | | | | | | | | | | | | | | | | | | * maint: Start preparing Release Notes for 1.5.0.3 Documentation: git-remote add [-t <branch>] [-m <branch>] [-f] name url Include config.mak in doc/Makefile git.el: Set the default commit coding system from the repository config. git-archimport: support empty summaries, put summary on a single line. http-push.c::lock_remote(): validate all remote refs. git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs.
| * git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs.Gerrit Pape2007-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | Unless the -c option is given, and the commit to cvs was successful, .msg shouldn't be deleted to be able to run the command suggested by git-cvsexportcommit. See http://bugs.debian.org/412732 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Allow passing of an alternative CVSROOT via -d.Simon 'corecode' Schubert2007-02-201-10/+17
|/ | | | | | | | | This is necessary if using CVS in an asymmetric fashion, i.e. when the CVSROOT you are checking out from differs from the CVSROOT you have to commit to. Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Allow forcing of a parent commit, even if the parent is not a direct one.Simon 'corecode' Schubert2007-02-051-3/+3
| | | | | | | | | | | | This can be used to compress multiple changesets into one, for example like git cvsexportcommit -P cvshead mybranch without having to do so in git first. Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make cvsexportcommit work with filenames with spaces and non-ascii characters.Robin Rosenberg2006-12-111-138/+65
| | | | | | | | | | | | | | | This patch uses git-apply to do the patching which simplifies the code a lot and also uses one pass to git-diff. git-apply gives information on added, removed files as well as which files are binary. Removed the test for checking for matching binary files when deleting them since git-apply happily deletes the file. This is matter of taste since we allow some fuzz for text patches also. Error handling was cleaned up, but not much tested. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Set permissions of each new file before "cvs add"ing it.Jim Meyering2006-12-041-0/+13
| | | | | | | | | | Otherwise, an executable script in git would end up being checked into the CVS repository without the execute bit. [jc: with an additional test script from Robin Rosenberg.] Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Rework cvsexportcommit to handle binary files for all cases.Robin Rosenberg2006-11-131-20/+50
| | | | | | | | | Also adds test cases for adding removing and deleting binary and text files plus two tests for the checks on binary files. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make cvsexportcommit remove files.Robin Rosenberg2006-09-291-1/+1
| | | | | Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* cvsexportcommit - add -a (add author line) flag, cleanup warningsMartin Langhoff2006-07-231-12/+38
| | | | | | | | | | This patch adds support for -a which will add an "Author: " line, and possibly a "Committer: " line to the bottom of the commit message for CVS. The commit message parser is now a little bit better, and some warnings have been cleaned up. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix more typos, primarily in the codePavel Roskin2006-07-101-2/+2
| | | | | | | | | The only visible change is that git-blame doesn't understand "--compability" anymore, but it does accept "--compatibility" instead, which is already documented. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-cvsexportcommit can't handle merge commits correctlyPeter Baumann2006-07-091-2/+2
| | | | | | | | | | | git-cvsexportcommit should check if the parent (supplied on the cmdline) to use for a merge commit is one of the real parents of the merge. But it errors out if the _first_ parent doesn't match and never checks the other parents. Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-cvsexportcommit.perl: fix typoSven Verdoolaege2006-06-171-1/+1
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make cvsexportcommit create parent directories as needed.Yann Dirson2006-05-281-5/+32
| | | | | | | | This is a quick port of my initial patch for 1.0.7, that I had forgotten to post. Possibly needs some testing before applying to master. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Document current cvsexportcommit limitations.Yann Dirson2006-05-281-0/+7
| | | | | | | | Since there is no bugtracker that I know of, let's just use the scripts themselves to document their limitations. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not call 'cmp' with non-existant -q flag.Yann Dirson2006-05-281-1/+1
| | | | | | | | | | I cannot find when that flag was removed if it ever existed, I can find nothing about it in the ChangeLog and NEWS file of GNU diff. The current flag is -s aka --quiet aka --silent, so let's use -s, assuming it is a portable flag. Feel free to lart me with a POSIX bible if needed. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups.Martin Langhoff2006-04-261-7/+15
|
* exportcommit: replace backticks with safe_pipe_capture() or system() - ↵Martin Langhoff2006-01-291-20/+33
| | | | | | | | | | initial pass Replaced backticks with potentially troublesome unescaped input with safe_pipe_capture(). Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Teach cvsexportcommit to add new filesYann Dirson2006-01-061-2/+10
| | | | | | | | "cvs add" support was already there, but the "unknown" status returned when querying a file not yet known to cvs caused the script to abort prematurely. Signed-off-by: Junio C Hamano <junkio@cox.net>
* GIT 0.99.9j aka 1.0rc3v1.0rc3v0.99.9jJunio C Hamano2005-11-161-6/+6
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix cvsexportcommit syntax errorAlexander Litvinov2005-11-081-1/+1
| | | | | | There is a syntax error in cvsexport script: Signed-off-by: Junio C Hamano <junkio@cox.net>
* Introducing: git-cvsexportcommitMartin Langhoff2005-11-071-0/+225
A script that can replay commits git into a CVS checkout. Tries to ensure the sanity of the operation and supports mainly manual usage. If you are reckless enough, you can ask it to autocommit when everything has applied cleanly. Combined with a couple more scripts could become part of a git2cvs gateway. Should support adds/removes and binary files. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>