]> asedeno.scripts.mit.edu Git - git.git/log
git.git
15 years agoMerge branch 'ho/maint-dashless' into maint
Junio C Hamano [Fri, 12 Sep 2008 23:15:23 +0000 (16:15 -0700)]
Merge branch 'ho/maint-dashless' into maint

* ho/maint-dashless:
  Start conforming code to "git subcmd" style part 2

15 years agoFix some manual typos.
Ralf Wildenhues [Fri, 12 Sep 2008 19:10:26 +0000 (21:10 +0200)]
Fix some manual typos.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-gui: I18n fix sentence parts into full sentences for translation again.
Christian Stimming [Fri, 12 Sep 2008 09:17:38 +0000 (11:17 +0200)]
git-gui: I18n fix sentence parts into full sentences for translation again.

For translations, it is almost always impossible to correctly translate
parts of sentences in almost any other language. Hence, messages like this
must be re-organized into full sentences.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <sop@google.com>
15 years agogit-gui: Restore ability to Stage Working Copy for conflicts.
Alexander Gavrilov [Mon, 8 Sep 2008 16:37:11 +0000 (20:37 +0400)]
git-gui: Restore ability to Stage Working Copy for conflicts.

Tools like rerere leave files marked as conflicts in the index,
while actually resolving them in the working copy. Also, some
people like to use an external editor to resolve conflicts.

This patch restores functionality previously removed in
commit 617ceee653 by adding a new context menu item.
It still ensures that the user does not stage conflicting files
accidentally by clicking on the icon instead of the name.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <sop@google.com>
15 years agogit-gui: Fix Blame Parent & Context for working copy lines.
Alexander Gavrilov [Mon, 8 Sep 2008 07:18:52 +0000 (11:18 +0400)]
git-gui: Fix Blame Parent & Context for working copy lines.

Make Blame Parent Commit and Show History Context work
properly for lines blamed on the working copy.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <sop@google.com>
15 years agogit wrapper: also use aliases to correct mistyped commands
Pieter de Bie [Wed, 10 Sep 2008 15:54:28 +0000 (17:54 +0200)]
git wrapper: also use aliases to correct mistyped commands

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse compatibility regex library also on FreeBSD
Jeff King [Thu, 11 Sep 2008 12:12:16 +0000 (08:12 -0400)]
Use compatibility regex library also on FreeBSD

Commit 3632cfc24 makes the same change for Darwin; however, the problem
also exists on FreeBSD.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse compatibility regex library also on AIX
Johannes Sixt [Thu, 11 Sep 2008 08:14:44 +0000 (10:14 +0200)]
Use compatibility regex library also on AIX

This augments 3632cfc24 (Use compatibility regex library on Darwin,
2008-09-07), which already carries a "Tested-by" statement for AIX,
but that test was actually done with this patch included.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot7603: add new testcases to ensure builtin-commit uses reduce_heads()
Miklos Vajna [Wed, 10 Sep 2008 20:10:33 +0000 (22:10 +0200)]
t7603: add new testcases to ensure builtin-commit uses reduce_heads()

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-commit: use commit_tree()
Miklos Vajna [Wed, 10 Sep 2008 20:10:32 +0000 (22:10 +0200)]
builtin-commit: use commit_tree()

First, it adds less code than removes, second this allows us to use
recuce_heads() for parents, so that the parents of a merge will be
always the same with or without a conflict.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoInstall git-cvsserver in $(bindir)
Nanako Shiraishi [Wed, 10 Sep 2008 11:03:18 +0000 (20:03 +0900)]
Install git-cvsserver in $(bindir)

It is one of the server side programs and needs to be found on usual $PATH.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoseparate build targets for man and html documentation
Michael J Gruber [Wed, 10 Sep 2008 08:19:34 +0000 (10:19 +0200)]
separate build targets for man and html documentation

This introduces new build targets "man" and "html" which allow building
the documentation in the respective formats separately. This helps
people with a partial documentation build chain: html pages can be built
without xmlto.

This is documented in INSTALL now, together with corrections: Before,
instructions in INSTALL would build man+html but install man only. Now
the instructions build and install both, and new and pre-existing
targets are explained.

Note that build targets "doc" and "man" correspond to install targets
"install-doc install-html" and "install-doc" respectively. This
inconsistency is not changed, in order to keep everyone's build scripts
from breaking.

Signed-off-by: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoallow installation of man and html doc from the man and html branches
Michael J Gruber [Tue, 9 Sep 2008 20:44:17 +0000 (22:44 +0200)]
allow installation of man and html doc from the man and html branches

This patch introduces a make target "quick-install-html" which installs
the html documentation from the branch origin/html, without the need for
asciidoc/xmlto. This is analogous to the existing "quick-install-doc"
target for the man pages.

We advertise these targets in the INSTALL file now.

Signed-off-by: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocommit_tree(): add a new author parameter
Miklos Vajna [Wed, 10 Sep 2008 20:10:31 +0000 (22:10 +0200)]
commit_tree(): add a new author parameter

In case it's NULL, it is still determined automatically, but now you
have the ability to specify one yourself.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix git-diff-tree --stdin
Junio C Hamano [Wed, 10 Sep 2008 19:22:35 +0000 (12:22 -0700)]
Fix git-diff-tree --stdin

140b378 (Teach git diff-tree --stdin to diff trees, 2008-08-10) broke the
more important case of reading series of commits to filter ones that touch
given pathspecs.

Noticed by Mark Levedahl, running "gitk ec3a4ba" and trying to focus on
commits that touch "t/" directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 10 Sep 2008 20:56:20 +0000 (13:56 -0700)]
Merge branch 'maint'

* maint:
  Update draft release notes for 1.6.0.2
  Use compatibility regex library for OSX/Darwin
  git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
  Git.pm: Use File::Temp->tempfile instead of ->new
  t7501: always use test_cmp instead of diff

Conflicts:
Makefile

15 years agoUpdate draft release notes for 1.6.0.2
Junio C Hamano [Wed, 10 Sep 2008 19:45:02 +0000 (12:45 -0700)]
Update draft release notes for 1.6.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse compatibility regex library for OSX/Darwin
Arjen Laarhoven [Sun, 7 Sep 2008 18:45:37 +0000 (20:45 +0200)]
Use compatibility regex library for OSX/Darwin

The standard libc regex library on OSX does not support alternation
in POSIX Basic Regular Expression mode.  This breaks the diff.funcname
functionality on OSX.

To fix this, we use the GNU regex library which is already present in
the compat/ diretory for the MinGW port.  However, simply adding compat/
to the COMPAT_CFLAGS variable causes a conflict between the system
fnmatch.h and the one present in compat/.  To remedy this, move the
regex and fnmatch functionality to their own subdirectories in compat/
so they can be included seperately.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Tested-by: Mike Ralphson <mike@abacus.co.uk> (AIX)
Tested-by: Johannes Sixt <johannes.sixt@telecom.at> (MinGW)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
Marcus Griep [Wed, 10 Sep 2008 15:09:46 +0000 (11:09 -0400)]
git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl

Signed-off-by: Marcus Griep <marcus@griep.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGit.pm: Use File::Temp->tempfile instead of ->new
Marcus Griep [Mon, 8 Sep 2008 16:53:01 +0000 (12:53 -0400)]
Git.pm: Use File::Temp->tempfile instead of ->new

Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()
interface introduced in 0.14, as pointed out by Tom G. Christensen.

This modifies Git.pm to use the more established tempfile() interface
and updates 'git svn' to match.

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Eric Wong <normalperson@yhbt.net>
Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot7501: always use test_cmp instead of diff
Miklos Vajna [Wed, 10 Sep 2008 17:32:44 +0000 (19:32 +0200)]
t7501: always use test_cmp instead of diff

This should make the output more readable (by default using diff -u)
when some tests fail.

Also changed the diff order from "current expected" to "expected
current".

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/maint-log-grep' into maint
Junio C Hamano [Wed, 10 Sep 2008 09:15:08 +0000 (02:15 -0700)]
Merge branch 'jc/maint-log-grep' into maint

* jc/maint-log-grep:
  log --author/--committer: really match only with name part

15 years agoMerge branch 'jc/maint-hide-cr-in-diff-from-less' into maint
Junio C Hamano [Wed, 10 Sep 2008 09:14:18 +0000 (02:14 -0700)]
Merge branch 'jc/maint-hide-cr-in-diff-from-less' into maint

* jc/maint-hide-cr-in-diff-from-less:
  diff: Help "less" hide ^M from the output

15 years agoMerge branch 'jc/maint-checkout-fix' into maint
Junio C Hamano [Wed, 10 Sep 2008 09:13:41 +0000 (02:13 -0700)]
Merge branch 'jc/maint-checkout-fix' into maint

* jc/maint-checkout-fix:
  checkout: do not check out unmerged higher stages randomly

15 years agoMerge branch 'np/maint-safer-pack' into maint
Junio C Hamano [Wed, 10 Sep 2008 09:12:47 +0000 (02:12 -0700)]
Merge branch 'np/maint-safer-pack' into maint

* np/maint-safer-pack:
  fixup_pack_header_footer(): use nicely aligned buffer sizes
  index-pack: use fixup_pack_header_footer()'s validation mode
  pack-objects: use fixup_pack_header_footer()'s validation mode
  improve reliability of fixup_pack_header_footer()
  pack-objects: improve returned information from write_one()

15 years agot9101: use "git hash-object" without dash
Nanako Shiraishi [Tue, 9 Sep 2008 21:25:28 +0000 (06:25 +0900)]
t9101: use "git hash-object" without dash

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: use "git foo" without dash in strings
Nanako Shiraishi [Tue, 9 Sep 2008 21:25:27 +0000 (06:25 +0900)]
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>
15 years agot9700: use "git config" without dash
Nanako Shiraishi [Tue, 9 Sep 2008 21:25:26 +0000 (06:25 +0900)]
t9700: use "git config" without dash

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9300, t9301: use "git fast-import/fast-export" without dash
Nanako Shiraishi [Tue, 9 Sep 2008 21:25:25 +0000 (06:25 +0900)]
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>
15 years agot9200: use "git cvsexportcommit" without dash
Nanako Shiraishi [Tue, 9 Sep 2008 21:25:24 +0000 (06:25 +0900)]
t9200: use "git cvsexportcommit" without dash

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ho/dashless'
Junio C Hamano [Wed, 10 Sep 2008 05:57:35 +0000 (22:57 -0700)]
Merge branch 'ho/dashless'

* ho/dashless:
  Start conforming code to "git subcmd" style part 2

15 years agocheckout: do not lose staged removal
Junio C Hamano [Mon, 8 Sep 2008 02:49:25 +0000 (19:49 -0700)]
checkout: do not lose staged removal

The logic to checkout a different commit implements the safety to never
lose user's local changes.  For example, switching from a commit to
another commit, when you have changed a path that is different between
them, need to merge your changes to the version from the switched-to
commit, which you may not necessarily be able to resolve easily.  By
default, "git checkout" refused to switch branches, to give you a chance
to stash your local changes (or use "-m" to merge, accepting the risks of
getting conflicts).

This safety, however, had one deliberate hole since early June 2005.  When
your local change was to remove a path (and optionally to stage that
removal), the command checked out the path from the switched-to commit
nevertheless.

This was to allow an initial checkout to happen smoothly (e.g. an initial
checkout is done by starting with an empty index and switching from the
commit at the HEAD to the same commit).  We can tighten the rule slightly
to allow this special case to pass, without losing sight of removal
explicitly done by the user, by noticing if the index is truly empty when
the operation begins.

For historical background, see:

    http://thread.gmane.org/gmane.comp.version-control.git/4641/focus=4646

This case is marked as *0* in the message, which both Linus and I said "it
feels somewhat wrong but otherwise we cannot start from an empty index".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse xmalloc() and friends to catch allocation failures
Dotan Barak [Tue, 9 Sep 2008 18:57:10 +0000 (21:57 +0300)]
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>
15 years agoFix permission bits on sources checked out with an overtight umask
Junio C Hamano [Fri, 22 Aug 2008 00:31:50 +0000 (19:31 -0500)]
Fix permission bits on sources checked out with an overtight umask

Two patches 9907721 (templates/Makefile: don't depend on local umask
setting, 2008-02-28) and 96cda0b (templates/Makefile: install is
unnecessary, just use mkdir -p, 2008-08-21) tried to prevent an overtight
umask the builder/installer might have from screwing over the installation
procedure, but we forgot there was another source of trouble.  If the
person who checked out the source tree had an overtight umask, it will
leak out to the built products, which is propagated to the installation
destination.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopush: receiver end advertises refs from alternate repositories
Junio C Hamano [Tue, 9 Sep 2008 08:27:10 +0000 (01:27 -0700)]
push: receiver end advertises refs from alternate repositories

Earlier, when pushing into a repository that borrows from alternate object
stores, we followed the longstanding design decision not to trust refs in
the alternate repository that houses the object store we are borrowing
from.  If your public repository is borrowing from Linus's public
repository, you pushed into it long time ago, and now when you try to push
your updated history that is in sync with more recent history from Linus,
you will end up sending not just your own development, but also the
changes you acquired through Linus's tree, even though the objects needed
for the latter already exists at the receiving end.  This is because the
receiving end does not advertise that the objects only reachable from the
borrowed repository (i.e. Linus's) are already available there.

This solves the issue by making the receiving end advertise refs from
borrowed repositories.  They are not sent with their true names but with a
phoney name ".have" to make sure that the old senders will safely ignore
them (otherwise, the old senders will misbehave, trying to push matching
refs, and mirror push that deletes refs that only exist at the receiving
end).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopush: prepare sender to receive extended ref information from the receiver
Junio C Hamano [Tue, 9 Sep 2008 08:27:09 +0000 (01:27 -0700)]
push: prepare sender to receive extended ref information from the receiver

"git push" enhancement allows the receiving end to report not only its own
refs but refs in repositories it borrows from via the alternate object
store mechanism.  By telling the sender that objects reachable from these
extra refs are already complete in the receiving end, the number of
objects that need to be transfered can be cut down.

These entries are sent over the wire with string ".have", instead of the
actual names of the refs.  This string was chosen so that they are ignored
by older programs at the sending end.  If we sent some random but valid
looking refnames for these entries, "matching refs" rule (triggered when
running "git push" without explicit refspecs, where the sender learns what
refs the receiver has, and updates only the ones with the names of the
refs the sender also has) and "delete missing" rule (triggered when "git
push --mirror" is used, where the sender tells the receiver to delete the
refs it itself does not have) would try to update/delete them, which is
not what we want.

This prepares the send-pack (and "push" that runs native protocol) to
accept extended existing ref information and make use of it.  The ".have"
entries are excluded from ref matching rules, and are exempt from deletion
rule while pushing with --mirror option, but are still used for pack
generation purposes by providing more "bottom" range commits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoreceive-pack: make it a builtin
Junio C Hamano [Tue, 9 Sep 2008 08:27:08 +0000 (01:27 -0700)]
receive-pack: make it a builtin

It is a good thing to do in general, but more importantly, transport
routines can only be used by built-ins, which is what I'll be adding next.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agois_directory(): a generic helper function
Junio C Hamano [Tue, 9 Sep 2008 08:27:07 +0000 (01:27 -0700)]
is_directory(): a generic helper function

A simple "grep -e stat --and -e S_ISDIR" revealed there are many
open-coded implementations of this function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-rebase--interactive: auto amend only edited commit
Dmitry Potapov [Tue, 9 Sep 2008 12:05:26 +0000 (16:05 +0400)]
git-rebase--interactive: auto amend only edited commit

"git rebase --continue" issued after git rebase being stop by "edit"
command is trying to amend the last commit using stage changes. However,
if the last commit is not the commit that was marked as "edit" then it
can produce unexpected results.

For instance, after being stop by "edit", I have made some changes to
commit message using "git commit --amend". After that I realized that
I forgot to add some changes to some file. So, I said "git add file"
and the "git rebase --continue". Unfortunately, it caused that the new
commit message was lost.

Another problem is that after being stopped at "edit", the user adds new
commits. In this case, automatic amend behavior of git rebase triggered
by some stage changes causes that not only that the log message of the
last commit is lost but that it will contain also wrong Author and Date
information.

Therefore, this patch restrict automatic amend only to the situation
where HEAD is the commit at which git rebase stop by "edit" command.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStart conforming code to "git subcmd" style part 2
Heikki Orsila [Tue, 9 Sep 2008 10:28:30 +0000 (13:28 +0300)]
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>
15 years agogit-rebase-interactive: do not squash commits on abort
Dmitry Potapov [Mon, 8 Sep 2008 20:42:48 +0000 (00:42 +0400)]
git-rebase-interactive: do not squash commits on abort

If git rebase interactive is stopped by "edit" command and then the user
said "git rebase --continue" while having some stage changes, git rebase
interactive is trying to amend the last commit by doing:
  git --soft reset && git commit

However, the user can abort commit for some reason by providing an empty
log message, and that would leave the last commit undone, while the user
being completely unaware about what happened. Now if the user tries to
continue, by issuing "git rebase --continue" that squashes two previous
commits.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorefs: improve comments about "reading" argument of "resolve_ref"
Christian Couder [Tue, 9 Sep 2008 05:10:56 +0000 (07:10 +0200)]
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>
15 years agot6023-merge-file: Work around non-portable sed usage
Arjen Laarhoven [Mon, 8 Sep 2008 18:29:18 +0000 (20:29 +0200)]
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>
15 years agoCorrect output of git-count-objects.
Mikael Magnusson [Mon, 8 Sep 2008 17:56:32 +0000 (19:56 +0200)]
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>
15 years agoWindows: git-shell can be compiled again
Johannes Sixt [Mon, 8 Sep 2008 10:46:55 +0000 (12:46 +0200)]
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>
15 years agot/t91XX git-svn tests: run "git svn" not "git-svn"
Nanako Shiraishi [Mon, 8 Sep 2008 10:02:08 +0000 (19:02 +0900)]
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>
15 years agot/t91XX-svn: start removing use of "git-" from these tests
Nanako Shiraishi [Mon, 8 Sep 2008 10:02:05 +0000 (19:02 +0900)]
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>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 8 Sep 2008 21:15:17 +0000 (14:15 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: fix handling of even funkier branch names

15 years agoMerge branch 'ar/autospell'
Junio C Hamano [Mon, 8 Sep 2008 06:52:16 +0000 (23:52 -0700)]
Merge branch 'ar/autospell'

* ar/autospell:
  Add help.autocorrect to enable/disable autocorrecting
  git wrapper: DWIM mistyped commands

15 years agoMerge branch 'jc/cc-ld-dynpath'
Junio C Hamano [Mon, 8 Sep 2008 06:45:56 +0000 (23:45 -0700)]
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

15 years agoMerge branch 'jc/hide-cr-in-diff-from-less'
Junio C Hamano [Mon, 8 Sep 2008 06:45:40 +0000 (23:45 -0700)]
Merge branch 'jc/hide-cr-in-diff-from-less'

* jc/hide-cr-in-diff-from-less:
  diff: Help "less" hide ^M from the output

15 years agoMerge branch 'jc/maint-checkout-fix'
Junio C Hamano [Mon, 8 Sep 2008 05:44:45 +0000 (22:44 -0700)]
Merge branch 'jc/maint-checkout-fix'

* jc/maint-checkout-fix:
  checkout: do not check out unmerged higher stages randomly

Conflicts:
t/t7201-co.sh

15 years agowt-status: Teach how to discard changes in the working directory
Anders Melchiorsen [Sun, 7 Sep 2008 22:05:03 +0000 (00:05 +0200)]
wt-status: Teach how to discard changes in the working directory

This is a question that comes up a lot in #git.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agowt-status: Split header generation into three functions
Anders Melchiorsen [Sun, 7 Sep 2008 22:05:02 +0000 (00:05 +0200)]
wt-status: Split header generation into three functions

Reorganize header generation so that all header text related to each
block is in one place.

This adds a function, but makes it easier to see what is generated in
each case. It also allows for easy tweaking of individual headers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTeach "git diff -p" to locate PHP class methods
Andreas Ericsson [Sun, 7 Sep 2008 20:15:29 +0000 (22:15 +0200)]
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>
15 years agoDon't verify host name in SSL certs when GIT_SSL_NO_VERIFY is set
Junio C Hamano [Thu, 21 Feb 2008 23:10:37 +0000 (15:10 -0800)]
Don't verify host name in SSL certs when GIT_SSL_NO_VERIFY is set

Originally from Mike Hommey; earlier we were disabling SSL_VERIFYPEER
but SSL_VERIFYHOST was in effect even when the user asked not to with
the environment variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: fix handling of even funkier branch names
Eric Wong [Sun, 7 Sep 2008 03:18:18 +0000 (20:18 -0700)]
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>
15 years agodaemon.c: avoid setlinebuf()
Junio C Hamano [Thu, 4 Sep 2008 03:33:29 +0000 (20:33 -0700)]
daemon.c: avoid setlinebuf()

This function is outside POSIX (Linux and recent BSD have it).  Replace it
with setvbuf() which is POSIX.

I am not sure about the value this patch passes as size argument to
setvbuf(), though.  I know the call this patch makes is equivalent to
calling setlinebuf() with GNU libc, but POSIX itself leaves what happens
to the size argument quite vague, saying only "otherwise [i.e. when buf is
a null pointer], size _may_ determine the size of a buffer allocated by
the setvbuf() function."  If passing size=0 causes stdio to allocate very
small buffer, and while stdio tries to line buffer the output, it might
make it to fail to buffer an entire line, causing early flushing of the
stream.

Even if that turns out to be a problem on minorority platforms, we won't
know it until the issue actually hurts them, so let's push this change out
and see what happens.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-merge: release the lockfile in try_merge_strategy()
Miklos Vajna [Sat, 6 Sep 2008 16:29:49 +0000 (18:29 +0200)]
builtin-merge: release the lockfile in try_merge_strategy()

Once we committed the locked index, we should release the lockfile. In
most cases this is done automatically when the process ends, but this is
not true in this case.

[jc: with additional tests from Eric Raible]

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes for 1.6.1
Junio C Hamano [Sun, 7 Sep 2008 01:22:00 +0000 (18:22 -0700)]
Update draft release notes for 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 7 Sep 2008 02:39:13 +0000 (19:39 -0700)]
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

15 years agodiff --quiet: make it synonym to --exit-code >/dev/null
Junio C Hamano [Tue, 2 Sep 2008 06:20:26 +0000 (23:20 -0700)]
diff --quiet: make it synonym to --exit-code >/dev/null

The point of --quiet was to return the status as early as possible without
doing any extra processing.  Well behaved scripts, when they expect to run
many diff operations inside, are supposed to run "update-index --refresh"
upfront; we do not want them to pay the price of iterating over the index
and comparing the contents to fix the stat dirtiness, and we avoided most
of the processing in diffcore_std() when --quiet is in effect.

But scripts that adhere to the good practice won't have to pay any more
price than the necessary lstat(2) that will report stat cleanliness, as
long as only -q is given without any fancier diff options.

More importantly, users who do ask for "--quiet -M --filter=D" (in order
to notice only the deletion, not paths that disappeared only because they
have been renamed away) deserve to get the result they asked for, even it
means they have to pay the extra price; the alternative is to get a cheap
early return that gives a result they did not ask for, which is much
worse.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff Porcelain: do not disable auto index refreshing on -C -C
Junio C Hamano [Sun, 7 Sep 2008 02:09:16 +0000 (19:09 -0700)]
diff Porcelain: do not disable auto index refreshing on -C -C

When we enabled the automatic refreshing of the index to "diff" Porcelain,
we disabled it when --find-copies-harder was asked, but there is no good
reason to do so.  In the following command sequence, the first "diff"
shows an "empty" diff exposing stat dirtyness, while the second one does
not.

    $ >foo
    $ git add foo
    $ touch foo
    $ git diff -C -C
    $ git diff -C

This fixes the inconsistency.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: set auto_props when renaming files
Paul Talacko [Sun, 7 Sep 2008 01:50:38 +0000 (18:50 -0700)]
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>
15 years agogit-apply:--include=pathspec
Junio C Hamano [Mon, 25 Aug 2008 08:05:31 +0000 (01:05 -0700)]
git-apply:--include=pathspec

This allows --include=pathspec, similar to --exclude=pathspec.

The rule when one or both of these are used is that the include/exclude
patterns are examined in the order they are given on the command line, and
the first match determines if a patch to each path is used or not.  Hence:

    $ git apply --include='specific.h' --exclude='*.h' <diff

would apply the patch to specific.h header file, but all other patches in
the input file to other header files are ignored.  A patch to a path that
does not match any include/exclude pattern is used by default if there is
no include pattern on the command line, and ignored if there is any
include pattern.

This originally came from Joe Perches, but both the design of the
semantics and the implementation have been redone complately.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9124: clean up chdir usage
Eric Wong [Sun, 7 Sep 2008 01:29:12 +0000 (18:29 -0700)]
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>
15 years agoMerge updated git-gui and gitk that call each other
Junio C Hamano [Sun, 7 Sep 2008 01:06:39 +0000 (18:06 -0700)]
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

15 years agoMerge branch 'maint'
Junio C Hamano [Sat, 6 Sep 2008 23:47:32 +0000 (16:47 -0700)]
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

15 years agoUpdate draft release notes for 1.6.0.2
Junio C Hamano [Sat, 6 Sep 2008 23:18:31 +0000 (16:18 -0700)]
Update draft release notes for 1.6.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostash: refresh the index before deciding if the work tree is dirty
Junio C Hamano [Thu, 4 Sep 2008 09:41:22 +0000 (02:41 -0700)]
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>
15 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Sat, 6 Sep 2008 23:03:22 +0000 (16:03 -0700)]
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

15 years agofor-each-ref: `:short` format for `refname`
Bert Wesarg [Fri, 5 Sep 2008 21:16:23 +0000 (23:16 +0200)]
for-each-ref: `:short` format for `refname`

Tries to shorten the refname to a non-ambiguous name.

Szeder Gábor noticed that the git bash completion takes a
tremendous amount of time to strip leading components from
heads and tags refs (i.e. refs/heads, refs/tags, ...). He
proposed a new atom called 'refbasename' which removes at
most two leading components from the ref name.

I myself, proposed a more dynamic solution, which strips off
common leading components with the matched pattern.

But the current bash solution and both proposals suffer from
one mayor problem: ambiguous refs.

A ref is ambiguous, if it resolves to more than one full refs.
I.e. given the refs refs/heads/xyzzy and refs/tags/xyzzy. The
(short) ref xyzzy can point to both refs.

( Note: Its irrelevant whether the referenced objects are the
  same or not. )

This proposal solves this by checking for ambiguity of the
shorten ref name.

The shortening is done with the same rules for resolving refs
but in the reverse order. The short name is checked if it
resolves to a different ref.

To continue the above example, the output would be like this:

heads/xyzzy
xyzzy

So, if you want just tags, xyzzy is not ambiguous, because it
will resolve to a tag. If you need the heads you get a also
a non-ambiguous short form of the ref.

To integrate this new format into the bash completion to get
only non-ambiguous refs is beyond the scope of this patch.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobisect: remove "checkout_done" variable used when checking merge bases
Christian Couder [Sat, 6 Sep 2008 05:27:03 +0000 (07:27 +0200)]
bisect: remove "checkout_done" variable used when checking merge bases

Using return values from the following functions:

- check_merge_bases
- check_good_are_ancestors_of_bad

seems simpler.

While at it, let's add some comments to better document the above
functions.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: fix 'info' tests for unknown items
Thomas Rast [Fri, 29 Aug 2008 13:42:49 +0000 (15:42 +0200)]
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>
15 years agogit-svn: match SVN 1.5 behaviour of info' on unknown item
Thomas Rast [Fri, 29 Aug 2008 13:42:48 +0000 (15:42 +0200)]
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>
15 years agogit svn info: always quote URLs in 'info' output
Thomas Rast [Tue, 26 Aug 2008 19:32:37 +0000 (21:32 +0200)]
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>
15 years agogit svn info: make info relative to the current directory
Thomas Rast [Tue, 26 Aug 2008 19:32:36 +0000 (21:32 +0200)]
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>
15 years agogit svn info: tests: fix ptouch argument order in setup
Thomas Rast [Tue, 26 Aug 2008 19:32:35 +0000 (21:32 +0200)]
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>
15 years agogit svn info: tests: use test_cmp instead of git-diff
Thomas Rast [Tue, 26 Aug 2008 19:32:34 +0000 (21:32 +0200)]
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>
15 years agogit svn info: tests: do not use set -e
Thomas Rast [Tue, 26 Aug 2008 19:32:33 +0000 (21:32 +0200)]
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>
15 years agogit svn info: tests: let 'init' test run with SVN 1.5
Thomas Rast [Tue, 26 Aug 2008 19:32:32 +0000 (21:32 +0200)]
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>
15 years agogit svn: catch lack of upstream info for dcommit earlier
Thomas Rast [Sun, 31 Aug 2008 13:50:59 +0000 (15:50 +0200)]
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>
15 years agogit-svn: check error code of send_txstream
Eric Wong [Mon, 1 Sep 2008 02:45:07 +0000 (19:45 -0700)]
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>
15 years agogit-svn: Send deltas during commits
Florian Weimer [Sun, 31 Aug 2008 15:47:09 +0000 (17:47 +0200)]
git-svn: Send deltas during commits

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Introduce SVN::Git::Editor::_chg_file_get_blob
Florian Weimer [Sun, 31 Aug 2008 15:45:04 +0000 (17:45 +0200)]
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>
15 years agogit-svn: extract base blob in generate_diff
Florian Weimer [Sun, 31 Aug 2008 15:05:09 +0000 (17:05 +0200)]
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>
15 years agodiff --dirstat-by-file: count changed files, not lines
Heikki Orsila [Fri, 5 Sep 2008 19:27:35 +0000 (22:27 +0300)]
diff --dirstat-by-file: count changed files, not lines

This new option --dirstat-by-file is the same as --dirstat, but it
counts "impacted files" instead of "impacted lines" (lines that are
added or removed).

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomerge-recursive: get rid of virtual_id
Miklos Vajna [Fri, 5 Sep 2008 17:26:42 +0000 (19:26 +0200)]
merge-recursive: get rid of virtual_id

We now just leave the object->sha1 field of virtual commits 0{40} as it
is initialized, as a unique hash is not necessary in case of virtual
commits.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMention the fact that 'git annotate' is only for backward compatibility.
Junio C Hamano [Fri, 5 Sep 2008 07:29:51 +0000 (00:29 -0700)]
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>
15 years ago"blame -c" should be compatible with "annotate"
Junio C Hamano [Fri, 5 Sep 2008 07:57:35 +0000 (00:57 -0700)]
"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>
15 years agomerge-recursive: move current_{file,directory}_set to struct merge_options
Miklos Vajna [Wed, 3 Sep 2008 17:08:56 +0000 (19:08 +0200)]
merge-recursive: move current_{file,directory}_set to struct merge_options

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
15 years agomerge-recursive: move the global obuf to struct merge_options
Miklos Vajna [Wed, 3 Sep 2008 00:30:03 +0000 (02:30 +0200)]
merge-recursive: move the global obuf to struct merge_options

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
15 years agomerge-recursive: get rid of the index_only global variable
Miklos Vajna [Tue, 2 Sep 2008 21:53:47 +0000 (23:53 +0200)]
merge-recursive: get rid of the index_only global variable

struct merge_options already has a call_depth member, and index_only
global variable always equals to !!call_depth.

We always use index_only as a condition, so we can just
use call_depth instead of index_only.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
15 years agoMerge branch 'jc/maint-log-grep'
Junio C Hamano [Fri, 5 Sep 2008 05:30:44 +0000 (22:30 -0700)]
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

15 years agolog --author/--committer: really match only with name part
Junio C Hamano [Fri, 5 Sep 2008 05:15:02 +0000 (22:15 -0700)]
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>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Fri, 5 Sep 2008 04:53:06 +0000 (21:53 -0700)]
Merge branch 'maint'

* maint:
  git-gui: Fix diff parsing for lines starting with "--" or "++"

15 years agogit-gui: Fix diff parsing for lines starting with "--" or "++"
Shawn O. Pearce [Fri, 5 Sep 2008 04:46:56 +0000 (21:46 -0700)]
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>
15 years agogit-gui: Show special diffs for complex conflict cases.
Alexander Gavrilov [Sat, 30 Aug 2008 21:05:22 +0000 (01:05 +0400)]
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>
15 years agogit-gui: Make F5 reselect a diff, if an untracked file is selected.
Alexander Gavrilov [Sat, 30 Aug 2008 21:04:10 +0000 (01:04 +0400)]
git-gui: Make F5 reselect a diff, if an untracked file is selected.

If an untracked file is selected, F5 and other manual rescan synonyms
would try to select a tracked file instead. Also, clicking on an icon
in the unstaged changes list skips over untracked files, unless the
file clicked is untracked itself.

The objective is to make it easier to ignore untracked files showing
up in the Unstaged Changes list, and ensure that no modifications
to tracked objects are left unstaged.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Reimplement and enhance auto-selection of diffs.
Alexander Gavrilov [Sat, 30 Aug 2008 21:02:56 +0000 (01:02 +0400)]
git-gui: Reimplement and enhance auto-selection of diffs.

Generalize the next_diff system, and implement auto-reselection
for merge tool resolution and reshow_diff. Also add auto-selection
of diffs after rescan, if no diff is already selected.

New auto-select rules:

- Rescan auto-selects the first conflicting file, or if none
  a modified tracked file, if nothing was selected previously.
- Resolving a conflict auto-selects the nearest conflicting
  file, or nothing if everything is resolved.
- Staging the last remaining hunk auto-selects the nearest
  modified staged file.
- Staging a file through its icon auto-selects the nearest file.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>