1
0
mirror of https://github.com/git/git.git synced 2024-09-30 10:11:21 +02:00
Commit Graph

11465 Commits

Author SHA1 Message Date
Linus Torvalds
b7bb760d5e 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>
2007-09-29 15:42:32 -07:00
Miklos Vajna
ee8245b54a 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>
2007-09-29 15:40:17 -07:00
Junio C Hamano
d3759c0805 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)
2007-09-29 15:39:39 -07:00
Theodore Ts'o
208fe3ac7e 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>
2007-09-28 22:26:05 -04:00
Theodore Ts'o
f6e0e55934 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>
2007-09-28 21:23:22 -04:00
Junio C Hamano
769f39861b 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>
2007-09-28 20:13:14 -04:00
Dan Nicholson
9f569fe58f 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>
2007-09-27 16:19:19 -07:00
Johannes Schindelin
26b2800768 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>
2007-09-26 13:42:10 -07:00
Carlos Rica
102c2338da 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>
2007-09-26 13:42:10 -07:00
Randy Dunlap
bce92405ae 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>
2007-09-25 23:39:01 -07:00
Shawn Bohrer
b06743925c Fix spelling of overridden in documentation
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 23:38:42 -07:00
Johannes Sixt
4d84aff356 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>
2007-09-25 17:37:35 -07:00
Johannes Sixt
2dbbc45730 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>
2007-09-25 17:37:31 -07:00
Michael Smith
6dd14366d9 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>
2007-09-25 17:30:12 -07:00
Junio C Hamano
d3f3ab264f 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
2007-09-25 15:17:22 -07:00
Jim Meyering
d1637a07f6 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>
2007-09-25 00:30:19 -07:00
Jim Meyering
e883932f7d 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>
2007-09-25 00:30:16 -07:00
Glenn Rempe
85d81a757e 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>
2007-09-24 23:01:42 -07:00
Jakub Narebski
3ef408aefe 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>
2007-09-23 23:12:22 -07:00
Jakub Narebski
711fa74266 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>
2007-09-23 23:04:16 -07:00
Junio C Hamano
15eda0202a 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
2007-09-23 17:08:45 -07:00
Eric Wong
b019304886 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>
2007-09-23 17:07:10 -07:00
David Kastrup
822f7c7349 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>
2007-09-23 16:12:00 -07:00
Miklos Vajna
38a457baae 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>
2007-09-23 12:59:14 -04:00
J. Bruce Fields
fc74ecc12c 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>
2007-09-23 12:57:54 -04:00
David Brown
b9fc6ea9ef 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>
2007-09-22 15:41:50 -07:00
Matt Kraai
9c2d28c74e 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>
2007-09-21 12:54:24 -07:00
Matt Kraai
1e6ab5de4f 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>
2007-09-21 12:54:11 -07:00
Junio C Hamano
8fceacee67 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>
2007-09-21 12:53:08 -07:00
Junio C Hamano
806ea701ce GIT 1.5.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.3.2
2007-09-19 03:11:28 -07:00
Väinö Järvelä
8ae674952c 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>
2007-09-18 17:38:52 -07:00
Eric Wong
bd43098c26 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>
2007-09-18 17:07:45 -07:00
Junio C Hamano
cd894ee9ad 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>
2007-09-18 15:19:47 -07:00
Pierre Habouzit
3d845d7763 Fix lapsus in builtin-apply.c
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18 14:09:12 -07:00
Jeff King
5c633a4cbe 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>
2007-09-18 14:00:20 -07:00
Matthias Urlichs
bf1ee63678 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>
2007-09-18 14:00:20 -07:00
Junio C Hamano
7a461b5a33 Document ls-files --with-tree=<tree-ish>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-17 23:57:35 -07:00
Junio C Hamano
cba8d48961 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>
2007-09-17 23:57:35 -07:00
Junio C Hamano
64586e75af 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>
2007-09-17 23:57:35 -07:00
Junio C Hamano
a017f27dcb Merge branch 'jc/grep-c' into maint
* jc/grep-c:
  Split grep arguments in a way that does not requires to add /dev/null.
2007-09-17 23:56:40 -07:00
Junio C Hamano
9269df9610 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
2007-09-17 23:50:17 -07:00
Junio C Hamano
be510cfef3 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>
2007-09-17 22:02:19 -07:00
J. Bruce Fields
d7416ecac8 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>
2007-09-17 02:18:44 -07:00
Shawn O. Pearce
3849bfba84 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>
gitgui-0.8.3
2007-09-16 23:12:19 -04:00
Johannes Schindelin
ece7b74903 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>
2007-09-16 18:20:10 -07:00
Junio C Hamano
f3caeb9ac2 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"
2007-09-15 23:18:05 -07:00
J. Bruce Fields
a85fecafe6 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>
2007-09-15 22:17:24 -04:00
J. Bruce Fields
40dac517ee 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>
2007-09-15 22:17:24 -04:00
J. Bruce Fields
ecd95b536e user-manual: todo updates and cleanup
Format a couple lists.  Reminder that we may want to add submodule
documentation some day.
2007-09-15 22:17:23 -04:00
J. Bruce Fields
9644ffdd65 user-manual: fix introduction to packfiles
Actually I don't think we've previously mentioned .git/objects, so we
need a different introduction here.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2007-09-15 22:17:23 -04:00