Code

git.git
17 years agoAvoid invoking diff drivers during git-stash
Shawn O. Pearce [Fri, 19 Oct 2007 01:28:43 +0000 (21:28 -0400)]
Avoid invoking diff drivers during git-stash

git-stash needs to restrict itself to plumbing when running automated
diffs as part of its operation as the user may have configured a
custom diff driver that opens an interactive UI for certain/all
files.  Doing that during scripted actions is very unfriendly to
the end-user and may cause git-stash to fail to work.

Reported by Johannes Sixt

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoattr: fix segfault in gitattributes parsing code
Steffen Prohaska [Thu, 18 Oct 2007 20:02:35 +0000 (22:02 +0200)]
attr: fix segfault in gitattributes parsing code

git may segfault if gitattributes contains an invalid
entry. A test is added to t0020 that triggers the segfault.
The parsing code is fixed to avoid the crash.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoDefine NI_MAXSERV if not defined by operating system
Patrick Welche [Thu, 18 Oct 2007 17:17:39 +0000 (18:17 +0100)]
Define NI_MAXSERV if not defined by operating system

I found I needed NI_MAXSERV as it is defined in netdb.h, which is
not included by daemon.c.  Rather than including the whole header
we can define a reasonable fallback value.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoEnsure we add directories in the correct order
Alex Bennee [Thu, 18 Oct 2007 16:15:44 +0000 (17:15 +0100)]
Ensure we add directories in the correct order

CVS gets understandably upset if you try and add a subdirectory
before it's parent directory. This patch fixes that.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoAvoid scary errors about tagged trees/blobs during git-fetch
Linus Torvalds [Thu, 18 Oct 2007 23:24:47 +0000 (16:24 -0700)]
Avoid scary errors about tagged trees/blobs during git-fetch

Ok, what is going on is:

 - append_fetch_head() looks up the SHA1 for all heads (including tags):

        if (get_sha1(head, sha1))
                return error("Not a valid object name: %s", head);

 - it then wants to check if it's a candidate for merging (because
   fetching also does the whole "list which heads to merge" in case
   it is going to be part of a "pull"):

        commit = lookup_commit_reference(sha1);
        if (!commit)
                not_for_merge = 1;

 - and that "lookup_commit_reference()" is just very vocal about the
   case where it fails. It really shouldn't be, and it shouldn't
   affect the actual end result, but that basically explains why
   you get that scary warning.

In short, the warning is just bogus, and should be harmless, but
I agree that it's ugly. I think the appended patch should fix it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoYet more 1.5.3.5 fixes mentioned in release notes
Shawn O. Pearce [Thu, 18 Oct 2007 07:11:03 +0000 (03:11 -0400)]
Yet more 1.5.3.5 fixes mentioned in release notes

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agocvsserver: Use exit 1 instead of die when req_Root fails.
Brian Gernhardt [Wed, 17 Oct 2007 14:05:47 +0000 (10:05 -0400)]
cvsserver: Use exit 1 instead of die when req_Root fails.

This was causing test failures because die was exiting 255.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-blame shouldn't crash if run in an unmerged tree
Linus Torvalds [Thu, 18 Oct 2007 06:31:30 +0000 (02:31 -0400)]
git-blame shouldn't crash if run in an unmerged tree

If we are in the middle of resolving a merge conflict there may be
one or more files whose entries in the index represent an unmerged
state (index entries in the higher-order stages).

Attempting to run git-blame on any file in such a working directory
resulted in "fatal: internal error: ce_mode is 0" as we use the magic
marker for an unmerged entry is 0 (set up by things like diff-lib.c's
do_diff_cache() and builtin-read-tree.c's read_tree_unmerged())
and the ce_match_stat_basic() function gets upset about this.

I'm not entirely sure that the whole "ce_mode = 0" case is a good
idea to begin with, and maybe the right thing to do is to remove
that horrid freakish special case, but removing the internal error
seems to be the simplest fix for now.

                Linus

[sp: Thanks to Björn Steinbrink for the test case]

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-config: print error message if the config file cannot be read
Gerrit Pape [Fri, 12 Oct 2007 11:40:57 +0000 (11:40 +0000)]
git-config: print error message if the config file cannot be read

Instead of simply exiting with 255, print an error message including
the reason why a config file specified through --file cannot be opened
or read.

The problem was noticed by Joey Hess, reported through
 http://bugs.debian.org/445208

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofixing output of non-fast-forward output of post-receive-email
Robert Schiele [Wed, 17 Oct 2007 22:27:51 +0000 (00:27 +0200)]
fixing output of non-fast-forward output of post-receive-email

post-receive-email has one place where the variable fast_forward is not
spelled correctly.  At the same place the logic was reversed.  The
combination of both bugs made the script work correctly for fast-forward
commits but not for non-fast-forward ones.  This change fixes this to
be correct in both cases.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoDocument additional 1.5.3.5 fixes in release notes
Shawn O. Pearce [Wed, 17 Oct 2007 03:31:58 +0000 (23:31 -0400)]
Document additional 1.5.3.5 fixes in release notes

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoAvoid 'expr index' on Mac OS X as it isn't supported
Shawn O. Pearce [Wed, 17 Oct 2007 01:33:11 +0000 (21:33 -0400)]
Avoid 'expr index' on Mac OS X as it isn't supported

This fixes git-instaweb so it can start an httpd without warning
about an invalid test command.  Yes its ugly, but its also quite
portable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofilter-branch: update current branch when rewritten
Johannes Schindelin [Wed, 17 Oct 2007 02:23:10 +0000 (03:23 +0100)]
filter-branch: update current branch when rewritten

Earlier, "git filter-branch --<options> HEAD" would not update the
working tree after rewriting the branch.  This commit fixes it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofix filter-branch documentation
Johannes Schindelin [Wed, 17 Oct 2007 02:22:25 +0000 (03:22 +0100)]
fix filter-branch documentation

The man page for filter-branch still talked about writing the result
to the branch "newbranch".  This is hopefully the last place where the
old behaviour was described.

Noticed by Bill Lear.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agohelpful error message when send-pack finds no refs in common.
Andrew Clausen [Tue, 16 Oct 2007 21:16:05 +0000 (17:16 -0400)]
helpful error message when send-pack finds no refs in common.

Signed-off-by: Andrew Clausen <clausen@econ.upenn.edu>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoFix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE
Johannes Schindelin [Tue, 16 Oct 2007 23:37:36 +0000 (00:37 +0100)]
Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE

There are a few programs, such as config and diff, which allow running
without a git repository.  Therefore, they have to call
setup_git_directory_gently().

However, when GIT_DIR and GIT_WORK_TREE were set, and the current
directory was a subdirectory of the work tree,
setup_git_directory_gently() would return a bogus NULL prefix.

This patch fixes that.

Noticed by REPLeffect on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoCorrect typos in release notes for 1.5.3.5
Shawn O. Pearce [Wed, 17 Oct 2007 00:09:21 +0000 (20:09 -0400)]
Correct typos in release notes for 1.5.3.5

Noticed by Michele Ballabio.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoWhip post 1.5.3.4 maintenance series into shape.
Shawn O. Pearce [Tue, 16 Oct 2007 02:29:50 +0000 (22:29 -0400)]
Whip post 1.5.3.4 maintenance series into shape.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agorebase -i: use diff plumbing instead of porcelain
Johannes Schindelin [Tue, 9 Oct 2007 12:59:43 +0000 (13:59 +0100)]
rebase -i: use diff plumbing instead of porcelain

When diff drivers are installed, calling "git diff <tree1>..<tree2>"
calls those drivers.  This borks the patch generation of rebase -i.
So use "git diff-tree -p" instead, which does not call diff drivers.

Noticed by Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoDo not remove distributed configure script
Mathias Megyei [Thu, 4 Oct 2007 21:49:19 +0000 (23:49 +0200)]
Do not remove distributed configure script

Before this patch the clean target has removed the
configure script that comes with Git tar file.
That made compiling Git for different architectures
inconvenient.
This patch excludes configure from the files to be
deleted by 'make clean' and adds new target 'distclean'
to preserve old functionality.

Signed-off-by: Mathias Megyei <mathias@mnet-mail.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-archive: document --exec
Michele Ballabio [Thu, 4 Oct 2007 22:41:11 +0000 (00:41 +0200)]
git-archive: document --exec

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-reflog: document --verbose
Michele Ballabio [Thu, 4 Oct 2007 12:26:54 +0000 (14:26 +0200)]
git-reflog: document --verbose

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-config: handle --file option with relative pathname properly
Gerrit Pape [Fri, 12 Oct 2007 11:32:51 +0000 (11:32 +0000)]
git-config: handle --file option with relative pathname properly

When calling git-config not from the top level directory of a repository,
it changes directory before trying to open the config file specified
through the --file option, which then fails if the config file was
specified by a relative pathname.  This patch adjusts the pathname to
the config file if applicable.

The problem was noticed by Joey Hess, reported through
 http://bugs.debian.org/445208

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoclear_commit_marks(): avoid deep recursion
Johannes Schindelin [Wed, 10 Oct 2007 22:14:35 +0000 (23:14 +0100)]
clear_commit_marks(): avoid deep recursion

Before this patch, clear_commit_marks() recursed for each parent.  This
could be potentially very expensive in terms of stack space.  Probably
the only reason that this did not lead to problems is the fact that we
typically call clear_commit_marks() after marking a relatively small set
of commits.

Use (sort of) a tail recursion instead: first recurse on the parents
other than the first one, and then continue the loop with the first
parent.

Noticed by Shawn Pearce.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit add -i: Remove unused variables
Jean-Luc Herren [Tue, 9 Oct 2007 19:34:17 +0000 (21:34 +0200)]
git add -i: Remove unused variables

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit add -i: Fix parsing of abbreviated hunk headers
Jean-Luc Herren [Tue, 9 Oct 2007 19:29:26 +0000 (21:29 +0200)]
git add -i: Fix parsing of abbreviated hunk headers

The unified diff format allows one-line ranges to be abbreviated
by omiting the size.  The hunk header "@@ -10,1 +10,1 @@" can be
expressed as "@@ -10 +10 @@", but this wasn't properly parsed in
all cases.

Such abbreviated hunk headers are generated when a one-line change
(add, remove or modify) appears without context; for example
because the file is a one-liner itself or because GIT_DIFF_OPTS
was set to '-u0'.  If the user then runs 'git add -i' and enters
the 'patch' command for that file, perl complains about undefined
variables.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-config: don't silently ignore options after --list
Frank Lichtenheld [Fri, 5 Oct 2007 20:16:44 +0000 (22:16 +0200)]
git-config: don't silently ignore options after --list

Error out if someone gives options after --list since that is
not a valid syntax.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoClean up "git log" format with DIFF_FORMAT_NO_OUTPUT
Linus Torvalds [Tue, 9 Oct 2007 16:35:22 +0000 (09:35 -0700)]
Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT

This fixes an unnecessary empty line that we add to the log message when
we generate diffs, but don't actually end up printing any due to having
DIFF_FORMAT_NO_OUTPUT set.

This can happen with pickaxe or with rename following. The reason is that
we normally add an empty line between the commit and the diff, but we do
that even for the case where we've then suppressed the actual printing of
the diff.

This also updates a couple of tests that assumed the extraneous empty
line would exist at the end of output.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoFix embarrassing "git log --follow" bug
Linus Torvalds [Mon, 8 Oct 2007 20:42:41 +0000 (13:42 -0700)]
Fix embarrassing "git log --follow" bug

It turns out that I completely broke "git log --follow" with my recent
patch to revision.c ("Fix revision log diff setup, avoid unnecessary diff
generation", commit b7bb760d5ed4881422673d32f869d140221d3564).

Why? Because --follow obviously requires the diff machinery to function,
exactly the same way pickaxe does.

So everybody is away right now, but considering that nobody even noticed
this bug, I don't think it matters. But for the record, here's the trivial
one-liner fix (well, two, since I also fixed the comment).

Because of the nature of the bug, if you ask for patches when following
(which is one of the things I normally do), the bug is hidden, because
then the request for diff output will automatically also enable the diffs
themselves.

So while "git log --follow <filename>" didn't work, adding a "-p"
magically made it work again even without this fix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoGIT 1.5.3.4 v1.5.3.4
Junio C Hamano [Wed, 3 Oct 2007 09:33:11 +0000 (02:33 -0700)]
GIT 1.5.3.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd test case for ls-files --with-tree
Carl Worth [Wed, 3 Oct 2007 07:03:53 +0000 (00:03 -0700)]
Add test case for ls-files --with-tree

This tests basic functionality and also exercises a bug noticed
by Keith Packard, (prune_cache followed by add_index_entry can
trigger an attempt to realloc a pointer into the middle of an
allocated buffer).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMust not modify the_index.cache as it may be passed to realloc at some point.
Keith Packard [Wed, 3 Oct 2007 05:44:15 +0000 (22:44 -0700)]
Must not modify the_index.cache as it may be passed to realloc at some point.

The index cache is not static, growing as new entries are added. If
entries are added after prune_cache is called, cache will no longer
point at the base of the allocation, and realloc will not be happy.

I verified that this was the only place in the current source which
modified any index_state.cache elements aside from the alloc/realloc
calls in read-cache by changing the type of the element to 'struct
cache_entry ** const cache' and recompiling.

A more efficient patch would create a separate 'cache_base' value to
track the allocation and then fix things up when reallocation was
necessary, instead of the brute-force memmove used here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agothe ar tool is called gar on some systems
Robert Schiele [Wed, 3 Oct 2007 01:49:34 +0000 (03:49 +0200)]
the ar tool is called gar on some systems

Some systems that have only installed the GNU toolchain (prefixed with "g")
do not provide "ar" but only "gar".  Make configure find this tool as well.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorename diff_free_filespec_data_large() to diff_free_filespec_blob()
Junio C Hamano [Wed, 3 Oct 2007 04:01:03 +0000 (21:01 -0700)]
rename diff_free_filespec_data_large() to diff_free_filespec_blob()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodiffcore-rename: cache file deltas
Jeff King [Tue, 25 Sep 2007 19:29:42 +0000 (15:29 -0400)]
diffcore-rename: cache file deltas

We find rename candidates by computing a fingerprint hash of
each file, and then comparing those fingerprints. There are
inherently O(n^2) comparisons, so it pays in CPU time to
hoist the (rather expensive) computation of the fingerprint
out of that loop (or to cache it once we have computed it once).

Previously, we didn't keep the filespec information around
because then we had the potential to consume a great deal of
memory. However, instead of keeping all of the filespec
data, we can instead just keep the fingerprint.

This patch implements and uses diff_free_filespec_data_large
to accomplish that goal. We also have to change
estimate_similarity not to needlessly repopulate the
filespec data when we already have the hash.

Practical tests showed 4.5x speedup for a 10% memory usage
increase.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMention 'cpio' dependency in INSTALL
Johan Herland [Tue, 2 Oct 2007 23:42:29 +0000 (01:42 +0200)]
Mention 'cpio' dependency in INSTALL

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake git-pull complain and give advice when there is nothing to merge with
Federico Mena Quintero [Tue, 2 Oct 2007 23:36:30 +0000 (18:36 -0500)]
Make git-pull complain and give advice when there is nothing to merge with

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoNote that git-branch will not automatically checkout the new branch
Federico Mena Quintero [Tue, 2 Oct 2007 23:34:32 +0000 (18:34 -0500)]
Note that git-branch will not automatically checkout the new branch

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd documentation for --track and --no-track to the git-branch docs.
Federico Mena Quintero [Tue, 2 Oct 2007 23:33:30 +0000 (18:33 -0500)]
Add documentation for --track and --no-track to the git-branch docs.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSay when --track is useful in the git-checkout docs.
Federico Mena Quintero [Tue, 2 Oct 2007 23:32:32 +0000 (18:32 -0500)]
Say when --track is useful in the git-checkout docs.

The documentation used to say what the option does, but it
didn't mention a use case.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix typo in config.txt
Johannes Schindelin [Tue, 2 Oct 2007 20:14:30 +0000 (21:14 +0100)]
Fix typo in config.txt

There was an 'l' (ell) instead of a '1' (one) in one of the gitlinks.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofor-each-ref: fix %(numparent) and %(parent)
Junio C Hamano [Tue, 2 Oct 2007 22:09:41 +0000 (15:09 -0700)]
for-each-ref: fix %(numparent) and %(parent)

The string value of %(numparent) was not returned correctly.
Also %(parent) misbehaved for the root commits (returned garbage)
and merge commits (returned first parent, followed by a space).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: initialize TMP_INDEX just to be sure.
Junio C Hamano [Tue, 2 Oct 2007 18:47:58 +0000 (11:47 -0700)]
git-commit: initialize TMP_INDEX just to be sure.

We rely on TMP_INDEX variable to decide if we are doing a partial commit,
as it is only set in the partial commit codepath.  But the variable is
never initialized.  A stray environment variable from outside could
ruin the day.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofixed link in documentation of diff-options
Steffen Prohaska [Tue, 2 Oct 2007 06:14:37 +0000 (08:14 +0200)]
fixed link in documentation of diff-options

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoWhip post 1.5.3.3 maintenance series into shape.
Junio C Hamano [Mon, 1 Oct 2007 09:07:47 +0000 (02:07 -0700)]
Whip post 1.5.3.3 maintenance series into shape.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit stash: document apply's --index switch
Miklos Vajna [Sun, 30 Sep 2007 22:30:27 +0000 (00:30 +0200)]
git stash: document apply's --index switch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopost-receive-hook: Remove the From field from the generated email header so that...
Andy Parkins [Fri, 28 Sep 2007 14:24:26 +0000 (15:24 +0100)]
post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used

Using the name of the committer of the revision at the tip of the
updated ref is not sensible.  That information is available in the email
itself should it be wanted, and by supplying a "From", we were
effectively hiding the person who performed the push - which is useful
information in itself.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-remote: exit with non-zero status after detecting errors.
Jari Aalto [Sun, 30 Sep 2007 06:29:43 +0000 (23:29 -0700)]
git-remote: exit with non-zero status after detecting errors.

Some subcommands of "git-remote" detected and issued error
messages but did not signal that to the calling process with
exit status.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: squash should retain the authorship of the _first_ commit
Johannes Schindelin [Sat, 29 Sep 2007 23:34:23 +0000 (00:34 +0100)]
rebase -i: squash should retain the authorship of the _first_ commit

It was determined on the mailing list, that it makes more sense for a
"squash" to keep the author of the first commit as the author for the
result of the squash.

Make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-add--interactive: Improve behavior on bogus input
Jean-Luc Herren [Wed, 26 Sep 2007 14:05:01 +0000 (16:05 +0200)]
git-add--interactive: Improve behavior on bogus input

1) Previously, any menu would cause a perl error when entered '0',
   which is never a valid option.

2) Entering a bogus choice (like 998 or 4-2) surprisingly caused
   the same behavior as if the user had just hit 'enter', which
   means to carry out the selected action on the selected items.
   Entering such bogus input is now a no-op and the sub-menu
   doesn't exit.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-add--interactive: Allow Ctrl-D to exit
Jean-Luc Herren [Wed, 26 Sep 2007 13:56:19 +0000 (15:56 +0200)]
git-add--interactive: Allow Ctrl-D to exit

Hitting Ctrl-D (EOF) is a common way to exit shell-like tools.
When in a sub-menu it will still behave as if an empty line had
been entered, carrying out the action on the selected items and
returning to the previous menu.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT 1.5.3.3 v1.5.3.3
Junio C Hamano [Sat, 29 Sep 2007 23:07:46 +0000 (16:07 -0700)]
GIT 1.5.3.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix revision log diff setup, avoid unnecessary diff generation
Linus Torvalds [Sat, 29 Sep 2007 16:50:39 +0000 (09:50 -0700)]
Fix revision log diff setup, avoid unnecessary diff generation

We used to incorrectly start calculating diffs whenever any argument but
'-z' was recognized by the diff options parsing. That was bogus, since not
all arguments result in diffs being needed, so we just waste a lot of time
and effort on calculating diffs that don't matter.

This actually also fixes another bug in "git log". Try this:

git log -C

and notice how it prints an extra empty line in between log entries, even
though it never prints the actual diff (because we didn't ask for any diff
format, so the diff machinery never prints anything).

With this patch, that bogus empty line is gone, because "revs->diff" is
never set.  So this isn't just a "wasted time and effort" issue, it's also
a slight semantic fix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-bundle: fix commandline examples in the manpage
Miklos Vajna [Wed, 26 Sep 2007 23:34:59 +0000 (01:34 +0200)]
git-bundle: fix commandline examples in the manpage

Multiple commands were displayed in one line, making the manpage hard to read.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'mergetool' of git://repo.or.cz/git/mergetool into maint
Junio C Hamano [Sat, 29 Sep 2007 22:39:39 +0000 (15:39 -0700)]
Merge branch 'mergetool' of git://repo.or.cz/git/mergetool into maint

* 'mergetool' of git://repo.or.cz/git/mergetool:
  mergetool: Fix typo in options passed to kdiff3
  mergetool: fix emerge when running in a subdirectory
  Mergetool generating blank files (1.5.3)

17 years agomergetool: Fix typo in options passed to kdiff3
Theodore Ts'o [Sat, 29 Sep 2007 02:26:05 +0000 (22:26 -0400)]
mergetool: Fix typo in options passed to kdiff3

Fix missing double hyphens in "-L1" and "-L2"

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agomergetool: fix emerge when running in a subdirectory
Theodore Ts'o [Sat, 29 Sep 2007 01:23:22 +0000 (21:23 -0400)]
mergetool: fix emerge when running in a subdirectory

Only pass the basename of the output filename when to emerge, since
emerge interprets non-absolute pathnames relative to the containing
directory of the output buffer.

Thanks to Kelvie Wong for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agoMergetool generating blank files (1.5.3)
Junio C Hamano [Thu, 27 Sep 2007 21:41:23 +0000 (14:41 -0700)]
Mergetool generating blank files (1.5.3)

When mergetool is run from a subdirectory, "ls-files -u" nicely
limits the output to conflicted files in that directory, but
we need to give the full path to cat-file plumbing to grab the
contents of stages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agoquiltimport: Skip non-existent patches
Dan Nicholson [Thu, 27 Sep 2007 20:30:59 +0000 (13:30 -0700)]
quiltimport: Skip non-existent patches

When quiltimport encounters a non-existent patch in the series file,
just skip to the next patch. This matches the behavior of quilt.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoapply: get rid of --index-info in favor of --build-fake-ancestor
Johannes Schindelin [Mon, 17 Sep 2007 22:34:06 +0000 (23:34 +0100)]
apply: get rid of --index-info in favor of --build-fake-ancestor

git-am used "git apply -z --index-info" to find the original versions
of the files touched by the diff, to be able to do an inexpensive
three-way merge.

This operation makes only sense in a repository, since the index
information in the diff refers to blobs, which have to be present in
the current repository.

Therefore, teach "git apply" a mode to write out the result as an
index file to begin with, obviating the need for scripts to do it
themselves.

The sole user for --index-info is "git am" is converted to
use --build-fake-ancestor in this patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMove make_cache_entry() from merge-recursive.c into read-cache.c
Carlos Rica [Tue, 11 Sep 2007 03:17:28 +0000 (05:17 +0200)]
Move make_cache_entry() from merge-recursive.c into read-cache.c

The function make_cache_entry() is too useful to be hidden away in
merge-recursive.  So move it to libgit.a (exposing it via cache.h).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocore-tutorial: correct URL
Randy Dunlap [Wed, 26 Sep 2007 05:02:28 +0000 (22:02 -0700)]
core-tutorial: correct URL

The tinyurl is incorrect -- it attempts to go to groups.osdl.org,
which is gone.  Either use the full URL (in patch) or create a new
tinyurl for this URL.

Is the web page (where I first saw this problem) generated from
this txt file?
http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html
If not, it needs to be updated also.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix spelling of overridden in documentation
Shawn Bohrer [Wed, 26 Sep 2007 04:12:46 +0000 (23:12 -0500)]
Fix spelling of overridden in documentation

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitattributes.txt: Be more to the point in the filter driver description.
Johannes Sixt [Tue, 25 Sep 2007 13:05:29 +0000 (15:05 +0200)]
gitattributes.txt: Be more to the point in the filter driver description.

The description was meant to emphasizes that the project should remain
usable even if the filter driver was not used. This makes it more explicit
and removes the "here is rope to hang yourself" paraphrase.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitattributes.txt: Remove a duplicated paragraph about 'ident' and 'crlf' interaction.
Johannes Sixt [Tue, 25 Sep 2007 13:05:28 +0000 (15:05 +0200)]
gitattributes.txt: Remove a duplicated paragraph about 'ident' and 'crlf' interaction.

The order in which 'ident' and 'crlf' are carried out is documented a few paragraphs
later again, after 'filter' was introduced.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agouser-manual: Explain what submodules are good for.
Michael Smith [Tue, 25 Sep 2007 12:44:38 +0000 (08:44 -0400)]
user-manual: Explain what submodules are good for.

Rework the introduction to the Submodules section to explain why
someone would use them, and fix up submodule references from the
tree-object and todo sections.

Signed-off-by: Michael Smith <msmith@cbnco.com>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jn/web' into maint
Junio C Hamano [Tue, 25 Sep 2007 22:17:22 +0000 (15:17 -0700)]
Merge branch 'jn/web' into maint

* jn/web:
  gitweb: No difftree output for trivial merge
  gitweb: Remove parse_from_to_diffinfo code from git_patchset_body

17 years agoDo not over-quote the -f envelopesender value.
Jim Meyering [Tue, 25 Sep 2007 06:48:59 +0000 (08:48 +0200)]
Do not over-quote the -f envelopesender value.

Without this, the value passed to sendmail would have an extra set of
single quotes.  At least exim's sendmail emulation would object to that:

    exim: bad -f address "'list-addr@example.org'": malformed address: ' \
      may not follow 'list-addr@example.org
    error: hooks/post-receive exited with error code 1

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agounexpected Make output (e.g. from --debug) causes build failure
Jim Meyering [Tue, 25 Sep 2007 06:42:16 +0000 (08:42 +0200)]
unexpected Make output (e.g. from --debug) causes build failure

Without this, the extra output produced e.g., by "make --debug"
would go into $INSTLIBDIR and then cause the sed command to fail.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFixed minor typo in t/t9001-send-email.sh test command line.
Glenn Rempe [Mon, 24 Sep 2007 20:33:38 +0000 (13:33 -0700)]
Fixed minor typo in t/t9001-send-email.sh test command line.

The git-send-email command line in the test was missing a single hyphen.

Signed-off-by: Glenn Rempe <glenn@rempe.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: No difftree output for trivial merge
Jakub Narebski [Sat, 8 Sep 2007 19:54:28 +0000 (21:54 +0200)]
gitweb: No difftree output for trivial merge

In 'commitdiff' view, for the merge commit, there is an extra header
for the difftree table, with links to commitdiffs to individual
parents.  Do not show such header when there is nothing to show, for
trivial merges.

This means that for trivial merge you have to go to 'commit' view
to get links to diffs to each parent.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
17 years agogitweb: Remove parse_from_to_diffinfo code from git_patchset_body
Jakub Narebski [Sat, 8 Sep 2007 19:49:11 +0000 (21:49 +0200)]
gitweb: Remove parse_from_to_diffinfo code from git_patchset_body

In commit 90921740bd00029708370673fdc537522aa48e6f
  "gitweb: Split git_patchset_body into separate subroutines"
a part of git_patchset_body code was separated into parse_from_to_diffinfo
subroutine.  But instead of replacing the separated code by the call to
mentioned subroutine, the call to subroutine was placed before the separated
code.  This patch removes parse_from_to_diffinfo code from git_patchset_body
subroutine.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
17 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Mon, 24 Sep 2007 00:08:45 +0000 (17:08 -0700)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  User Manual: add a chapter for submodules
  user-manual: don't assume refs are stored under .git/refs

17 years agogit-svn: don't attempt to spawn pager if we don't want one
Eric Wong [Sat, 22 Sep 2007 01:48:45 +0000 (18:48 -0700)]
git-svn: don't attempt to spawn pager if we don't want one

Even though config_pager() unset the $pager variable, we were
blindly calling exec() on it through run_pager().

Noticed-by: Chris Moore <christopher.ian.moore@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSupplant the "while case ... break ;; esac" idiom
David Kastrup [Sun, 23 Sep 2007 20:42:08 +0000 (22:42 +0200)]
Supplant the "while case ... break ;; esac" idiom

A lot of shell scripts contained stuff starting with

while case "$#" in 0) break ;; esac

and similar.  I consider breaking out of the condition instead of the
body od the loop ugly, and the implied "true" value of the
non-matching case is not really obvious to humans at first glance.  It
happens not to be obvious to some BSD shells, either, but that's
because they are not POSIX-compliant.  In most cases, this has been
replaced by a straight condition using "test".  "case" has the
advantage of being faster than "test" on vintage shells where "test"
is not a builtin.  Since none of them is likely to run the git
scripts, anyway, the added readability should be worth the change.

A few loops have had their termination condition expressed
differently.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUser Manual: add a chapter for submodules
Miklos Vajna [Thu, 20 Sep 2007 00:34:14 +0000 (02:34 +0200)]
User Manual: add a chapter for submodules

Signed-off-by: Michael Smith <msmith@cbnco.com>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agouser-manual: don't assume refs are stored under .git/refs
J. Bruce Fields [Mon, 10 Sep 2007 02:07:02 +0000 (22:07 -0400)]
user-manual: don't assume refs are stored under .git/refs

The scripts taken from Tony Luck's howto assume all refs can be found
under .git/refs, but this is not necessarily true, especially since
git-gc runs git-pack-refs.

Also add a note warning of this in the chapter that introduces refs, and
fix the same incorrect assumption in one other spot.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agoDetect exec bit in more cases.
David Brown [Wed, 19 Sep 2007 20:12:48 +0000 (13:12 -0700)]
Detect exec bit in more cases.

git-p4 was missing the execute bit setting if the file had other attribute
bits set.

Acked-By: Simon Hausmann <simon@lst.de>
17 years agoConjugate "search" correctly in the git-prune-packed man page.
Matt Kraai [Fri, 21 Sep 2007 14:37:18 +0000 (07:37 -0700)]
Conjugate "search" correctly in the git-prune-packed man page.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMove the paragraph specifying where the .idx and .pack files should be
Matt Kraai [Fri, 21 Sep 2007 13:43:44 +0000 (06:43 -0700)]
Move the paragraph specifying where the .idx and .pack files should be

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation/git-lost-found.txt: drop unnecessarily duplicated name.
Junio C Hamano [Fri, 21 Sep 2007 19:52:30 +0000 (12:52 -0700)]
Documentation/git-lost-found.txt: drop unnecessarily duplicated name.

I only did this back when I wanted to make sure git-log and gitk work
properly with non Occidental characters.  There is really no reason to
keep it around.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT 1.5.3.2 v1.5.3.2
Junio C Hamano [Wed, 19 Sep 2007 10:11:28 +0000 (03:11 -0700)]
GIT 1.5.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFixed update-hook example allow-users format.
Väinö Järvelä [Tue, 18 Sep 2007 12:26:09 +0000 (15:26 +0300)]
Fixed update-hook example allow-users format.

The example provided with the update-hook-example does not work on
either bash 2.05b.0(1)-release nor 3.1.17(1)-release. The matcher did
not match the lines that it advertised to match, such as:

refs/heads/bw/        linus
refs/heads/tmp/*      *

In POSIX 1003.2 regular expressions, the star (*), is not an wildcard
meaning "match everything", it matches 0 or more matches of the atom
preceding it.

So to match "refs/heads/bw/topic-branch", the matcher should be written
as "refs/heads/bw/.*" to match "refs/heads/bw/" and everything after it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation/git-svn: updated design philosophy notes
Eric Wong [Tue, 18 Sep 2007 23:50:42 +0000 (16:50 -0700)]
Documentation/git-svn: updated design philosophy notes

This section has not been updated in a while and
--branches/--tags/--trunk options are commonly used nowadays.

Noticed-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agot/t4014: test "am -3" with mode-only change.
Junio C Hamano [Tue, 18 Sep 2007 22:19:47 +0000 (15:19 -0700)]
t/t4014: test "am -3" with mode-only change.

Earlier commit ece7b74903007cee8d280573647243d46a6f3a95 added a test
for rebase that uses "am -3", but this adds a test to check "am -3"
itself.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix lapsus in builtin-apply.c
Pierre Habouzit [Tue, 18 Sep 2007 10:12:58 +0000 (12:12 +0200)]
Fix lapsus in builtin-apply.c

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-push: documentation and tests for pushing only branches
Jeff King [Tue, 18 Sep 2007 08:15:34 +0000 (04:15 -0400)]
git-push: documentation and tests for pushing only branches

Commit 098e711e caused git-push to match only branches when
considering which refs to push. This patch updates the
documentation accordingly and adds a test for this behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svnimport: Use separate arguments in the pipe for git-rev-parse
Matthias Urlichs [Tue, 18 Sep 2007 09:29:09 +0000 (11:29 +0200)]
git-svnimport: Use separate arguments in the pipe for git-rev-parse

Some people seem to create SVN branch names with spaces
or other shell metacharacters.

Signed-off-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument ls-files --with-tree=<tree-ish>
Junio C Hamano [Fri, 14 Sep 2007 23:59:04 +0000 (16:59 -0700)]
Document ls-files --with-tree=<tree-ish>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: partial commit of paths only removed from the index
Junio C Hamano [Fri, 14 Sep 2007 23:53:58 +0000 (16:53 -0700)]
git-commit: partial commit of paths only removed from the index

Because a partial commit is meant to be a way to ignore what are
staged in the index, "git rm --cached A && git commit A" should
just record what is in A on the filesystem.  The previous patch
made the command sequence to barf, saying that A has not been
added yet.  This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: Allow partial commit of file removal.
Junio C Hamano [Wed, 12 Sep 2007 23:04:22 +0000 (16:04 -0700)]
git-commit: Allow partial commit of file removal.

When making a partial commit, git-commit uses git-ls-files with
the --error-unmatch option to expand and sanity check the user
supplied path patterns.  When any path pattern does not match
with the paths known to the index, it errors out, in order to
catch a common mistake to say "git commit Makefiel cache.h"
and end up with a commit that touches only cache.h (notice the
misspelled "Makefile").  This detection however does not work
well when the path has already been removed from the index.

If you drop a path from the index and try to commit that
partially, i.e.

$ git rm COPYING
$ git commit -m 'Remove COPYING' COPYING

the command complains because git does not know anything about
COPYING anymore.

This introduces a new option --with-tree to git-ls-files and
uses it in git-commit when we build a temporary index to
write a tree object for the partial commit.

When --with-tree=<tree-ish> option is specified, names from the
given tree are added to the set of names the index knows about,
so we can treat COPYING file in the example as known.

Of course, there is no reason to use "git rm" and git-aware
people have long time done:

$ rm COPYING
$ git commit -m 'Remove COPYING' COPYING

which works just fine.  But this caused a constant confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jc/grep-c' into maint
Junio C Hamano [Tue, 18 Sep 2007 06:56:40 +0000 (23:56 -0700)]
Merge branch 'jc/grep-c' into maint

* jc/grep-c:
  Split grep arguments in a way that does not requires to add /dev/null.

17 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Tue, 18 Sep 2007 06:50:17 +0000 (23:50 -0700)]
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Disable native platform text selection in "lists"
  git-gui: Paper bag fix "Commit->Revert" format arguments
  git-gui: Provide 'uninstall' Makefile target to undo an installation
  git-gui: Font chooser to handle a large number of font families
  git-gui: Make backporting changes from i18n version easier
  git-gui: Don't delete send on Windows as it doesn't exist
  git-gui: Trim trailing slashes from untracked submodule names
  git-gui: Assume untracked directories are Git submodules
  git-gui: handle "deleted symlink" diff marker
  git-gui: show unstaged symlinks in diff viewer
  git-gui: Avoid use of libdir in Makefile
  git-gui: Disable Tk send in all git-gui sessions
  git-gui: lib/index.tcl: handle files with % in the filename properly
  git-gui: Properly set the state of "Stage/Unstage Hunk" action
  git-gui: Fix detaching current branch during checkout
  git-gui: Correct starting of git-remote to handle -w option

17 years agosend-email: make message-id generation a bit more robust
Junio C Hamano [Tue, 18 Sep 2007 04:18:20 +0000 (21:18 -0700)]
send-email: make message-id generation a bit more robust

Earlier code took Unix time and appended a few random digits.
If you are firing off many messages within a second, you could
issue the same id to different messages, which is a no-no.  If
you send out 31 messages within a single second, with random
integer taken out of rand(4200), you have about 10% chance of
producing the same message ID.

This fixes the problem by uses a prefix string which is
constant-per-invocation (time and pid), with a serial number for
each message generated by the process appended at the end.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-apply: fix whitespace stripping
J. Bruce Fields [Sun, 16 Sep 2007 22:49:00 +0000 (18:49 -0400)]
git-apply: fix whitespace stripping

The algorithm isn't right here: it accumulates any set of 8 spaces into
tabs even if they're separated by tabs, so

<four spaces><tab><four spaces><tab>

is converted to

<tab><tab><tab>

when it should be just

<tab><tab>

So teach git-apply that a tab hides any group of less than 8 previous
spaces in a row.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-gui: Disable native platform text selection in "lists" gitgui-0.8.3
Shawn O. Pearce [Mon, 17 Sep 2007 03:12:19 +0000 (23:12 -0400)]
git-gui: Disable native platform text selection in "lists"

Sometimes we use a Tk text widget as though it were a listbox.
This happens typically when we want to show an icon to the left
of the text label or just when a text widget is generally a better
choice then the native listbox widget.

In these cases if we want the user to have control over the selection
we implement our own "in_sel" tag that shows the selected region
and we perform our own selection management in the background
via keybindings and mouse bindings.  In such uses we don't want
the user to be able to activate the native platform selection by
dragging their mouse through the text widget.  Doing so creates a
very confusing display and the user is left wondering what it may
mean to have two different types of selection in the same widget.

Tk doesn't allow us to delete the "sel" tag that it uses internally
to manage the native selection but it will allow us to make it
invisible by setting the tag to have the same display properties
as unselected text.  So long as we don't actually use the "sel"
tag for anything in code its effectively invisible.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoapply --index-info: fall back to current index for mode changes
Johannes Schindelin [Mon, 17 Sep 2007 00:24:57 +0000 (01:24 +0100)]
apply --index-info: fall back to current index for mode changes

"git diff" does not record index lines for pure mode changes (i.e. no
lines changed).  Therefore, apply --index-info would call out a bogus
error.

Instead, fall back to reading the info from the current index.

Incidentally, this fixes an error where git-rebase would not rebase a
commit including a pure mode change, and changes requiring a threeway
merge.

Noticed and later tested by Chris Shoemaker.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Sun, 16 Sep 2007 06:18:05 +0000 (23:18 -0700)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  core-tutorial: minor cleanup
  documentation: replace Discussion section by link to user-manual chapter
  user-manual: todo updates and cleanup
  user-manual: fix introduction to packfiles
  user-manual: move packfile and dangling object discussion
  user-manual: rewrite object database discussion
  user-manual: reorder commit, blob, tree discussion
  user-manual: rewrite index discussion
  user-manual: create new "low-level git operations" chapter
  user-manual: rename "git internals" to "git concepts"
  user-manual: move object format details to hacking-git chapter
  user-manual: adjust section levels in "git internals"

17 years agocore-tutorial: minor cleanup
J. Bruce Fields [Mon, 3 Sep 2007 14:34:27 +0000 (10:34 -0400)]
core-tutorial: minor cleanup

Revise the introduction for concision, add pointers to the tutorial and
user manual as appropriate, delete cvsimport note from the end, as that
work's been done elsewhere already.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
17 years agodocumentation: replace Discussion section by link to user-manual chapter
J. Bruce Fields [Mon, 3 Sep 2007 04:01:19 +0000 (00:01 -0400)]
documentation: replace Discussion section by link to user-manual chapter

The "Discussion" section has a lot of useful information, but is a
little wordy, especially for an already-long man page, and is designed
for an audience more of potential git hackers than users, which probably
doesn't make as much sense as git matures.  Also, I (perhaps foolishly)
forked a version in the user manual, which has been significantly
rewritten in an attempt to address some of the above problems.

So, remove this section and replace it by a (very terse) summary of the
original material--my attempt at the World's Shortest Git Overview--and
a reference to the appropriate chapter of the user manual.  It's
unfortunate to remove something that's been in this place for a long
time, as some people may still depend on finding it there.  But I think
we'll want to do this some day anyway.

Cc: Andreas Ericsson <ae@op5.se>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>