aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Unify whitespace checkingWincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit unifies three separate places where whitespace checking was performed: - the whitespace checking previously done in builtin-apply.c is extracted into a function in ws.c - the equivalent logic in "git diff" is removed - the emit_line_with_ws() function is also removed because that also rechecks the whitespace, and its functionality is rolled into ws.c The new function is called check_and_emit_line() and it does two things: checks a line for whitespace errors and optionally emits it. The checking is based on lines of content rather than patch lines (in other words, the caller must strip the leading "+" or "-"); this was suggested by Junio on the mailing list to allow for a future extension to "git show" to display whitespace errors in blobs. At the same time we teach it to report all classes of whitespace errors found for a given line rather than reporting only the first found error. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff --check: minor fixupsJunio C Hamano2007-12-13
| | | | | | | | | | | | | | There is no reason --exit-code and --check-diff must be mutually exclusive, so assign different bits to different results and allow them to be returned from the command. Introduce diff_result_code() to factor out the common code to decide final status code based on diffopt settings and use it everywhere. Update tests to match the above fix. Turning pager off when "diff --check" is used is a regression. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* "diff --check" should affect exit statusWincent Colaiuta2007-12-13
| | | | | | | | | | | | "git diff" has a --check option that can be used to check for whitespace problems but it only reported by printing warnings to the console. Now when the --check option is used we give a non-zero exit status, making "git diff --check" nicer to use in scripts and hooks. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdi_diff: trim common trailing linesJunio C Hamano2007-12-13
| | | | | | | | | | | | | This implements earlier Linus's optimization to trim common lines at the end before passing them down to low level xdiff interface for all of our xdiff users. We could later enhance this to also trim common leading lines, but that would need tweaking the output function to add the number of lines trimmed at the beginning to line numbers that appear in the hunk headers. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* xdl_diff: identify call sites.Junio C Hamano2007-12-13
| | | | | | | | This inserts a new function xdi_diff() that currently does not do anything other than calling the underlying xdl_diff() to the callchain of current callers of xdl_diff() function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* provide advance warning of some future pack default changesNicolas Pitre2007-12-13
| | | | | Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: unlink internal index files after operationsEric Wong2007-12-13
| | | | | | | | | Being git, we can generate these very quickly on the fly as needed, so there's no point in wasting space for these things for large projects. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: expand handling of From: and Signed-off-by:Andy Whitcroft2007-12-13
| | | | | | | | | | | | | | | | The current parsing for From: and Signed-off-by: lines handles fully specified names: From: Full Name <email@address> Expand this to include the raw email addresses and straight "names": From: email@address -> email <email@address> From: Full Name -> Full Name <unknown> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix spelling mistakes in user manualShawn Bohrer2007-12-13
| | | | | | Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Acked-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-commit: squelch needless message during an empty mergeJunio C Hamano2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | When recording a merge that conflicted and ends up in no changes after manual resolution, commit callchain looked like this: cmd_commit() -> prepare_log_message() -> run_status() -> wt_status_print() This invocation of run_status() is asked to find out if there is a committable change, but it unconditionally gave instructions such as "use git-add" at the same time. When in merge, we do allow an empty change to be recorded, so after showing this message the code still went ahead and made a commit. This introduces "nowarn" parameter to run_status() to avoid these useless messages. If we are not allowed to create an empty commit, we already call run_status() again in the original codepath, and the message will be shown from that call anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* GIT 1.5.4-rc0v1.5.4-rc0Junio C Hamano2007-12-12
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'cc/help'Junio C Hamano2007-12-12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cc/help: RPM spec: Adjust htmldir git-help -w: do not require to be in git repository git.spec.in: remove python_path Documentation: rename git.texi to user-manual.texi Add git-browse-help to .gitignore git-help -i: show info documentation from matching version of git git-help -i: invoke info with document and node name Documentation: add gitman.info target Documentation: describe -w/--web option to "git-help". Use {web,instaweb,help}.browser config options. git-help: add -w|--web option to display html man page in a browser. Documentation: describe -i/--info option to "git-help" git-help: add -i|--info option to display info page.
| * RPM spec: Adjust htmldirJunio C Hamano2007-12-12
| | | | | | | | | | | | git help -w needs to know the right location of installed pages. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-help -w: do not require to be in git repositoryJunio C Hamano2007-12-12
| | | | | | | | | | | | | | | | | | | | The users used to be able to say "git help cat-file" from anywhere, but the browse-help script insisted to be in a git repository, which caused "git help -w cat-file" to barf outside. Correct it. While at it, remove leftover debugging "echo". Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git.spec.in: remove python_pathJunio C Hamano2007-12-12
| | | | | | | | | | | | We do not depend on python nor customize scripts for it anymore. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Documentation: rename git.texi to user-manual.texiJunio C Hamano2007-12-12
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Add git-browse-help to .gitignoreJeff King2007-12-10
| | | | | | | | | | Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-help -i: show info documentation from matching version of gitJunio C Hamano2007-12-10
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-help -i: invoke info with document and node nameJunio C Hamano2007-12-10
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Documentation: add gitman.info targetJunio C Hamano2007-12-10
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge branch 'master' into cc/helpJunio C Hamano2007-12-10
| |\ | | | | | | | | | | | | This is to primarily pull in MANPATH tweak and help.txt formatting fix from the master branch.
| * | Documentation: describe -w/--web option to "git-help".Christian Couder2007-12-09
| | | | | | | | | | | | | | | | | | | | | | | | Also explain that "git instaweb" may use "web.browser" config variable. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Use {web,instaweb,help}.browser config options.Christian Couder2007-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now "git-instaweb" will try to use the browser configured as "web.browser", if "instaweb.browser" is not set. "git-browse-help" will check first "help.browser" and then "web.browser". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-help: add -w|--web option to display html man page in a browser.Christian Couder2007-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now when using "git help -w cmd", we will try to show the HTML man page "git-cmd.html" in your prefered web browser. To do that "help.c" code will call a new shell script "git-browse-help". This currently works only if the HTML versions of the man page have been installed in $(htmldir) (typically "/usr/share/doc/git-doc"), so new target to do that is added to "Documentation/Makefile". The browser to use can be configured using the "web.browser" config variable. We try to open a new tab in an existing web browser, if possible. The code in "git-browse-help" is heavily stolen from "git-mergetool" by Theodore Y. Ts'o. Thanks. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Documentation: describe -i/--info option to "git-help"Christian Couder2007-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | Option -i|--info for "git-help" is documented only in the new "git-help.txt" man page, but this new man page is referenced from the "--help" option documentation in the "git.txt" man page. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-help: add -i|--info option to display info page.Christian Couder2007-12-03
| | | | | | | | | | | | | | | | | | | | | "git help --info subcommand" will now call "info git-subcommand". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/shortlog-e'Junio C Hamano2007-12-12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/shortlog-e: shortlog: default to HEAD when the standard input is a tty Invert numbers and names in the git-shortlog summary mode. shortlog: document -e option git-shortlog -e: show e-mail address as well
| * | | shortlog: default to HEAD when the standard input is a ttyJunio C Hamano2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of warning the user that it is expecting git log output from the standard input (and waiting for the user to type the log from the keyboard, which is a silly thing to do), default to traverse from HEAD when there is no rev parameter given and the standard input is a tty. This factors out a useful helper "add_head()" from builtin-diff.c to a more appropriate place revision.c while renaming it to more descriptive name add_head_to_pending(), as that is what the function is about. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Invert numbers and names in the git-shortlog summary mode.Pierre Habouzit2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also make it `cut` friendly using a tab to separate the numbers and names. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | shortlog: document -e optionJeff King2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This shows e-mail address in addition to author's name. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git-shortlog -e: show e-mail address as wellJunio C Hamano2007-12-08
| | | | | | | | | | | | | | | | | | | | | | | | This option shows the author's email address next to the name. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ew/svn-rev-db'Junio C Hamano2007-12-12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * ew/svn-rev-db: git-svn: reinstate old rev_db optimization in new rev_map git-svn: replace .rev_db with a more space-efficient .rev_map format
| * | | | git-svn: reinstate old rev_db optimization in new rev_mapEric Wong2007-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reinstates an old optimization in .rev_db which stored the highest revision number we scanned, allowing us to avoid scanning the SVN log for those revisions again in a subsequent invocation. This means the last 24-byte record in a .rev_map file can be a 4-byte SVN revision number with 20-bytes of zeroes representing a non-existent commit. This record can and will be overwritten when a new commit iff the commit is all zeroes. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | git-svn: replace .rev_db with a more space-efficient .rev_map formatEric Wong2007-12-10
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrations are done automatically on an as-needed basis when new revisions are to be fetched. Stale remote branches do not get migrated, yet. However, unless you set noMetadata or useSvkProps it's safe to just do: find $GIT_DIR/svn -name '.rev_db*' -print0 | xargs rm -f to purge all the old .rev_db files. The new format is a one-way migration and is NOT compatible with old versions of git-svn. This is the replacement for the rev_db format, which was too big and inefficient for large repositories with a lot of sparse history (mainly tags). The format is this: - 24 bytes for every record, * 4 bytes for the integer representing an SVN revision number * 20 bytes representing the sha1 of a git commit - No empty padding records like the old format - new records are written append-only since SVN revision numbers increase monotonically - lookups on SVN revision number are done via a binary search - Piping the file to xxd(1) -c24 is a good way of dumping it for viewing or editing, should the need ever arise. As with .rev_db, these files are disposable unless noMetadata or useSvmProps is set. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/merge-recursive-gitlink'Junio C Hamano2007-12-12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * jc/merge-recursive-gitlink: Support a merge with conflicting gitlink change
| * | | | Support a merge with conflicting gitlink changeJunio C Hamano2007-12-11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge-recursive did not support merging trees that have conflicting changes in submodules they contain, and died. Support it exactly the same way as how it handles conflicting symbolic link changes --- mark it as a conflict, take the tentative result from the current side, and letting the caller resolve the conflict, without dying in merge_file() function. Also reword the error message issued when merge_file() has to die because it sees a tree entry of type it does not support yet. [jc: fixed up initial draft by Finn Arne Gangstad] Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jk/svn-color'Junio C Hamano2007-12-12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * jk/svn-color: git-svn: get color config from --get-colorbool Support GIT_PAGER_IN_USE environment variable
| * | | | git-svn: get color config from --get-colorboolJeff King2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-config recently learned a --get-colorbool option. By using it, we will get the same color=auto behavior that other git commands have. Specifically, this fixes the case where "color.diff = true" meant "always" in git-svn, but "auto" in other programs. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Support GIT_PAGER_IN_USE environment variableJeff King2007-12-11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deciding whether or not to turn on automatic color support, git_config_colorbool checks whether stdout is a tty. However, because we run a pager, if stdout is not a tty, we must check whether it is because we started the pager. This used to be done by checking the pager_in_use variable. This variable was set only when the git program being run started the pager; there was no way for an external program running git indicate that it had already started a pager. This patch allows a program to set GIT_PAGER_IN_USE to a true value to indicate that even though stdout is not a tty, it is because a pager is being used. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | disable t9119 for now.Junio C Hamano2007-12-12
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix "diff --check" whitespace detectionWincent Colaiuta2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "diff --check" would only detect spaces before tabs if a tab was the last character in the leading indent. Fix that and add a test case to make sure the bug doesn't regress in the future. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-diff --numstat -z: make it machine readableJunio C Hamano2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "-z" format is all about machine parsability, but showing renamed paths as "common/{a => b}/suffix" makes it impossible. The scripts would never have successfully parsed "--numstat -z -M" in the old format. This fixes the output format in a (hopefully minimally) backward incompatible way. * The output without -z is not changed. This has given a good way for humans to view added and deleted lines separately, and showing the path in combined, shorter way would preserve readability. * The output with -z is unchanged for paths that do not involve renames. Existing scripts that do not pass -M/-C are not affected at all. * The output with -z for a renamed path is shown in a format that can easily be distinguished from an unrenamed path. This is based on Jakub Narebski's patch. Bugs and documentation typos are mine. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Documentation: minor grammar fix for "git apply"Wincent Colaiuta2007-12-12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Use "whitespace" consistentlyWincent Colaiuta2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency, change "white space" and "whitespaces" to "whitespace", fixing a couple of adjacent grammar problems in the docs. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix XML parser leaks in http-pushMike Hommey2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XML_Parser were never freed. While at it, move the parser initialization to right before it is needed. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix small memory leaks induced by diff_tree_setup_pathsMike Hommey2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run diff_tree_release_paths in the appropriate places, and add a test to avoid NULL dereference. Better safe than sorry. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix git-fast-export for zero-sized blobsAlex Riesen2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing 1 elements of size 0-byte successfully will cause fwrite(3) to return 0, and flagging it as error is a mistake. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix clone not to ignore depth when performing a local cloneCharles Bailey2007-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When git-clone detects that it can perform a local clone it follows a path that silently ignores the depth parameter. Presumably if the user explicitly requests a shallow clone they have a reason to prefer a space efficient clone of just the recent history so bypass the local magic if the user specifies the depth parameter. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | blame: drop blob data after passing blame to the parentJunio C Hamano2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to keep the blob data for each origin that has any remaining line in the result, but this will get very costly with a huge file that has a deep history. This patch releases the blob after we ran diff between the child rev and its parents. When passing blame from a parent to its parent (i.e. the grandparent), the blob data for the parent may need to be read again, but it should be relatively cheap, thanks to delta-base cache. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-clone: print an error message when trying to clone empty repoJeff King2007-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, cloning an empty repository looked like this: $ (mkdir parent && cd parent && git --bare init) $ git-clone parent child Initialized empty Git repository in /home/peff/clone/child/.git/ $ cd child -bash: cd: child: No such file or directory $ echo 'wtf?' | mail git@vger.kernel.org Now we at least report that the clone was not successful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>