aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* git-help: add "help.format" config variable.Christian Couder2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | This config variable makes it possible to choose the default format used to display help. This format will be used only if no option like -a|--all|-i|--info|-m|--man|-w|--web is passed to "git-help". The following values are possible for this variable: - "man" --> "man" program is used - "info" --> "info" program is used - "web" --> "git-browse-help" is used By default we still show help using "man". This patch also adds -m|--man command line option to use "man" to allow overriding the "help.format" configuration variable. Note that this patch also revert some recent changes in "git-browse-help" because they prevented to look for config variables in the global configuration file. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'wc/diff'Junio C Hamano2007-12-14
|\ | | | | | | | | | | | | | | | | | | | | * wc/diff: Test interaction between diff --check and --exit-code Use shorter error messages for whitespace problems Add tests for "git diff --check" with core.whitespace options Make "diff --check" output match "git apply" Unify whitespace checking diff --check: minor fixups "diff --check" should affect exit status
| * Test interaction between diff --check and --exit-codeWincent Colaiuta2007-12-14
| | | | | | | | | | | | | | Make sure that it works as advertised in the man page. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Use shorter error messages for whitespace problemsWincent Colaiuta2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | The initial version of the whitespace_error_string() function took the messages from builtin-apply.c rather than the shorter messages from diff.c. This commit addresses Junio's concern that these messages might be too long (now that we can emit multiple warnings per line). Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Add tests for "git diff --check" with core.whitespace optionsWincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | Make sure that "git diff --check" does the right thing when the core.whitespace options are set. While we are at it, correct many uses of test_expect_failure that ran sequence of commands. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Make "diff --check" output match "git apply"Wincent Colaiuta2007-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency, make the two tools report whitespace errors in the same way (the output of "diff --check" has been tweaked to match that of "git apply"). Note that although the textual content is basically the same only "git diff --check" provides a colorized version of the problematic lines; making "git apply" do colorization will require more extensive changes (figuring out the diff colorization preferences of the user) and so that will be a subject for another commit. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * 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>
* | Move fetch_ref from http-push.c and http-walker.c to http.cMike Hommey2007-12-14
| | | | | | | | | | | | | | | | Make the necessary changes to be ok with their difference, and rename the function http_fetch_ref. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix various memory leaks in http-push.c and http-walker.cMike Hommey2007-12-14
| | | | | | | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Use strbuf in http codeMike Hommey2007-12-14
| | | | | | | | | | | | | | Also, replace whitespaces with tabs in some places Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Avoid redundant declaration of missing_target()Mike Hommey2007-12-14
| | | | | | | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Remove a CURLOPT_HTTPHEADER (un)settingMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | Setting CURLOPT_HTTPHEADER doesn't add HTTP headers, but replaces whatever set of headers was configured before, so setting to NULL doesn't have any magic meaning, and is pretty much useless when setting to another list right after. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Remove the default_headers variable from http-push.cMike Hommey2007-12-14
| | | | | | | | | | | | | | It appears that despite being initialized, it was never used. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix random sha1 in error message in http-fetch and http-pushMike Hommey2007-12-14
| | | | | | | | | | | | | | | | | | | | When a downloaded ref doesn't contain a sha1, the error message displays a random sha1 because of uninitialized memory. This happens when cloning a repository that is already a clone of another one, in which case refs/remotes/origin/HEAD is a symref. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix some more memory leaks in http-push.cMike Hommey2007-12-14
| | | | | | | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Use a strbuf for building up section header and key/value pair strings.Kristian Høgsberg2007-12-14
| | | | | | | | | | | | | | Avoids horrible 1-byte write(2) calls and cleans up the logic a bit. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | fast-import: fix unalinged allocation and accessDavid S. Miller2007-12-14
| | | | | | | | | | | | | | | | | | The specialized pool allocator fast-import uses aligned objects on the size of a pointer, which was not sufficient at least on Sparc. Instead, make the alignment for objects of type unitmax_t. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote: Fix bogus make_branch() call in configuration reader.Junio C Hamano2007-12-14
| | | | | | | | | | | | | | | | | | | | | | The configuration reader to enumerate branches that have configuration data were not careful enough and failed to skip "branch.<variable>" entries (e.g. branch.autosetupmerge). This resulted in bogus attempt to allocate huge memory. Noticed by David Miller. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | commit: allow --amend to reuse message from another commitJunio C Hamano2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After tentatively applying a patch from a contributor, you can get a replacement patch with corrected code and unusable commit log message. In such a case, this sequence ought to give you an editor based on the message in the earlier commit, to let you describe an incremental improvement: git reset --hard HEAD^ ;# discard the earlier one git am <corrected-patch git commit --amend -c HEAD@{1} Unfortunately, --amend insisted reusing the message from the commit being amended, ignoring the -c option. This corrects it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: handle our top-level path being deleted and later re-addedEric Wong2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, git-svn would ignore cases where the path we're tracking is removed from the repository. This was to prevent heads with follow-parent from ending up with a tree full of empty revisions (and thus breaking rename detection). The previous behavior is fine until the path we're tracking is re-added later on, leading to the old files being merged in with the new files in the directory (because the old files were never marked as deleted) We will now only remove all the old files locally that were deleted remotely iff we detect the directory we're in is being created from scratch. Thanks for Marcus D. Hanwell for the bug report and Peter Baumann for the analysis. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | cvsexportcommit: fix massive commitsJeff King2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Documentation: describe pack idx v2linux@horizon.com2007-12-14
| | | | | | | | | | | | | | | | Lifted from the log message of c553ca25bd60dc9fd50b8bc7bd329601b81cee66 (pack-objects: learn about pack index version 2). Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | xdiff tail trimming: use correct type.Junio C Hamano2007-12-14
|/ | | | | | | | | Inside xdiff library, the number of context lines is represented in long, not int. Noticed by Peter Baumann. 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>