summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska2008-02-0611-11/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CRLF conversion bears a slight chance of corrupting data. autocrlf=true will convert CRLF to LF during commit and LF to CRLF during checkout. A file that contains a mixture of LF and CRLF before the commit cannot be recreated by git. For text files this is the right thing to do: it corrects line endings such that we have only LF line endings in the repository. But for binary files that are accidentally classified as text the conversion can corrupt data. If you recognize such corruption early you can easily fix it by setting the conversion type explicitly in .gitattributes. Right after committing you still have the original file in your work tree and this file is not yet corrupted. You can explicitly tell git that this file is binary and git will handle the file appropriately. Unfortunately, the desired effect of cleaning up text files with mixed line endings and the undesired effect of corrupting binary files cannot be distinguished. In both cases CRLFs are removed in an irreversible way. For text files this is the right thing to do because CRLFs are line endings, while for binary files converting CRLFs corrupts data. This patch adds a mechanism that can either warn the user about an irreversible conversion or can even refuse to convert. The mechanism is controlled by the variable core.safecrlf, with the following values: - false: disable safecrlf mechanism - warn: warn about irreversible conversions - true: refuse irreversible conversions The default is to warn. Users are only affected by this default if core.autocrlf is set. But the current default of git is to leave core.autocrlf unset, so users will not see warnings unless they deliberately chose to activate the autocrlf mechanism. The safecrlf mechanism's details depend on the git command. The general principles when safecrlf is active (not false) are: - we warn/error out if files in the work tree can modified in an irreversible way without giving the user a chance to backup the original file. - for read-only operations that do not modify files in the work tree we do not not print annoying warnings. There are exceptions. Even though... - "git add" itself does not touch the files in the work tree, the next checkout would, so the safety triggers; - "git apply" to update a text file with a patch does touch the files in the work tree, but the operation is about text files and CRLF conversion is about fixing the line ending inconsistencies, so the safety does not trigger; - "git diff" itself does not touch the files in the work tree, it is often run to inspect the changes you intend to next "git add". To catch potential problems early, safety triggers. The concept of a safety check was originally proposed in a similar way by Linus Torvalds. Thanks to Dimitry Potapov for insisting on getting the naked LF/autocrlf=true case right. Signed-off-by: Steffen Prohaska <prohaska@zib.de>
* Fix misuse of prefix_path()Johannes Sixt2008-02-052-6/+6
| | | | | | | | | | | | | | When DEFAULT_GIT_TEMPLATE_DIR is specified as a relative path, init-db made it relative to exec_path using prefix_path(), which is wrong. prefix_path() is about a file inside the work tree. There was a similar misuse in config.c that takes relative ETC_GITCONFIG path. Noticed by Junio C Hamano. We concatenate the paths manually. (prefix_filename() won't do because it expects a prefix with a trailing '/'.) Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* man pages are littered with .ft C and othersJonas Fonseca2008-02-052-1/+20
| | | | | | | | | | | | | | | | | | | | | Jakub Narebski <jnareb@gmail.com> wrote Sun, Feb 03, 2008: > Junio C Hamano wrote: > > Jakub Narebski <jnareb@gmail.com> writes: > > > > [From] http://thread.gmane.org/gmane.comp.version-control.git/53457/focus=53458 > Julian Phillips: > > Are you using docbook xsl 1.72? There are known problems building the > > manpages with that version. 1.71 works, and 1.73 should work when it get > > released. I was able to solve this problem with this patch, which adds a XSL file used specifically for DOCBOOK_XSL_172=YesPlease and where dots and backslashes are escaped properly so they won't be substituted to the wrong thing further down the "DocBook XSL pipeline". Doing the escaping in the existing callout.xsl breaks v1.70.1. Hopefully v1.73 will end this part of the manpage nightmare. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a BuildRequires for gettext in the spec file.James Bowes2008-02-041-1/+4
| | | | | Signed-off-by: James Bowes <jbowes@dangerouslyinc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Test :/string form for checkoutDaniel Barkalow2008-02-041-0/+16
| | | | | Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix misuse of prefix_path()Junio C Hamano2008-02-032-4/+4
| | | | | | | | | | | | | | When DEFAULT_GIT_TEMPLATE_DIR is specified as a relative path, init-db made it relative to exec_path using prefix_path(), which is wrong. prefix_path() is about a file inside the work tree. There was a similar misuse in config.c that takes relative ETC_GITCONFIG path. A convenience function prefix_filename() can concatenate two paths to form a path that points at somewhere outside the work tree. Use it in these codepaths instead. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* parse_object_buffer: don't ignore errors from the object specific parsing ↵Martin Koegler2008-02-031-4/+8
| | | | | | | | | | | | | functions In the case of an malformed object, the object specific parsing functions would return an error, which is currently ignored. The object can be partial initialized in this case. This patch make parse_object_buffer propagate such errors. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-fsck: report missing author/commit line in a commit as an errorMartin Koegler2008-02-031-3/+3
| | | | | | | | | | | | | | | A zero commit date could be caused by: * a missing author line * a missing commiter line * a malformed email address in the commiter line * a malformed commit date Simply reporting it as zero commit date is missleading. Additionally, it upgrades the message to an error (instead of an printf). Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2008-02-032-2/+2
|\ | | | | | | | | | | * maint: git-remote documentation: fix synopsis to match description git-am: fix type in its usage string
| * git-remote documentation: fix synopsis to match descriptionJörg Sommer2008-02-031-1/+1
| | | | | | | | | | | | | | | | In the text, the argument of -m is <master> which should be used in the command synopsis, too. Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-am: fix type in its usage stringJörg Sommer2008-02-031-1/+1
| | | | | | | | | | Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Fix an obvious typoTommy Thorn2008-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | The regexp "$," can't match anything. Clearly not intended. This was introduced in ce6f33c8 which is quite a while ago. Signed-off-by: Tommy Thorn <tommy-git@thorn.ws> Acked-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Let "git svn" run "git gc --auto" occasionallyKarl Hasselström2008-02-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let "git svn" run "git gc --auto" every 1000 imported commits to reduce the number of loose objects. To handle the common use case of frequent imports, where each invocation typically fetches much less than 1000 commits, also run gc unconditionally at the end of the import. "1000" is the same number that was used by default when we called git-repack. It isn't necessarily still the best choice. Signed-off-by: Karl Hasselström <kha@treskal.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: Don't call git-repack anymoreKarl Hasselström2008-02-031-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | In a moment, we'll start calling git-gc --auto instead, since it is a better fit to what we're trying to accomplish. The command line options are still accepted, but don't have any effect, and we warn the user about that. Signed-off-by: Karl Hasselström <kha@treskal.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Ensure the working directory and the index are clean before "git-p4 ↵Simon Hausmann2008-02-031-0/+5
| | | | | | | | | | | | rebase" Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Fix submit user-interface.Simon Hausmann2008-02-031-59/+26
| | | | | | | | | | | | Don't ask any questions when submitting, behave similar to git-svn dcommit. Signed-off-by: Simon Hausmann <simon@lst.de>
* | Remove $Id: ..$ $Header: ..$ etc from +ko and +k files during importJason McMullan2008-02-031-3/+7
| | | | | | | | | | | | | | | | | | | | This patch removes the '$Keyword: ...$' '...' data, so that files don't have spurious megre conflicts between branches. Handles both +ko and +k styles, and leaves the '$Foo$' in the original file. Signed-off-by: Simon Hausmann <simon@lst.de>
* | Merge branch 'maint'Junio C Hamano2008-02-033-4/+23
|\ \ | |/ | | | | | | | | * maint: Fix "git-commit -C $tag" Documentation/git-stash.txt: Adjust SYNOPSIS command syntax (2)
| * Fix "git-commit -C $tag"Junio C Hamano2008-02-032-1/+19
| | | | | | | | | | | | | | | | The scripted version might not have handled this correctly either, but the version rewritten in C definitely does not grok this and complains $tag is not a commit object. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Documentation/git-stash.txt: Adjust SYNOPSIS command syntax (2)Jari Aalto2008-02-031-3/+4
| | | | | | | | | | | | | | | | Adjust the command syntax to better reflect the call parameters: [save] [message...] => [save [<message>]]. Signed-off-by: Jari Aalto <jari.aalto AT cante.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | known breakage: revision range computation with clock skewJunio C Hamano2008-02-031-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the absolute minimum (and reliable) reproduction recipe to demonstrate that revision range in a history with clock skew sometimes fails to mark UNINTERESTING commit in topologically early parts of the history. The history looks like this: o---o---o---o one four but one has the largest timestamp. "git rev-list four..one" fails to notice that "one" should not be emitted. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | test: reword the final message of tests with known breakagesJunio C Hamano2008-02-031-2/+5
| | | | | | | | | | | | | | | | | | | | When we have known breakages, we still said "passed all N test(s)", which was a bit funny. This rewords it to read "passed all remaining N test(s)" in such a case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Sane use of test_expect_failureJunio C Hamano2008-02-0148-427/+498
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, test_expect_failure was designed to be the opposite of test_expect_success, but this was a bad decision. Most tests run a series of commands that leads to the single command that needs to be tested, like this: test_expect_{success,failure} 'test title' ' setup1 && setup2 && setup3 && what is to be tested ' And expecting a failure exit from the whole sequence misses the point of writing tests. Your setup$N that are supposed to succeed may have failed without even reaching what you are trying to test. The only valid use of test_expect_failure is to check a trivial single command that is expected to fail, which is a minority in tests of Porcelain-ish commands. This large-ish patch rewrites all uses of test_expect_failure to use test_expect_success and rewrites the condition of what is tested, like this: test_expect_success 'test title' ' setup1 && setup2 && setup3 && ! this command should fail ' test_expect_failure is redefined to serve as a reminder that that test *should* succeed but due to a known breakage in git it currently does not pass. So if git-foo command should create a file 'bar' but you discovered a bug that it doesn't, you can write a test like this: test_expect_failure 'git-foo should create bar' ' rm -f bar && git foo && test -f bar ' This construct acts similar to test_expect_success, but instead of reporting "ok/FAIL" like test_expect_success does, the outcome is reported as "FIXED/still broken". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update stale documentation links from the main documentation.Junio C Hamano2008-02-011-0/+5
| | | | | | This could have been part of the 1.5.4 commit, but it isn't. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* GIT 1.5.4v1.5.4Junio C Hamano2008-02-012-12/+6
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix "git checkout -b foo ':/substring'"Junio C Hamano2008-02-011-3/+4
| | | | | | | | | | Because ':/substring' extended SHA1 expression cannot take postfix modifiers such as ^{tree} and ^{commit}, we would need to do it in multiple steps. With the patch, you can start a new branch from a randomly-picked commit whose message has the named string in it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix typo in a comment in t/test-lib.shMichele Ballabio2008-01-311-1/+1
| | | | | Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git rev-parse manpage: spelling fixMiklos Vajna2008-01-311-2/+2
| | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Revert "filter-branch docs: remove brackets so not to imply revision arg is ↵Junio C Hamano2008-01-312-2/+2
| | | | | | | | optional" This reverts commit c41b439244c51b30c60953192816afc91e552578, as we decided to default to HEAD when revision parameters are missing and they are no longer mandatory.
* Documentation/git-cvsserver: Fix typoJean-Luc Herren2008-01-301-1/+1
| | | | | Signed-off-by: Jean-Luc Herren <jlh@gmx.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* filter-branch: assume HEAD if no revision suppliedBrandon Casey2008-01-301-2/+1
| | | | | | | | | | filter-branch previously took the first non-option argument as the name for a new branch. Since dfd05e38, it now takes a revision or a revision range and modifies the current branch. Update to operate on HEAD by default to conform with standard git interface practice. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* filter-branch docs: remove brackets so not to imply revision arg is optionalBrandon Casey2008-01-302-2/+2
| | | | | Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use 'printf %s $x' notation in t5401Shawn O. Pearce2008-01-301-4/+4
| | | | | | | | | | | | | | | | We only care about getting what should be an empty string and sending it to a file, without a trailing LF, so the empty string translates into a 0 byte file. Earlier when I originally wrote these lines Mac OS X allowed the format string of printf to be the empty string, but more recent versions appear to have been 'improved' with error messages if the format is not given. This may cause problems if we ever wind up with changes to the hook tests. A minor cleanup makes the test more safe on all systems, by conforming to accepted printf conventions. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* filter-branch.sh: remove temporary directory on failureBrandon Casey2008-01-301-0/+5
| | | | | | | | | | | | One of the first things filter-branch does is to create a temporary directory. This directory is eventually removed by the script during normal operation, but is not removed if the script encounters an error. Set a trap to remove it when the script terminates for any reason. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-relink: avoid hard linking in objects/info directoryBrandon Casey2008-01-301-1/+1
| | | | | | | | | | | git-relink is intended to search for packs and loose objects in common between two repositories and to replace the one set with hard links to the other. Files other than packs and loose objects should not be touched, so add the "info" sub-directory to the pattern of directory excludes. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Make use of the $git_dir variable at sub git_get_project_descriptionBruno Ribas2008-01-291-1/+1
| | | | | Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Add info about $projectroot and $projects_list to gitweb/READMEJakub Narebski2008-01-291-2/+15
| | | | | | | | | | | Those two configuration variables are important enough that it is worth to explicitely write about them in the "Gitweb config file variables" section even if they are usually set during build by GITWEB_PROJECTROOT and GITWEB_LIST build (Makefile) configuration variables. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix doc typosJim Meyering2008-01-295-8/+8
| | | | | Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* reflog-expire: Avoid creating new files in a directory inside readdir(3) loopJunio C Hamano2008-01-291-2/+38
| | | | | | | | | | | | | | | | | "git reflog expire --all" opened a directory in $GIT_DIR/logs/, read reflog files in there readdir(3), and rewrote the file by creating a new file and renaming it back inside the loop. This code structure can cause the newly created file to be returned by subsequent call to readdir(3), and fall into an infinite loop in the worst case. This separates the processing to two phase. Running for_each_reflog() to find out and collect all refs, and then iterate over them, calling expire_reflog(). This way, the program would behave exactly the same way as if all the refs were given by the user from the command line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Convert generated contents to utf8 in commitdiff_plainYasushi SHOJI2008-01-291-6/+5
| | | | | | | | | | | | | If the commit message, or commit author contains non-ascii, it must be converted from Perl internal representation to utf-8, to follow what got declared in HTTP header. Use to_utf8() to do the conversion. This necessarily replaces here-doc with "print" statements. Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Acked-by: İsmail Dönmez <ismail@pardus.org.tr> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* instaweb: use 'browser.<tool>.path' config option if it's set.Christian Couder2008-01-292-2/+11
| | | | | | Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: help: specify supported html browsers.Christian Couder2008-01-291-0/+10
| | | | | Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: config: add "browser.<tool>.path".Christian Couder2008-01-291-0/+4
| | | | | Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add test for rebase -i with commits that do not pass pre-commitJohannes Schindelin2008-01-281-0/+16
| | | | | | | | | | | This accompanies c5b09feb786f6a2456ec3d8203d0f4d67f09f043 (Avoid update hook during git-rebase --interactive) to make sure that any regression to make Debian's Bug#458782 (git-core: git-rebase doesn't work when trying to squash changes into commits created with --no-verify) resurface will be caught. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t9001: add missing && operatorsJeff King2008-01-281-4/+4
| | | | | | | | The exit value of some commands was not being used for the test output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* GIT 1.5.4-rc5v1.5.4-rc5Junio C Hamano2008-01-262-13/+14
| | | | | | Hopefully the last rc before the final... Signed-off-by: Junio C Hamano <gitster@pobox.com>
* pull --rebase: be cleverer with rebased upstream branchesJohannes Schindelin2008-01-263-2/+33
| | | | | | | | | When the upstream branch is tracked, we can detect if that branch was rebased since it was last fetched. Teach git to use that information to rebase from the old remote head onto the new remote head. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsserver: Fix for histories with multiple rootsSteffen Prohaska2008-01-262-2/+17
| | | | | | | | | | | | | | | | Git histories may have multiple roots, which can cause git merge-base to fail and this caused git cvsserver to die. This commit teaches git cvsserver to handle a failing git merge-base gracefully, and modifies the test case to verify this. All the test cases now use a history with two roots. Signed-off-by: Steffen Prohaska <prohaska@zib.de> git-cvsserver.perl | 9 ++++++++- t/t9400-git-cvsserver-server.sh | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t9400-git-cvsserver-server: Wrap setup into test caseSteffen Prohaska2008-01-261-3/+4
| | | | | | | | | It is preferable to have the test setup in a test case. The setup itself may fail and having it as a test case handles this situation more gracefully. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: add a bit about sendemail.to configurationMike Hommey2008-01-261-0/+2
| | | | | | | | While there is information about this in the configuration section, it was missing in the options section. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>