Commit graph

14529 commits

Author SHA1 Message Date
Christian Couder 921177f50f Documentation: improve "add", "pull" and "format-patch" examples
Before this patch in "git-add.txt" and "git-format-patch.txt", the
commands used in the examples were "git-CMD" instead of "git CMD".
This patch fixes that.

In "git-pull.txt" only the last example had the code sample in an
asciidoc "Listing Block", and in the other two files, none.
This patch fixes that by putting all code samples in listing
blocks.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06 21:46:42 -07:00
Mark Hills c904bf392d Be more careful with objects directory permissions on clone
Honour the setgid and umask when re-creating the objects directory
at the destination.

cpio in copy-pass mode aims to copy file permissions which causes this
problem and cannot be disabled. Be explicit by copying the directory
structure first, honouring the permissions at the destination, then copy
the files with 0444 permissions. This also avoids bugs in some versions
of cpio.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06 21:34:35 -07:00
Santi Béjar bb1ae3f6ff commit: Show committer if automatic
To warn the user in case he/she might be using an unintended
committer identity.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06 16:50:17 -07:00
Santi Béjar e83dbe802f commit: Show author if different from committer
That would help reassure anybody while committing other's changes.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06 16:43:52 -07:00
Santi Béjar a45d46ba72 Preparation to call determine_author_info from prepare_to_commit
Reorder functions definitions such that determine_author_info is
defined before prepare_to_commit. No code changes.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06 16:40:32 -07:00
Junio C Hamano 867fa20fe9 Merge branch 'jc/lstat'
* jc/lstat:
  diff-files: mark an index entry we know is up-to-date as such
  write_index(): optimize ce_smudge_racily_clean_entry() calls with CE_UPTODATE
2008-05-05 19:16:26 -07:00
Junio C Hamano e9dd751866 Merge branch 'bc/filter-branch'
* bc/filter-branch:
  filter-branch.sh: support nearly proper tag name filtering
2008-05-05 19:16:20 -07:00
Junio C Hamano e2e2defc14 Merge branch 'lh/git-file'
* lh/git-file:
  Teach GIT-VERSION-GEN about the .git file
  Teach git-submodule.sh about the .git file
  Teach resolve_gitlink_ref() about the .git file
  Add platform-independent .git "symlink"
2008-05-05 19:16:16 -07:00
Junio C Hamano 9c36e1700f Merge branch 'jk/fetch-status'
* jk/fetch-status:
  git-fetch: always show status of non-tracking-ref fetches
2008-05-05 19:16:12 -07:00
Junio C Hamano b79c9859c8 Merge branch 'lh/branch-merged'
* lh/branch-merged:
  Add tests for `branch --[no-]merged`
  git-branch.txt: compare --contains, --merged and --no-merged
  git-branch: add support for --merged and --no-merged
2008-05-05 19:16:06 -07:00
Junio C Hamano dc484f2213 Merge branch 'pb/remote-mirror-config'
* pb/remote-mirror-config:
  Add a remote.*.mirror configuration option
2008-05-05 19:15:39 -07:00
Adam Simpkins 0724cb86c5 graph API: eliminate unnecessary indentation
This change improves the calculation of the amount of horizontal
padding, so that there is always exactly 1 space of padding.
Previously, most commits had 3 spaces of padding, but commits that
didn't have any children in the graph had only 1 space of padding.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 18:55:39 -07:00
Adam Simpkins 7fefda5cc7 log and rev-list: add --graph option
This new option causes a text-based representation of the history to be
printed to the left of the normal output.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 18:46:35 -07:00
Adam Simpkins c12172d2ea Add history graph API
This new API allows the commit history to be displayed as a text-based
graphical representation.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 17:56:36 -07:00
Adam Simpkins 885cf80899 revision API: split parent rewriting and parent printing options
This change allows parent rewriting to be performed without causing
the log and rev-list commands to print the parents.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 17:38:22 -07:00
Jörg Sommer 2b3e60c245 post-merge: Add it's not executed if merge failed.
Signed-off-by: J��rg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 17:30:23 -07:00
Gerrit Pape ee831f7ddf git-bisect.sh: don't accidentally override existing branch "bisect"
If a branch named "bisect" or "new-bisect" already was created in the
repo by other means than git bisect, doing a git bisect used to override
the branch without a warning.  Now if the branch "bisect" or
"new-bisect" already exists, and it was not created by git bisect itself,
git bisect start fails with an appropriate error message.  Additionally,
if checking out a new bisect state fails due to a merge problem, git
bisect cleans up the temporary branch "new-bisect".

The accidental override has been noticed by Andres Salomon, reported
through
 http://bugs.debian.org/478647

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 17:18:20 -07:00
Gustaf Hendeby da060c67ae Documentation: Add create-ignore to git svn manual
Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 16:54:16 -07:00
Gustaf Hendeby c4c66b2669 git-svn: Make create-ignore use git add -f
When having a svn:ignore that ignores the .gitignore file the -f
option to git add must be used to avoid git complaining about adding
an ignored file and hence stop the process of creating .gitignores.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 16:54:16 -07:00
Miklos Vajna 62a64d1a6b INSTALL: add a note about GNU interactive tools has been renamed
In recent versions GNU's git has been renamed to gnuit, document this
while talking about how to resolve the conflict.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 16:53:54 -07:00
Bryan Donlan 4a7aaccd83 Rename the test trash directory to contain spaces.
In order to help prevent regressions in the future, rename the trash directory
for all tests to contain spaces. This patch also corrects two failures that
were caused or exposed by this change.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:37:51 -07:00
Bryan Donlan f69e836fab Fix tests breaking when checkout path contains shell metacharacters
This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.

The majority of git svn tests used the idiom

  test_expect_success "title" "test script using $svnrepo"

These were changed to have the test script in single-quotes:

  test_expect_success "title" 'test script using "$svnrepo"'

which unfortunately makes the patch appear larger than it really is.

One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw

  * expecting success:
	test script using /path/to/git/t/trash/svnrepo

but now it is:

  * expecting success:
	test script using "$svnrepo"

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:37:02 -07:00
Bryan Donlan 0e46e70462 Don't use the 'export NAME=value' in the test scripts.
This form is not portable across all shells, so replace instances of:

  export FOO=bar

with:

  FOO=bar
  export FOO

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:01 -07:00
Bryan Donlan cdf3ec01ac lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:01 -07:00
Bryan Donlan b480f5cf1a test-lib.sh: Fix some missing path quoting
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:01 -07:00
Bryan Donlan 7f0475c308 Use test_set_editor in t9001-send-email.sh
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:01 -07:00
Bryan Donlan 02b3566003 test-lib.sh: Add a test_set_editor function to safely set $VISUAL
In particular, this function correctly handles cases where the pwd contains
spaces, quotes, and other troublesome metacharacters.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:01 -07:00
Bryan Donlan 065096c2b5 git-send-email.perl: Handle shell metacharacters in $EDITOR properly
This fixes the git-send-perl semantics for launching an editor when
$GIT_EDITOR (or friends) contains shell metacharacters to match
launch_editor() in builtin-tag.c. If we use the current approach
(sh -c '$0 $@' "$EDITOR" files ...), we see it fails when $EDITOR has
shell metacharacters:

  $ sh -x -c '$0 $@' "$VISUAL" "foo"
  + "$FAKE_EDITOR" foo
  "$FAKE_EDITOR": 1: "$FAKE_EDITOR": not found

Whereas builtin-tag.c will invoke sh -c "$EDITOR \"$@\"".

Thus, this patch changes git-send-email.perl to use the same method as the
C utilities, and additionally updates t/t9001-send-email.sh to test for
this bug.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:00 -07:00
Bryan Donlan e5c349ba11 config.c: Escape backslashes in section names properly
If an element of the configuration key name other than the first or last
contains a backslash, it is not escaped on output, but is treated as an
escape sequence on input. Thus, the backslash is lost when re-loading
the configuration.

This patch corrects this by having backslashes escaped properly, and
introduces a new test for this bug.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:00 -07:00
Bryan Donlan 97b88dd58c git-rebase.sh: Fix --merge --abort failures when path contains whitespace
Also update t/t3407-rebase-abort.sh to expose the bug.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 14:17:00 -07:00
Avery Pennarun 9e72732e4b git-svn: add documentation for --add-author-from option.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:42:29 -07:00
Avery Pennarun 6aa9ba14a0 git-svn: Add --add-author-from option.
This option adds a From: line (based on the commit's author information)
at the beginning of the body of the commit log message when sending to
svn, if a From: or Signed-off-by: header does not exist.

This, combined with --use-log-author, can retain the author field of commits
through a round trip from git to svn and back.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:42:29 -07:00
Avery Pennarun de451dff15 git-svn: add documentation for --use-log-author option.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:42:29 -07:00
Paolo Bonzini a83619d692 add special "matching refs" refspec
This patch provides a way to specify "push matching heads" using a
special refspec ":".  This is useful because it allows "push = +:"
as a way to specify that matching refs will be pushed but, in addition,
forced updates will be allowed, which was not possible before.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:39 -07:00
Christian Couder a5af0e2c55 Documentation: rename "hooks.txt" to "githooks.txt" and make it a man page
Also now "gitcli(5)" becomes "gitcli(7)".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:34 -07:00
Junio C Hamano 050288d52d is_racy_timestamp(): do not check timestamp for gitlinks
Because we do not even check the timestamp to determie if a gitlink
is up to date or not, triggering the racy-timestamp check for gitlinks
does not make sense.

This fixes the recently added test in t7506.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Junio C Hamano 451244d724 diff-lib.c: rename check_work_tree_entity()
The function is about checking for removed work tree item, so name it
accordingly to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Junio C Hamano 1392a37721 diff: a submodule not checked out is not modified
948dd34 (diff-index: careful when inspecting work tree items, 2008-03-30)
made the work tree check careful not to be fooled by a new directory that
exists at a place the index expects a blob.  For such a change to be a
typechange from blob to submodule, the new directory has to be a
repository.

However, if the index expects a submodule there, we should not insist the
work tree entity to be a repository --- a simple directory that is not a
full fledged repository (even an empty directory would do) should be
considered an unmodified subproject, because that is how a superproject
with a submodule is checked out sparsely by default.

This makes the function check_work_tree_entity() even more careful not to
report a submodule that is not checked out as removed.  It fixes the
recently added test in t4027.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin 27bfd950c1 Add t7506 to test submodule related functions for git-status
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin 7c08a2a637 t4027: test diff for submodule with empty directory
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Heikki Orsila c697ad143b Cleanup xread() loops to use read_in_full()
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 22:15:25 -07:00
Junio C Hamano 471793f91e Merge branch 'maint'
* maint:
  checkout: don't rfc2047-encode oneline on detached HEAD
  filter-branch: Documentation fix.
2008-05-03 22:15:09 -07:00
Junio C Hamano 6233a5210e Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  filter-branch: Documentation fix.
2008-05-03 18:55:33 -07:00
Jeff King 278863180a checkout: don't rfc2047-encode oneline on detached HEAD
When calling pretty_print_commit, there is an implicit
assumption that passing in a non-NULL "subject" variable
for oneline or email formats means that the output is part
of a subject and therefore "subject" to rfc2047 encoding.
This is not the desired effect when reporting the movement
of detached HEAD.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:47:18 -07:00
Nicolas Pitre 70baf5d41a pack-objects: fix early eviction for max depth delta objects
The 'depth' variable doesn't reflect the actual maximum depth used
when other objects already depend on the current one.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:38 -07:00
Nicolas Pitre ed4a9031ea pack-objects: allow for early delta deflating
When the delta data is cached in memory until it is written to a pack
file on disk, it is best to compress it right away in find_deltas() for
the following reasons:

  - we have to compress that data anyway;

  - this allows for caching more deltas with the same cache size limit;

  - compression is potentially threaded.

This last point is especially relevant for SMP run time.  For example,
repacking the Linux repo on a quad core processor using 4 threads with
all default settings produce the following results before this change:

	real    2m27.929s
	user    4m36.492s
	sys     0m3.091s

And with this change applied:

	real    2m13.787s
	user    4m37.486s
	sys     0m3.159s

So the actual execution time stayed more or less the same but the
wall clock time is shorter.

This is however not a good thing to do when generating a pack for
network transmission.  In that case, the network is most likely to
throttle the data throughput, so it is best to make find_deltas()
faster in order to start writing data ASAP since we can afford
spending more time between writes to compress the data
at that point.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:38 -07:00
Nicolas Pitre 30ebb40aa1 pack-objects: move compression code in a separate function
A later patch will make use of that code too.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:38 -07:00
Nicolas Pitre 2c5ef82463 pack-objects: clean up write_object() a bit
... for improved readability.  No functional changes.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:38 -07:00
Nicolas Pitre bcd7954e21 pack-objects: simplify the condition associated with --all-progress
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:38 -07:00
Nicolas Pitre a7de713089 pack-objects: remove some double negative logic
Parsing !no_reuse_delta everywhere makes my brain spend extra
cycles wondering each time.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:35:37 -07:00