1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 14:06:12 +02:00
Commit Graph

15974 Commits

Author SHA1 Message Date
Nanako Shiraishi da06a80322 t9101: use "git hash-object" without dash
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:59:01 -07:00
Nanako Shiraishi f964732c05 tests: use "git foo" without dash in strings
This changes "git-foo" to "git foo" when message strings in tests
name git subcommands.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:59:00 -07:00
Nanako Shiraishi 1f77354b02 t9700: use "git config" without dash
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:59:00 -07:00
Nanako Shiraishi eaa2a6fc84 t9300, t9301: use "git fast-import/fast-export" without dash
Also use "git hash-object" and "git rev-parse" without dash.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:59:00 -07:00
Nanako Shiraishi 5190d73d1e t9200: use "git cvsexportcommit" without dash
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:59:00 -07:00
Junio C Hamano a15a435ad3 Merge branch 'ho/dashless'
* ho/dashless:
  Start conforming code to "git subcmd" style part 2
2008-09-09 22:57:35 -07:00
Dotan Barak e8eec71d6e Use xmalloc() and friends to catch allocation failures
Some places use the standard malloc/strdup without checking if the
allocation was successful; they should use xmalloc/xstrdup that
check the memory allocation result.

Signed-off-by: Dotan Barak <dotanba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 16:28:05 -07:00
Heikki Orsila 05207a2881 Start conforming code to "git subcmd" style part 2
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-09 08:41:29 -07:00
Christian Couder 4886b89f8f refs: improve comments about "reading" argument of "resolve_ref"
The existing in-code comment was misleading.  An access that is not
"reading" may often be "writing", but it does not have to be.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 08:34:00 -07:00
Arjen Laarhoven 10708a994a t6023-merge-file: Work around non-portable sed usage
OS X sed doesn't understand '\n' on the right side of a substitution.
Use a valid substitution character instead and use 'tr' to convert
those to a newline.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-08 14:26:23 -07:00
Mikael Magnusson bfd083b734 Correct output of git-count-objects.
The non-verbose output was not changed in fdb2a2a (compat: introduce
on_disk_bytes(), 2008-08-18) which caused git-count-objects to claim 512
times too much space used for loose objects.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-08 14:25:43 -07:00
Johannes Sixt e705d757bd Windows: git-shell can be compiled again
The reason that git-shell was excluded from the Windows build was that
our compatibility layer needed stuff that was removed when we tried to
link less of the git library into git-shell. Since 4cfc24a (shell: do
not play duplicated definition games to shrink the executable,
2008-08-19) the complete library is linked again, so we can build
git-shell on Windows as well. (This fixes 'make install', which depends
on that git-shell is always built.)

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-08 14:23:55 -07:00
Nanako Shiraishi 1364ff27dc t/t91XX git-svn tests: run "git svn" not "git-svn"
This replaces 'git-svn' with 'git svn' in the tests.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-08 14:22:58 -07:00
Nanako Shiraishi 16805d3e59 t/t91XX-svn: start removing use of "git-" from these tests
Subversion tests use too many "git-foo" form, so I am converting them
in two steps.

This first step replaces literal strings "remotes/git-svn" and "git-svn-id"
by introducing $remotes_git_svn and $git_svn_id constants defined as shell
variables.  This will reduce the number of false hits from "git grep".

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-08 14:18:04 -07:00
Junio C Hamano 24fa13cbb7 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: fix handling of even funkier branch names
2008-09-08 14:15:17 -07:00
Junio C Hamano 277cd4c4bd Merge branch 'ar/autospell'
* ar/autospell:
  Add help.autocorrect to enable/disable autocorrecting
  git wrapper: DWIM mistyped commands
2008-09-07 23:52:16 -07:00
Junio C Hamano cd50988ae0 Merge branch 'jc/cc-ld-dynpath'
* jc/cc-ld-dynpath:
  configure: auto detect dynamic library path switches
  Makefile: Allow CC_LD_DYNPATH to be overriden

Conflicts:
	Makefile
	config.mak.in
2008-09-07 23:45:56 -07:00
Junio C Hamano fdfb4cfadc Merge branch 'jc/hide-cr-in-diff-from-less'
* jc/hide-cr-in-diff-from-less:
  diff: Help "less" hide ^M from the output
2008-09-07 23:45:40 -07:00
Junio C Hamano 11bd3ddb91 Merge branch 'jc/maint-checkout-fix'
* jc/maint-checkout-fix:
  checkout: do not check out unmerged higher stages randomly

Conflicts:
	t/t7201-co.sh
2008-09-07 22:44:45 -07:00
Andreas Ericsson af9ce1ffc6 Teach "git diff -p" to locate PHP class methods
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-07 15:22:24 -07:00
Eric Wong f4392df485 git-svn: fix handling of even funkier branch names
Apparently do_switch() tolerates the lack of escaping in less
funky branch names.  For the really strange and scary ones, we
need to escape them properly.  It strangely maintains compatible
with the existing handling of branch names with spaces and
exclamation marks.

Reported-by: m.skoric@web.de ($gmane/94677)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06 21:00:28 -07:00
Junio C Hamano ec3a4ba519 Update draft release notes for 1.6.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06 19:39:55 -07:00
Junio C Hamano af9552f030 Merge git://git.bogomips.org/git-svn
* 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-06 19:39:13 -07:00
Paul Talacko 7c4d0219cf git-svn: set auto_props when renaming files
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-06 18:58:59 -07:00
Eric Wong a786091b4a t9124: clean up chdir usage
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-06 18:53:55 -07:00
Junio C Hamano 5fc3e67ac0 Merge updated git-gui and gitk that call each other
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-06 18:06:39 -07:00
Junio C Hamano 4a09bc9664 Merge branch 'maint'
* 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-06 16:47:32 -07:00
Junio C Hamano aaefbfa66c Update draft release notes for 1.6.0.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06 16:18:38 -07:00
Junio C Hamano 1eff26c0e2 stash: refresh the index before deciding if the work tree is dirty
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-06 16:16:42 -07:00
Junio C Hamano 1b118da8bd Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* '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-06 16:03:22 -07:00
Thomas Rast 4457d4f767 git-svn: fix 'info' tests for unknown items
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-05 16:58:39 -07:00
Thomas Rast 2cf3e3ac02 git-svn: match SVN 1.5 behaviour of info' on unknown item
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-05 16:58:39 -07:00
Thomas Rast 05427b91f0 git svn info: always quote URLs in 'info' output
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-05 16:58:39 -07:00
Thomas Rast edde9112ab git svn info: make info relative to the current directory
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-05 16:58:39 -07:00
Thomas Rast 8d5100c7a8 git svn info: tests: fix ptouch argument order in setup
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-05 16:58:39 -07:00
Thomas Rast 67214c85af git svn info: tests: use test_cmp instead of git-diff
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-05 16:58:39 -07:00
Thomas Rast e9a805aa2a git svn info: tests: do not use set -e
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-05 16:58:39 -07:00
Thomas Rast c9ab9ee478 git svn info: tests: let 'init' test run with SVN 1.5
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05 16:58:39 -07:00
Thomas Rast 2cb611054a git svn: catch lack of upstream info for dcommit earlier
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-05 16:58:39 -07:00
Eric Wong 991255c634 git-svn: check error code of send_txstream
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-05 16:58:38 -07:00
Florian Weimer 8598db935b git-svn: Send deltas during commits
Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05 16:58:38 -07:00
Florian Weimer 214a34d22e git-svn: Introduce SVN::Git::Editor::_chg_file_get_blob
Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05 16:58:38 -07:00
Florian Weimer 2d0c8accc3 git-svn: extract base blob in generate_diff
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>
2008-09-05 16:58:38 -07:00
Junio C Hamano f22a432b15 Mention the fact that 'git annotate' is only for backward compatibility.
When somebody is reading git-blame.txt (or git-annotate.txt) for the first
time, the message we would like to send is:

 (1) Here is why you would want to use this command, what it can do
     (perhaps more than what you would have expected from "$scm blame"),
     and how you tell it to do what it does.

     This is obvious.

 (2) You might have heard of the command with the other name.  There is no
     difference between the two, except they differ in their default
     output formats.

     This is essential to answer: "git has both?  how are they different?"

 (3) We tend to encourage blame over annotate for new scripts and new
     people, but there is no reason to choose one over the other.

     This is not as important as (2), but would be useful to avoid
     repeated questions about "when will we start deprecating this?"

As long as we describe (2) on git-annotate page clearly enough, people who
read git-blame page first and get curious can refer to git-annotate page.
While at it, subtly hint (3) without being overly explicit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-05 01:15:40 -07:00
Junio C Hamano 7ceacdffc5 "blame -c" should be compatible with "annotate"
There is no reason to have a separate variable cmd_is_annotate;
OUTPUT_ANNOTATE_COMPAT option is supposed to produce the compatibility
output, and we should produce the same output even when the command was
not invoked as "annotate" but as "blame -c".

Noticed by Pasky.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-05 00:57:35 -07:00
Junio C Hamano 80d12c23de Merge branch 'jc/maint-log-grep'
* jc/maint-log-grep:
  log --author/--committer: really match only with name part
  diff --cumulative is a sub-option of --dirstat
  bash completion: Hide more plumbing commands
2008-09-04 22:30:44 -07:00
Junio C Hamano a4d7d2c6db log --author/--committer: really match only with name part
When we tried to find commits done by AUTHOR, the first implementation
tried to pattern match a line with "^author .*AUTHOR", which later was
enhanced to strip leading caret and look for "^author AUTHOR" when the
search pattern was anchored at the left end (i.e. --author="^AUTHOR").

This had a few problems:

 * When looking for fixed strings (e.g. "git log -F --author=x --grep=y"),
   the regexp internally used "^author .*x" would never match anything;

 * To match at the end (e.g. "git log --author='google.com>$'"), the
   generated regexp has to also match the trailing timestamp part the
   commit header lines have.  Also, in order to determine if the '$' at
   the end means "match at the end of the line" or just a literal dollar
   sign (probably backslash-quoted), we would need to parse the regexp
   ourselves.

An earlier alternative tried to make sure that a line matches "^author "
(to limit by field name) and the user supplied pattern at the same time.
While it solved the -F problem by introducing a special override for
matching the "^author ", it did not solve the trailing timestamp nor tail
match problem.  It also would have matched every commit if --author=author
was asked for, not because the author's email part had this string, but
because every commit header line that talks about the author begins with
that field name, regardleses of who wrote it.

Instead of piling more hacks on top of hacks, this rethinks the grep
machinery that is used to look for strings in the commit header, and makes
sure that (1) field name matches literally at the beginning of the line,
followed by a SP, and (2) the user supplied pattern is matched against the
remainder of the line, excluding the trailing timestamp data.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-04 22:21:56 -07:00
Shawn O. Pearce 95b6a2db25 Merge branch 'maint'
* maint:
  git-gui: Fix diff parsing for lines starting with "--" or "++"
2008-09-04 21:53:06 -07:00
Shawn O. Pearce ca53c3fdcf git-gui: Fix diff parsing for lines starting with "--" or "++"
Languages like Lua and SQL use "--" to mark a line as commented out.
If this appears at column 0 and is part of the pre-image we may see
"--- foo" in the diff, indicating that the line whose content is
 "-- foo" has been removed from the new version.

git-gui was incorrectly parsing "--- foo" as the old file name
in the file header, causing it to generate a bad patch file when
the user tried to stage or unstage a hunk or the selected line.
We need to keep track of where we are in the parsing so that we do
not misread a deletion or addition record as part of the header.

Reported-by: Alexander Gladysh <agladysh@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-04 21:52:56 -07:00
Alexander Gavrilov b2ca414973 git-gui: Show special diffs for complex conflict cases.
Add special handling for displaying diffs of modified/deleted,
and symlink/mode conflicts. Currently the display is completely
unusable for deciding how to resolve the conflict.

New display modes:

1) Deleted/Modified conflict: e.g.
	LOCAL: deleted
	REMOTE:
	[diff :1:$path :3:$path]

2) Conflict involving symlinks:
	LOCAL:
	[diff :1:$path :2:$path]
	REMOTE:
	[diff :1:$path :3:$path]

In order to be able to display multiple diffs, this
patch adds a queue of commands to call.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-04 21:28:55 -07:00