Code

git.git
16 years agogit-commit: Disallow amend if it is going to produce an empty non-merge commit
Dmitry V. Levin [Wed, 12 Sep 2007 16:14:22 +0000 (20:14 +0400)]
git-commit: Disallow amend if it is going to produce an empty non-merge commit

Right now one can amend the last non-merge commit using a dirty index
and in the process maybe cause the last commit to have the same tree
as its parent.  In such a case one would want to discard the last commit
instead of amending it.

This reverts commit 8588452ceb78b1da17652ba03f9942ef740e07ea.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-send-email.perl: Add angle brackets to In-Reply-To if necessary
David Kastrup [Wed, 12 Sep 2007 05:53:45 +0000 (07:53 +0200)]
git-send-email.perl: Add angle brackets to In-Reply-To if necessary

Although message-id by defintion should have surrounding angle
brackets, there is no point forcing people to type them in.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix a test failure (t9500-*.sh) on cygwin
Ramsay Jones [Tue, 11 Sep 2007 18:16:51 +0000 (19:16 +0100)]
Fix a test failure (t9500-*.sh) on cygwin

On filesystems where it is appropriate to set core.filemode
to false, test 29 ("commitdiff(0): mode change") fails when
git-commit does not notice a file (execute) permission change.

A fix requires noting the new file execute permission in the
index with a "git update-index --chmod=+x", prior to the commit.
Add a function (note_chmod) which implements this idea, and
insert a call in each test that modifies the x permission.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Don't delete send on Windows as it doesn't exist
Shawn O. Pearce [Tue, 11 Sep 2007 17:37:45 +0000 (13:37 -0400)]
git-gui: Don't delete send on Windows as it doesn't exist

The Windows port of Tk does not have the send command so we
cannot delete it from our global namespace, but the Mac OS
X and X11 ports do have it.  Switching this delete attempt
into a catch makes send go away, or stay away.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMake --no-thin the default in git-push to save server resources
Shawn O. Pearce [Sun, 9 Sep 2007 23:38:11 +0000 (19:38 -0400)]
Make --no-thin the default in git-push to save server resources

1) pushes happen less often than fetches, so the bandwidth saving is
   much less visible in that case overall.

2) thin packs have to be complemented with missing delta bases to be
   valid, so many received thin packs will take more disk space.

3) the bother of repacking should be distributed amongst "clients"
   i.e. fetchers and pushers as much as possible, and not the server
   being fetched or pushed, to keep disk and CPU usage low on the
   server.

This is why a fetch should get thin packs but a push should not.

Both Nico and I have been assuming that --no-thin was the default
behavior of git-push ever since Nico introduced --fix-thin into the
index-pack process, which allowed fetch and receive-pack to avoid
exploding packfiles received during transfer.  This patch finally
makes it so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofix doc for --compression argument to pack-objects
Nicolas Pitre [Mon, 10 Sep 2007 04:15:29 +0000 (00:15 -0400)]
fix doc for --compression argument to pack-objects

Remove obsolete details (core.legacyheaders is always true now).

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-tag -s must fail if gpg cannot sign the tag.
Carlos Rica [Sun, 9 Sep 2007 00:39:29 +0000 (02:39 +0200)]
git-tag -s must fail if gpg cannot sign the tag.

Most of this patch code and message was written by Shawn O. Pearce.
I made some tests to know what the problem was, and then I changed
the code related with the SIGPIPE signal.

If the user has misconfigured `user.signingkey` in their .git/config
or just doesn't have any secret keys on their keyring and they ask
for a signed tag with `git tag -s` we better make sure the resulting
tag was actually signed by gpg.

Prior versions of builtin git-tag allowed this failure to slip
by without error as they were not checking the return value of
the finish_command() so they did not notice when gpg exited with
an error exit status.  They also did not fail if gpg produced an
empty output or if read_in_full received an error from the read
system call while trying to read the pipe back from gpg.

Finally, we did not actually honor any return value from the do_sign
function as it returns ssize_t but was being stored into an unsigned
long.  This caused the compiler to optimize out the die condition,
allowing git-tag to continue along and create the tag object.

However, when gpg gets a wrong username, it exits before any read was done
and then the writing process receives SIGPIPE and program is terminated.
By ignoring this signal, anyway, the function write_or_die gets EPIPE from
write_in_full and exits returning 0 to the system without a message.
Here we better call to write_in_full directly so we can fail
printing a message and return safely to the caller.

With these issues fixed `git-tag -s` will now fail to create the
tag and will report a non-zero exit status to its caller, thereby
allowing automated helper scripts to detect (and recover from)
failure if gpg is not working properly.

Proposed-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Trim trailing slashes from untracked submodule names
Shawn O. Pearce [Mon, 10 Sep 2007 00:38:05 +0000 (20:38 -0400)]
git-gui: Trim trailing slashes from untracked submodule names

Oddly enough `git ls-files --others` supplies us the name of an
untracked submodule by including the trailing slash but that
same git version will not accept the name with a trailing slash
through `git update-index --stdin`.  Stripping off that final
slash character before loading it into our file lists allows
git-gui to stage changes to submodules just like any other file.

This change should give git-gui users some basic submodule support,
but it is strictly at the plumbing level as we do not actually know
about calling the git-submodule porcelain that is a recent addition
to git 1.5.3.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Assume untracked directories are Git submodules
Shawn O. Pearce [Mon, 10 Sep 2007 00:13:10 +0000 (20:13 -0400)]
git-gui: Assume untracked directories are Git submodules

If `git ls-files --others` returned us the name of a directory then
it is because Git has decided that this directory itself contains a
valid Git repository and its files shouldn't be listed as untracked
for this repository.

In such a case we should label the object as a Git repository and
not just as a directory.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: handle "deleted symlink" diff marker
Michele Ballabio [Sun, 9 Sep 2007 19:09:07 +0000 (21:09 +0200)]
git-gui: handle "deleted symlink" diff marker

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: show unstaged symlinks in diff viewer
Michele Ballabio [Sun, 9 Sep 2007 19:04:45 +0000 (21:04 +0200)]
git-gui: show unstaged symlinks in diff viewer

git-gui has a minor problem with regards to symlinks that point
to directories.

git init
mkdir realdir
ln -s realdir linkdir
git gui

Now clicking on file names in the "unstaged changes" window,
there's a problem coming from the "linkdir" symlink: git-gui
complains with

error reading "file4": illegal operation on a directory

...even though git-gui can add that same symlink to the index just
fine.

This patch fix this by adding a check.

[sp: Minor fix to use {link} instead of "link" in condition
     and to only open the path if it is not a symlink.]

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-svn: understand grafts when doing dcommit
Eric Wong [Sat, 8 Sep 2007 23:33:08 +0000 (16:33 -0700)]
git-svn: understand grafts when doing dcommit

Use the rev-list --parents functionality to read the parents
of the commit.  cat-file only shows the raw object with the
original parents and doesn't take into account grafts; so
we'll rely on rev-list machinery for the smarts here.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff: don't squelch the new SHA1 in submodule diffs
Sven Verdoolaege [Sat, 8 Sep 2007 10:30:22 +0000 (12:30 +0200)]
git-diff: don't squelch the new SHA1 in submodule diffs

The code to squelch empty diffs introduced by commit
fb13227e089f22dc31a3b1624559153821056848 would inadvertently
populate filespec "two" of a submodule change using the uninitialized
(null) SHA1, thereby replacing the submodule SHA1 by 0{40} in the output.

This change teaches diffcore_skip_stat_unmatch to handle
submodule changes correctly.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Avoid use of libdir in Makefile
Shawn O. Pearce [Sun, 9 Sep 2007 03:05:43 +0000 (23:05 -0400)]
git-gui: Avoid use of libdir in Makefile

Dmitry V. Levin pointed out that on GNU linux libdir is often used
in Makefiles to mean "/usr/lib" or "/usr/lib64", a directory that
is meant to hold platform-specific binary files.  Using a different
libdir meaning here in git-gui's Makefile breaks idomatic expressions
like rpm specifile "make libdir=%_libdir".

Originally I asked that the git.git Makefile undefine libdir before
it calls git-gui's own Makefile but it turns out this is very hard
to do, if not impossible.  Renaming our libdir to gg_libdir resolves
this case with a minimum amount of fuss on our part.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Disable Tk send in all git-gui sessions
Shawn O. Pearce [Sun, 9 Sep 2007 03:47:00 +0000 (23:47 -0400)]
git-gui: Disable Tk send in all git-gui sessions

The Tk designers blessed us with the "send" command, which on X11
will allow anyone who can connect to your X server to evaluate any
Tcl code they desire within any running Tk process.  This is just
plain nuts.  If git-gui wants someone running Tcl code within it
then would ask someone to supply that Tcl code to it; waiting for
someone to drop any random Tcl code into us is not fantastic idea.

By renaming send to the empty name the procedure will be removed
from the global namespace and Tk will stop responding to random Tcl
evaluation requests sent through the X server.  Since there is no
facility to filter these requests it is unlikely that we will ever
consider enabling this command.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: lib/index.tcl: handle files with % in the filename properly
Gerrit Pape [Fri, 7 Sep 2007 17:16:59 +0000 (17:16 +0000)]
git-gui: lib/index.tcl: handle files with % in the filename properly

Steps to reproduce the bug:

 $ mkdir repo && cd repo && git init
 Initialized empty Git repository in .git/
 $ touch 'foo%3Fsuite'
 $ git-gui

Then click on the 'foo%3Fsuite' icon to include it in a changeset, a
popup comes with:
'Error: bad field specifier "F"'

Vincent Danjean noticed the problem and also suggested the fix, reported
through
 http://bugs.debian.org/441167

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-svn: fix "Malformed network data" with svn:// servers
Eric Wong [Fri, 7 Sep 2007 11:00:40 +0000 (04:00 -0700)]
git-svn: fix "Malformed network data" with svn:// servers

We have a workaround for the reparent function not working
correctly on the SVN native protocol servers.  This workaround
opens a new connection (SVN::Ra object) to the new
URL/directory.

Since libsvn appears limited to only supporting one connection
at a time, this workaround invalidates the Git::SVN::Ra object
that is $self inside gs_fetch_loop_common().  So we need to
restart that connection once all the fetching is done for each
loop iteration to be able to run get_log() successfully.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years ago(cvs|svn)import: Ask git-tag to overwrite old tags.
Michael Smith [Fri, 7 Sep 2007 21:35:07 +0000 (17:35 -0400)]
(cvs|svn)import: Ask git-tag to overwrite old tags.

If the tag was moved in CVS or SVN history, it will be moved in the
imported history as well. Tag history is not tracked.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation / grammer nit
Mike Ralphson [Fri, 7 Sep 2007 16:43:37 +0000 (17:43 +0100)]
Documentation / grammer nit

If we're counting, a smaller number is 'fewer' not 'less'

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoInclude a git-push example for creating a remote branch
Shawn O. Pearce [Thu, 6 Sep 2007 04:44:08 +0000 (00:44 -0400)]
Include a git-push example for creating a remote branch

Many users get confused when `git push origin master:foo` works
when foo already exists on the remote repository but are confused
when foo doesn't exist as a branch and this form does not create
the branch foo.

This new example highlights the trick of including refs/heads/
in front of the desired branch name to create a branch.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoCleanup unnecessary file modifications in t1400-update-ref
Shawn O. Pearce [Thu, 6 Sep 2007 02:15:21 +0000 (22:15 -0400)]
Cleanup unnecessary file modifications in t1400-update-ref

Kristian Høgsberg pointed out that the two file modifications
we were doing during the 'creating initial files' step are not even
used within the test suite.  This was actually confusing as we do
not even need these changes for the tests to pass.  All that really
matters here is the specific commit dates are used so that these
appear in the branch's reflog, and that the dates are different so
that the branch will update when asked and the reflog entry is
also updated.  There is no need for the file modification.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMakefile: Add cache-tree.h to the headers list
Dmitry V. Levin [Wed, 5 Sep 2007 23:22:51 +0000 (03:22 +0400)]
Makefile: Add cache-tree.h to the headers list

The dependency was missing.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDon't allow contrib/workdir/git-new-workdir to trash existing dirs
Shawn O. Pearce [Thu, 6 Sep 2007 03:33:41 +0000 (23:33 -0400)]
Don't allow contrib/workdir/git-new-workdir to trash existing dirs

Recently I found that doing a sequence like the following:

  git-new-workdir a b
  ...
  git-new-workdir a b

by accident will cause a (and now also b) to have an infinite cycle
in its refs directory.  This is caused by git-new-workdir trying
to create the "refs" symlink over again, only during the second
time it is being created within a's refs directory and is now also
pointing back at a's refs.

This causes confusion in git as suddenly branches are named things
like "refs/refs/refs/refs/refs/refs/refs/heads/foo" instead of the
more commonly accepted "refs/heads/foo".  Plenty of commands start
to see ambiguous ref names and others just take ages to compute.

git-clone has the same safety check, so git-new-workdir should
behave just like it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-apply: do not read past the end of buffer
Junio C Hamano [Thu, 6 Sep 2007 04:58:40 +0000 (21:58 -0700)]
git-apply: do not read past the end of buffer

When the preimage we are patching is shorter than what the patch
text expects, we tried to match the buffer contents at the
"original" line with the fragment in full, without checking we
have enough data to match in the preimage.  This caused the size
of a later memmove() to wrap around and attempt to scribble
almost the entire address space.  Not good.

The code that follows the part this patch touches tries to match
the fragment with line offsets.  Curiously, that code does not
have the problem --- it guards against reading past the end of
the preimage.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Properly set the state of "Stage/Unstage Hunk" action
Shawn O. Pearce [Sun, 2 Sep 2007 19:38:04 +0000 (15:38 -0400)]
git-gui: Properly set the state of "Stage/Unstage Hunk" action

Today I found yet another way for the "Stage Hunk" and "Unstage
Hunk" context menu actions to leave the wrong state enabled in
the UI.  The problem this time was that I connected the state
determination to the value of $::current_diff_side (the side the
diff is from).  When the user was last looking at a diff from the
index side and unstages everything the diff panel goes empty, but
the action stayed enabled as we always assumed unstaging was a
valid action.

This change moves the logic for determining when the action is
enabled away from the individual side selection, as they really
are two unrelated concepts.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix detaching current branch during checkout
Shawn O. Pearce [Sun, 2 Sep 2007 19:30:26 +0000 (15:30 -0400)]
git-gui: Fix detaching current branch during checkout

If the user tried to detach their HEAD while keeping the working
directory on the same commit we actually did not completely do
a detach operation internally.  The problem was caused by git-gui
not forcing the HEAD symbolic ref to be updated to a SHA-1 hash
when we were not switching revisions.  Now we update the HEAD ref
if we aren't currently detached or the hashes don't match.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Correct starting of git-remote to handle -w option
Shawn O. Pearce [Sun, 2 Sep 2007 19:19:07 +0000 (15:19 -0400)]
git-gui: Correct starting of git-remote to handle -w option

Current versions of git-remote apparently are passing the -w option
to Perl as part of the shbang line:

  #!/usr/bin/perl -w

this caused a problem in git-gui and gave the user a Tcl error with
the message: "git-remote not supported: #!/usr/bin/perl -w".

The fix for this is to treat the shbang line as a Tcl list and look
at the first element only for guessing the executable name.  Once
we know the executable name we use the remaining elements (if any
exist) as arguments to the executable, before the script filename.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoGIT 1.5.3.1: obsolete git-p4 in RPM spec file. v1.5.3.1
Junio C Hamano [Sun, 2 Sep 2007 22:16:44 +0000 (15:16 -0700)]
GIT 1.5.3.1: obsolete git-p4 in RPM spec file.

HPA noticed that yum does not like the newer git RPM set; it turns out
that we do not ship git-p4 anymore but existing installations do not
realize the package is gone if we do not tell anything about it.

David Kastrup suggests using Obsoletes in the spec file of the new
RPM to replace the old package, so here is a try.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTypofix: 1.5.3 release notes
Junio C Hamano [Sun, 2 Sep 2007 22:03:26 +0000 (15:03 -0700)]
Typofix: 1.5.3 release notes

16 years agoGIT 1.5.3 v1.5.3
Junio C Hamano [Sun, 2 Sep 2007 07:00:00 +0000 (00:00 -0700)]
GIT 1.5.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jp/send-email-cc'
Junio C Hamano [Sat, 1 Sep 2007 20:15:27 +0000 (13:15 -0700)]
Merge branch 'jp/send-email-cc'

* jp/send-email-cc:
  git-send-email --cc-cmd

16 years agoMention -m as an abbreviation for --merge
Robin Rosenberg [Sat, 1 Sep 2007 12:11:10 +0000 (14:11 +0200)]
Mention -m as an abbreviation for --merge

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate my contact address as the maintainer.
Junio C Hamano [Sat, 1 Sep 2007 11:09:51 +0000 (04:09 -0700)]
Update my contact address as the maintainer.

16 years agoDocumentation: minor AsciiDoc mark-up fixes.
Junio C Hamano [Sat, 1 Sep 2007 11:01:54 +0000 (04:01 -0700)]
Documentation: minor AsciiDoc mark-up fixes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoURL: allow port specification in ssh:// URLs
Luben Tuikov [Sat, 1 Sep 2007 09:36:31 +0000 (02:36 -0700)]
URL: allow port specification in ssh:// URLs

Allow port specification in ssh:// URLs in the
usual notation:

ssh://[user@]host.domain[:<port>]/<path>

This allows git to be used over ssh-tunneling
networks.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAvoid one-or-more (\+) non BRE in sed scripts.
Junio C Hamano [Sat, 1 Sep 2007 09:17:28 +0000 (02:17 -0700)]
Avoid one-or-more (\+) non BRE in sed scripts.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -m: Fix incorrect short-logs of already applied commits.
Johannes Sixt [Sat, 1 Sep 2007 07:25:27 +0000 (09:25 +0200)]
rebase -m: Fix incorrect short-logs of already applied commits.

When a topic branch is rebased, some of whose commits are already
cherry-picked upstream:

    o--X--A--B--Y    <- master
     \
      A--B--Z        <- topic

then 'git rebase -m master' would report:

    Already applied: 0001 Y
    Already applied: 0002 Y

With this fix it reports the expected:

    Already applied: 0001 A
    Already applied: 0002 B

As an added bonus, this change also avoids 'echo' of a commit message,
which might contain escapements.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff: resurrect the traditional empty "diff --git" behaviour
Junio C Hamano [Fri, 31 Aug 2007 20:13:42 +0000 (13:13 -0700)]
git-diff: resurrect the traditional empty "diff --git" behaviour

The warning message to suggest "Consider running git-status" from
"git-diff" that we experimented with during the 1.5.3 cycle turns
out to be a bad idea.  It robbed cache-dirty information from people
who valued it, while still asking users to run "update-index --refresh".
It was hoped that the new behaviour would at least have some educational
value, but not showing the cache-dirty paths like before meant that the
user would not even know easily which paths were cache-dirty, and it
made the need to refresh the index look like even more unnecessary chore.

This commit reinstates the traditional behaviour, but with a twist.

By default, the empty "diff --git" output is totally squelched out
from "git diff" output.  At the end of the command, it automatically
runs "update-index --refresh" as needed, without even bothering the
user.  In other words, people who do not care about the cache-dirtyness
do not even have to see the warning.

The traditional behaviour to see the stat-dirty output and to bypassing
the overhead of content comparison can be specified by setting the
configuration variable diff.autorefreshindex to false.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-tag: Fix -l option to use better shell style globs.
Carlos Rica [Sat, 1 Sep 2007 05:10:09 +0000 (07:10 +0200)]
git-tag: Fix -l option to use better shell style globs.

This patch removes certain behaviour of "git tag -l foo", currently
listing every tag name having "foo" as a substring.  The same
thing now could be achieved doing "git tag -l '*foo*'".

This feature was added recently when git-tag.sh got the -n option
for showing tag annotations, because that commit also replaced the
old "grep pattern" behaviour with a more preferable "shell pattern"
behaviour (although slightly modified as you can see).
Thus, the following builtin-tag.c implemented it in order to
ensure that tests were passing unchanged with both programs.

Since common "shell patterns" match names with a given substring
_only_ when * is inserted before and after (as in "*substring*"), and
the "plain" behaviour cannot be achieved easily with the current
implementation, this is mostly the right thing to do, in order to
make it more flexible and consistent.

Tests for "git tag" were also changed to reflect this.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: fix dcommit clobbering upstream when committing multiple changes
Eric Wong [Sat, 1 Sep 2007 01:16:12 +0000 (18:16 -0700)]
git-svn: fix dcommit clobbering upstream when committing multiple changes

Although dcommit could detect if the first commit in the series
would conflict with the HEAD revision in SVN, it could not
detect conflicts in further commits it made.

Now we rebase each uncommitted change after each revision is
committed to SVN to ensure that we are up-to-date.  git-rebase
will bail out on conflict errors if our next change cannot be
applied and committed to SVN cleanly, preventing accidental
clobbering of changes on the SVN-side.

--no-rebase users will have trouble with this, and are thus
warned if they are committing more than one commit.  Fixing this
for (hopefully uncommon) --no-rebase users would be more complex
and will probably happen at a later date.

Thanks to David Watson for finding this and the original test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Protect against "diff.color = true".
Junio C Hamano [Fri, 31 Aug 2007 21:29:49 +0000 (14:29 -0700)]
git-svn: Protect against "diff.color = true".

If the configuration of the user has "diff.color = true", the
output from "log" we invoke internally added color codes, which
broke the parser.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agofilter-branch: introduce convenience function "skip_commit"
Johannes Schindelin [Fri, 31 Aug 2007 19:06:27 +0000 (20:06 +0100)]
filter-branch: introduce convenience function "skip_commit"

With this function, a commit filter can leave out unwanted commits
(such as temporary commits).  It does _not_ undo the changeset
corresponding to that commit, but it _skips_ the revision.  IOW
no tree object is changed by this.

If you like to commit early and often, but want to filter out all
intermediate commits, marked by "@@@" in the commit message, you can
now do this with

git filter-branch --commit-filter '
if git cat-file commit $GIT_COMMIT | grep '@@@' > /dev/null;
then
skip_commit "$@";
else
git commit-tree "$@";
fi' newbranch

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: provide the convenience functions also for commit filters
Johannes Schindelin [Fri, 31 Aug 2007 19:05:36 +0000 (20:05 +0100)]
filter-branch: provide the convenience functions also for commit filters

Move the convenience functions to the top of git-filter-branch.sh, and
return from the script when the environment variable SOURCE_FUNCTIONS is
set.

By sourcing git-filter-branch with that variable set automatically, all
commit filters may access the convenience functions like "map".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: mention the option to split commits in the man page
Johannes Schindelin [Fri, 31 Aug 2007 17:10:21 +0000 (18:10 +0100)]
rebase -i: mention the option to split commits in the man page

The interactive mode of rebase can be used to split commits.  Tell the
interested parties about it, with a dedicated section in the man page.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: fix remnants of old syntax in documentation
Johannes Schindelin [Fri, 31 Aug 2007 16:42:33 +0000 (17:42 +0100)]
filter-branch: fix remnants of old syntax in documentation

Some time ago, filter-branch's syntax changed so that more than one
ref can be rewritten at the same time.  This involved the removal of
the ref name for the result; instead, the refs are rewritten in-place.

This updates the last leftovers in the documentation to reflect the
new behavior.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach bash about completing arguments for git-tag
Shawn O. Pearce [Sat, 1 Sep 2007 03:47:01 +0000 (23:47 -0400)]
Teach bash about completing arguments for git-tag

Lately I have been doing a lot of calls to `git tag -d` and also to
`git tag -v`.  In both such cases being able to complete the names
of existing tags saves the fingers some typing effort.  We now look
for the -d or -v option to git-tag in the bash completion support
and offer up existing tag names as possible choices for these.

When creating a new tag we now also offer bash completion support
for the second argument to git-tag (the object to be tagged) as this
can often be a specific existing branch name and is not necessarily
the current HEAD.

If the -f option is being used to recreate an existing tag we now
also offer completion support on the existing tag names for the
first argument of git-tag, helping to the user to reselect the
prior tag name that they are trying to replace.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoHopefully the final update to draft release notes for 1.5.3.
Junio C Hamano [Fri, 31 Aug 2007 07:35:36 +0000 (00:35 -0700)]
Hopefully the final update to draft release notes for 1.5.3.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake "git-log --" without paths behave the same as "git-log" without --
Junio C Hamano [Fri, 31 Aug 2007 05:58:26 +0000 (22:58 -0700)]
Make "git-log --" without paths behave the same as "git-log" without --

"git log" family of commands, even when run from a subdirectory,
do not limit the revision range with the current directory as
the path limiter, but with double-dash without any paths after
it, i.e. "git log --" do so.  It was a mistake to have a
difference between "git log --" and "git log" introduced in
commit ae563542bf10fa8c33abd2a354e4b28aca4264d7 (First cut at
libifying revlist generation).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-init: autodetect core.symlinks
Junio C Hamano [Fri, 31 Aug 2007 07:25:04 +0000 (00:25 -0700)]
git-init: autodetect core.symlinks

We already autodetect if filemode is reliable on the filesystem
to deal with VFAT and friends.  Do the same for symbolic link
support.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake git-archimport log entries more consistent
Miles Bader [Thu, 30 Aug 2007 01:56:56 +0000 (21:56 -0400)]
Make git-archimport log entries more consistent

When appending the "git-archimport-id:" line to the end of log entries,
git-archimport would use two blank lines as a separator when there was no
body in the arch log (only a Summary: line), and zero blank lines when there
was a body (making it hard to see the break between the actual log message
and the git-archimport-id: line).

This patch makes git-archimport generate one blank line as a separator in all
cases.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofix same sized delta logic
Nicolas Pitre [Thu, 30 Aug 2007 01:17:17 +0000 (21:17 -0400)]
fix same sized delta logic

The code favoring shallower deltas when size is equal was triggered
only when previous delta was also cached.  There should be no relation
between cached deltas and same sized deltas.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: make sure orig_namespace ends with a single slash.
Junio C Hamano [Fri, 31 Aug 2007 02:17:42 +0000 (19:17 -0700)]
filter-branch: make sure orig_namespace ends with a single slash.

Later in a loop any existing ref whose path begins with it is
removed.  It would be a disaster if you allowed it to say refs/head
for example.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-filter-branch: document --original option
Giuseppe Bilotta [Thu, 30 Aug 2007 17:10:42 +0000 (19:10 +0200)]
git-filter-branch: document --original option

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-filter-branch: more detailed USAGE
Giuseppe Bilotta [Thu, 30 Aug 2007 17:10:41 +0000 (19:10 +0200)]
git-filter-branch: more detailed USAGE

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMakefile: do not allow gnu make to remove test-*.o files
Junio C Hamano [Fri, 31 Aug 2007 02:14:31 +0000 (19:14 -0700)]
Makefile: do not allow gnu make to remove test-*.o files

It appears parallel build (-j) gets confused.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTemporary fix for stack smashing in mailinfo
Alex Riesen [Thu, 30 Aug 2007 21:48:24 +0000 (23:48 +0200)]
Temporary fix for stack smashing in mailinfo

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFixing comment in merge strategies
Tom Clarke [Thu, 30 Aug 2007 21:12:44 +0000 (23:12 +0200)]
Fixing comment in merge strategies

Comments in both these strategies refer to the wrong number
of remotes

Signed-off-by: Tom Clarke <tom@u2i.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agols-files --error-unmatch: do not barf if the same pattern is given twice.
Junio C Hamano [Thu, 30 Aug 2007 06:12:38 +0000 (23:12 -0700)]
ls-files --error-unmatch: do not barf if the same pattern is given twice.

This is most visible when you do "git commit Makefile Makefile"; it
may be a stupid request, but that is not a reason to fail the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Wed, 29 Aug 2007 20:27:10 +0000 (13:27 -0700)]
Merge branch 'master' of git://git./gitk/gitk

* 'master' of git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix bug causing undefined variable error when cherry-picking

16 years agocompletion: also complete git-log's --left-right and --cherry-pick option
Johannes Schindelin [Wed, 29 Aug 2007 14:15:34 +0000 (15:15 +0100)]
completion: also complete git-log's --left-right and --cherry-pick option

Both --left-right and --cherry-pick are particularly long to type, so
help the user there.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitk: Fix bug causing undefined variable error when cherry-picking
Paul Mackerras [Wed, 29 Aug 2007 12:41:34 +0000 (22:41 +1000)]
gitk: Fix bug causing undefined variable error when cherry-picking

When "Show nearby tags" is turned off and the user did a cherry-pick,
we were trying to access variables relating to the descendent/ancestor
tag & head computations in addnewchild though they hadn't been set.
This makes sure we don't do that.  Reported by Johannes Sixt.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogit-daemon(1): assorted improvements.
Junio C Hamano [Wed, 29 Aug 2007 10:32:12 +0000 (03:32 -0700)]
git-daemon(1): assorted improvements.

Jari Aalto noticed a handful places in git-daemon documentation
that need to be improved.

 * --inetd makes --pid-file to be ignored, in addition to --user
   and --group

 * receive-pack service was not described at all.  We should, if
   only to warn about the security implications of it.

 * There was no example of per repository configuration.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.3-rc7 v1.5.3-rc7
Junio C Hamano [Wed, 29 Aug 2007 07:11:27 +0000 (00:11 -0700)]
GIT 1.5.3-rc7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn.txt: fix an obvious misspelling.
David Kastrup [Fri, 17 Aug 2007 15:48:53 +0000 (17:48 +0200)]
git-svn.txt: fix an obvious misspelling.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Added colors for dark background
David Kågedal [Mon, 27 Aug 2007 09:50:12 +0000 (11:50 +0200)]
git.el: Added colors for dark background

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoformat-patch documentation: reword to hint "--root <one-commit>" more clearly
Junio C Hamano [Wed, 29 Aug 2007 04:58:53 +0000 (21:58 -0700)]
format-patch documentation: reword to hint "--root <one-commit>" more clearly

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jc/logsemantics'
Junio C Hamano [Wed, 29 Aug 2007 04:49:01 +0000 (21:49 -0700)]
Merge branch 'jc/logsemantics'

* jc/logsemantics:
  "format-patch --root rev" is the way to show everything.
  Porcelain level "log" family should recurse when diffing.

16 years agoDocumentation/git-diff: A..B and A...B cannot take tree-ishes
Junio C Hamano [Wed, 29 Aug 2007 04:47:08 +0000 (21:47 -0700)]
Documentation/git-diff: A..B and A...B cannot take tree-ishes

As pointed out by Linus, these notations require the endpoints
given by the end user to be commits.  Clarify.

Also, three-dots in AsciiDoc are turned into ellipses unless
quoted with bq.  Be careful.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-add: Make the filename globbing note a bit clearer
Petr Baudis [Tue, 28 Aug 2007 22:41:28 +0000 (00:41 +0200)]
git-add: Make the filename globbing note a bit clearer

I think the trick with Git-side filename globbing is important and perhaps
not that well known.  Clarify a bit in git-add documentation what it means.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-add: Make the "tried to add ignored file" error message less confusing
Petr Baudis [Tue, 28 Aug 2007 22:41:23 +0000 (00:41 +0200)]
git-add: Make the "tried to add ignored file" error message less confusing

Currently the error message seems to imply (at least to me) that only
the listed files were withheld and the rest of the files was added to the
index, even though that's obviously not the case.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Fix escaping HTML of project owner in 'projects_list' and
Jakub Narebski [Tue, 28 Aug 2007 14:05:43 +0000 (16:05 +0200)]
gitweb: Fix escaping HTML of project owner in 'projects_list' and
'summary' views

This for example allows to put email address in the project owner
field in the projects index file (when $projects_list points to
a file, and not to a directory), in the form of:

path/to/repo.git Random+J+Developer+<random@developer.example.org>

Noticed-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years ago"format-patch --root rev" is the way to show everything.
Junio C Hamano [Tue, 28 Aug 2007 07:38:48 +0000 (00:38 -0700)]
"format-patch --root rev" is the way to show everything.

We used to trigger the special case "things not in origin"
semantics only when one and only one positive ref is given, and
no number (e.g. "git format-patch -4 origin") was specified, and
used the general revision range semantics for everything else.

This narrows the special case a bit more, by making:

git format-patch --root this_version

to show everything that leads to the named commit.

More importantly, document the two different semantics better.
The generic revision range semantics came later and bolted on
without being clearly documented.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoPorcelain level "log" family should recurse when diffing.
Junio C Hamano [Mon, 27 Aug 2007 08:33:49 +0000 (01:33 -0700)]
Porcelain level "log" family should recurse when diffing.

Most notably, "git log --name-status" stopped at top level
directory changes without "-r" option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-merge: do up-to-date check also for all strategies
Junio C Hamano [Thu, 16 Aug 2007 06:19:55 +0000 (23:19 -0700)]
git-merge: do up-to-date check also for all strategies

This clarifies the logic to omit fast-forward check and omit
trivial merge before running the specified strategy.

The "index_merge" variable started out as a flag to say "do not
do anything clever", but when recursive was changed to skip the
trivial merge, the semantics were changed and the variable alone
does not make sense anymore.

This splits the variable into two, allow_fast_forward (which is
almost always true, and avoids making a merge commit when the
other commit is a descendant of our branch, but is set to false
for ours and subtree) and allow_trivial_merge (which is false
for ours, recursive and subtree).

Unlike the earlier implementation, the "ours" strategy allows an
up-to-date condition.  When we are up-to-date, the result will
be our commit, and by definition, we will have our tree as the
result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit --bare cmd: do not unconditionally nuke GIT_DIR
Junio C Hamano [Tue, 28 Aug 2007 05:41:23 +0000 (22:41 -0700)]
git --bare cmd: do not unconditionally nuke GIT_DIR

"GIT_DIR=some.where git --bare cmd" and worse yet
"git --git-dir=some.where --bare cmd" were very confusing.  They
both ignored git-dir specified, and instead made $cwd as GIT_DIR.

This changes --bare not to override existing GIT_DIR.

This has been like this for a long time.  Let's hope nobody sane
relied on this insane behaviour.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix initialization of a bare repository
Junio C Hamano [Mon, 27 Aug 2007 07:58:06 +0000 (00:58 -0700)]
Fix initialization of a bare repository

Here is my attempt to fix this with a minimally intrusive patch.

 * As "git --bare init" cannot tell if it was called with --bare or
   just "GIT_DIR=. git init", I added an explicit assignment of
   is_bare_repository_cfg on the codepath for "git --bare".

 * GIT_WORK_TREE alone without GIT_DIR does not make any sense,
   nor GIT_WORK_TREE with an explicit "git --bare".  Catch that
   mistake.  It might make sense to move this check to "git.c"
   side as well, but I tried to shoot for the minimum change for
   now.

 * Some scripts, especially from the olden days, rely on
   traditional GIT_DIR behaviour in "git init".  Namely, these
   are some notable patterns:

   (create a bare repository)
   - mkdir some.git && cd some.git && GIT_DIR=. git init
   - mkdir some.git && cd some.git && git --bare init

   (create a non-bare repository)
   - mkdir .git && GIT_DIR=.git git init
   - mkdir .git && GIT_DIR=`pwd`/.git git init

This comes with a new test script and also passes the existing
test suite, but there may be cases that are still broken with
the current tip of master and this patch does not yet fix.  I'd
appreciate help in straightening this mess out.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoname-rev: Fix non-shortest description
Johannes Schindelin [Mon, 27 Aug 2007 11:37:33 +0000 (12:37 +0100)]
name-rev: Fix non-shortest description

Uwe Kleine-König noticed that under certain circumstances, name-rev
picked a non-optimal tag.  Jeff King analyzed that name-rev only
takes into account the number of merge traversals, and then the
_last_ number in the description.

As an easy way to fix it, use a weighting factor for merge traversals:
A merge traversal is now made 65535 times more expensive than a
first-parent traversal.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDescribe two-dot and three-dot notation for diff endpoints.
Mike Hommey [Tue, 28 Aug 2007 05:05:19 +0000 (22:05 -0700)]
Describe two-dot and three-dot notation for diff endpoints.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-tag(1): Remove duplicate text
Jari Aalto [Mon, 27 Aug 2007 05:54:32 +0000 (08:54 +0300)]
git-tag(1): Remove duplicate text

Options -d, -l, -v have already been explained in OPTIONS below.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Lift any characters restriction on searched strings
Petr Baudis [Sat, 25 Aug 2007 22:18:47 +0000 (00:18 +0200)]
gitweb: Lift any characters restriction on searched strings

Everything is already fully quoted along the way so I believe this to be
unnecessary at this point. It would pose trouble for regexp searches.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRelNotes draft for 1.5.3 update.
Junio C Hamano [Mon, 27 Aug 2007 00:36:10 +0000 (17:36 -0700)]
RelNotes draft for 1.5.3 update.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'master' of git://repo.or.cz/git-gui
Junio C Hamano [Mon, 27 Aug 2007 00:29:26 +0000 (17:29 -0700)]
Merge branch 'master' of git://repo.or.cz/git-gui

* 'master' of git://repo.or.cz/git-gui:
  git-gui: Correct 'git gui blame' in a subdirectory
  git-gui: Do not offer to stage three-way diff hunks into the index
  git-gui: Refactor diff pane popup support for future improvements
  git-gui: Fix "unoptimized loading" to not cause git-gui to crash
  git-gui: Paper bag fix "Stage Hunk For Commit" in diff context menu
  git-gui: Allow git-merge to use branch names in conflict markers
  git-gui: Fix window manager problems on ion3

16 years agoWhen nothing to git-commit, honor the git-status color setting.
Brian Hetro [Sun, 26 Aug 2007 18:35:26 +0000 (14:35 -0400)]
When nothing to git-commit, honor the git-status color setting.

Instead of disabling color all of the time during a git-commit, allow
the user's config preference in the situation where there is nothing
to commit.  In this situation, the status is printed to the terminal
and not sent to COMMIT_EDITMSG, so honoring the status color setting
is expected.

Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Fix searchbox positioning
Petr Baudis [Sun, 26 Aug 2007 19:31:32 +0000 (21:31 +0200)]
gitweb: Fix searchbox positioning

Currently, searchbox is CSS'd to have position: absolute, which has the
unfortunate consequence that if the viewport is too small and can't fit
into the page width together with the navbar, it gets overlapped and part
of the navbar gets obscured. This makes searchbox float: right instead,
thus the navbar simply gets wrapped.

Discovered and fix pointed out by Michael Olson <mwolson@gnu.org>.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'master' of git://linux-nfs.org/~bfields/git
Junio C Hamano [Sun, 26 Aug 2007 20:18:12 +0000 (13:18 -0700)]
Merge branch 'master' of git://linux-nfs.org/~bfields/git

* 'master' of git://linux-nfs.org/~bfields/git:
  Documentation/user-manual.txt: fix a few omissions of gitlink commands.
  user-manual: fix incorrect header level
  user-manual: use pithier example commit
  user-manual: introduce the word "commit" earlier
  user-manual: minor editing for conciseness
  user-manual: edit "ignoring files" for conciseness
  Documentation/user-manual.txt: fix a few omissions of gitlink commands.

16 years agoMerge branch 'maint'
J. Bruce Fields [Sun, 26 Aug 2007 14:36:38 +0000 (10:36 -0400)]
Merge branch 'maint'

Conflicts:

Documentation/user-manual.txt

16 years agoDocumentation/user-manual.txt: fix a few omissions of gitlink commands.
David Kastrup [Wed, 8 Aug 2007 15:34:28 +0000 (17:34 +0200)]
Documentation/user-manual.txt: fix a few omissions of gitlink commands.

Signed-off-by: David Kastrup <dak@gnu.org>
16 years agouser-manual: fix incorrect header level
J. Bruce Fields [Mon, 20 Aug 2007 15:12:09 +0000 (11:12 -0400)]
user-manual: fix incorrect header level

This section is a subsection of the "Examples" section.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: use pithier example commit
J. Bruce Fields [Sun, 19 Aug 2007 15:14:21 +0000 (11:14 -0400)]
user-manual: use pithier example commit

Actually, we should have a competition for the favorite example commit.
Criteria:

- length: one-line changes with one-line comments preferred,
  and no long lines
- significance/memorability
- comic value

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: introduce the word "commit" earlier
J. Bruce Fields [Sun, 19 Aug 2007 02:16:24 +0000 (22:16 -0400)]
user-manual: introduce the word "commit" earlier

Use the word "commit" as a synonym for "version" from the start.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: minor editing for conciseness
J. Bruce Fields [Wed, 6 Jun 2007 22:41:43 +0000 (18:41 -0400)]
user-manual: minor editing for conciseness

Just cutting out a few unnecessary words.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: edit "ignoring files" for conciseness
J. Bruce Fields [Fri, 25 May 2007 00:28:14 +0000 (20:28 -0400)]
user-manual: edit "ignoring files" for conciseness

The immediate motivation for writing this section was to explain the
various places ignore patterns could be used.  However, I still think
.gitignore is the case most people will want to learn about first.  It
also makes it a bit more concrete to introduce ignore patterns in the
context of .gitignore first.  And the existance of gitignore(5) relieves
the pressure to explain it all here.

So, stick to the .gitignore example, with only a brief mention of the
others, explain the syntax only by example, and leave the rest to
gitignore(5).

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Johan Herland <johan@herland.net>
16 years agoDocumentation/user-manual.txt: fix a few omissions of gitlink commands.
David Kastrup [Wed, 8 Aug 2007 15:34:28 +0000 (17:34 +0200)]
Documentation/user-manual.txt: fix a few omissions of gitlink commands.

Signed-off-by: David Kastrup <dak@gnu.org>
16 years agoMake usage documentation for git-add consistent.
Brian Hetro [Sun, 26 Aug 2007 03:20:06 +0000 (23:20 -0400)]
Make usage documentation for git-add consistent.

The usage string for the executable was missing --refresh.  In
addition, the documentation referred to "file", but the usage string
referred to "filepattern".  Updated the documentation to
"filepattern", as git-add does handle patterns.

Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake usage documentation for git-am consistent.
Brian Hetro [Sun, 26 Aug 2007 03:19:38 +0000 (23:19 -0400)]
Make usage documentation for git-am consistent.

The usage information in git-am.sh now matches that of the
documentation.

Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDon't segfault if we failed to inflate a packed delta
Shawn O. Pearce [Sat, 25 Aug 2007 07:26:04 +0000 (03:26 -0400)]
Don't segfault if we failed to inflate a packed delta

Under some types of packfile corruption the zlib stream holding the
data for a delta within a packfile may fail to inflate, due to say
a CRC failure within the compressed data itself.  When this occurs
the unpack_compressed_entry function will return NULL as a signal to
the caller that the data is not available.  Unfortunately we then
tried to use that NULL as though it referenced a memory location
where a delta was stored and tried to apply it to the delta base.
Loading a byte from the NULL address typically causes a SIGSEGV.

cate on #git noticed this failure in `git fsck --full` where the
call to verify_pack() first noticed that the packfile was corrupt
by finding that the packfile's SHA-1 did not match the raw data of
the file.  After finding this fsck went ahead and tried to verify
every object within the packfile, even though the packfile was
already known to be bad.  If we are going to shovel bad data at
the delta unpacking code, we better handle it correctly.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: check return value from read_sha1_file()
Junio C Hamano [Sat, 25 Aug 2007 08:26:47 +0000 (01:26 -0700)]
pack-objects: check return value from read_sha1_file()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoblame: check return value from read_sha1_file()
Junio C Hamano [Sat, 25 Aug 2007 08:26:20 +0000 (01:26 -0700)]
blame: check return value from read_sha1_file()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Correct 'git gui blame' in a subdirectory gitgui-0.8.2
Shawn O. Pearce [Sat, 25 Aug 2007 03:15:50 +0000 (23:15 -0400)]
git-gui: Correct 'git gui blame' in a subdirectory

David Kastrup pointed out that the following sequence was not
working as we had intended:

  $ cd lib
  $ git gui blame console.tcl
  fatal: cannot stat path lib/console.tcl: No such file or directory

The problem here was we disabled the chdir to the root of the
working tree when we are running with a "bare allowed" feature
such as blame or browser, but we still kept the prefix we found via
`git rev-parse --show-prefix`.  This caused us to try and look for
the file "console.tcl" within the subdirectory but also include
the subdirectory's own path from the root of the working tree.
This is unlikely to succeed, unless the user just happened to have
a "lib/lib/console.tcl" file in the repository, in which case we
would produce the wrong result.

In the case of a bare repository we shouldn't get back a value from
`rev-parse --show-prefix`, so really $_prefix should only be set
to the non-empty string if we are in a working tree and we are in a
subdirectory of that working tree.  If this is true we really want
to always be at the top level of the working tree, as all paths are
accessed as though they were relative to the top of the working tree.
Converting $_prefix to a ../ sequence is a fairly simple approach
to moving up the requisite levels.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when running git...
Simon Hausmann [Fri, 24 Aug 2007 15:46:16 +0000 (17:46 +0200)]
git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when running git-p4 sync the first time after a git clone.

Don't create the p4/HEAD symbolic ref if p4/master doesn't exist yet.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>