1
0
mirror of https://github.com/git/git.git synced 2024-09-30 13:42:06 +02:00
Commit Graph

10925 Commits

Author SHA1 Message Date
Jonas Fonseca
e4465f0e71 fsck --lost-found writes to subdirectories in .git/lost-found/
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:08:58 -07:00
Johannes Schindelin
72909befaa Add diff-option --ext-diff
To prevent funky games with external diff engines, git-log and
friends prevent external diff engines from being called. That makes
sense in the context of git-format-patch or git-rebase.

However, for "git log -p" it is not so nice to get the message
that binary files cannot be compared, while "git diff" has no
problems with them, if you provided an external diff driver.

With this patch, "git log --ext-diff -p" will do what you expect,
and the option "--no-ext-diff" can be used to override that
setting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:05:55 -07:00
Johannes Schindelin
c401b33c34 Document git-filter-branch
This moves the documentation in git-filter-branch.sh to its own
man page, with a few touch ups (incorporating comments by Frank
Lichtenheld).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:04:49 -07:00
Uwe Kleine-König
843103d693 stash: end commit log with a newline
If I do

	git cat-file commit $commitid

for a commit created by stash, the next prompt starts directly after the
shortlog of HEAD.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:04:49 -07:00
Junio C Hamano
14a4091c16 Update draft Release Notes for 1.5.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:04:38 -07:00
Miklos Vajna
ed5f07a6fd Document -<n> for git-format-patch
The -<n> option was not mentioned in git-format-patch's manpage till
now. Fix this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 19:02:13 -07:00
Johannes Schindelin
f8d6957628 glossary: add 'reflog'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 13:56:07 -07:00
Johannes Schindelin
3cb567386d diff --no-index: fix --name-status with added files
Without this patch, an added file would be reported as /dev/null.

Noticed by David Kastrup.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 13:44:30 -07:00
Jim Meyering
9cb18f56fd Don't smash stack when $GIT_ALTERNATE_OBJECT_DIRECTORIES is too long
There is no restriction on the length of the name returned by
get_object_directory, other than the fact that it must be a stat'able
git object directory.  That means its name may have length up to
PATH_MAX-1 (i.e., often 4095) not counting the trailing NUL.

Combine that with the assumption that the concatenation of that name and
suffixes like "/info/alternates" and "/pack/---long-name---.idx" will fit
in a buffer of length PATH_MAX, and you see the problem.  Here's a fix:

    sha1_file.c (prepare_packed_git_one): Lengthen "path" buffer
    so we are guaranteed to be able to append "/pack/" without checking.
    Skip any directory entry that is too long to be appended.
    (read_info_alternates): Protect against a similar buffer overrun.

Before this change, using the following admittedly contrived environment
setting would cause many git commands to clobber their stack and segfault
on a system with PATH_MAX == 4096:

  t=$(perl -e '$s=".git/objects";$n=(4096-6-length($s))/2;print "./"x$n . $s')
  export GIT_ALTERNATE_OBJECT_DIRECTORIES=$t
  touch g
  ./git-update-index --add g

If you run the above commands, you'll soon notice that many
git commands now segfault, so you'll want to do this:

  unset GIT_ALTERNATE_OBJECT_DIRECTORIES

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03 12:25:29 -07:00
Shawn O. Pearce
f10c1c7743 Merge branch 'maint'
* maint:
  git-gui: properly popup error if gitk should be started but is not installed
2007-07-03 10:42:43 -04:00
Junio C Hamano
2ecf3cee07 Mark disused commit walkers officially deprecated.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.3-rc0
2007-07-02 23:29:54 -07:00
Junio C Hamano
fcb10a9648 git-stash: make "save" the default action again.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 23:15:45 -07:00
Junio C Hamano
5be60078c9 Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 22:52:14 -07:00
Linus Torvalds
36e5e70e0f Start deprecating "git-command" in favor of "git command"
I realize that a lot of people use the "git-xyzzy" format, and we have
various historical reasons for it, but I also think that most people have
long since started thinking of the git command as a single command with
various subcommands, and we've long had the documentation talk about it
that way.

Slowly migrating away from the git-xyzzy format would allow us to
eventually no longer install hundreds of binaries (even if most of them
are symlinks or hardlinks) in users $PATH, and the _original_ reasons for
it (implementation issues and bash completion) are really long long gone.

Using "git xyzzy" also has some fundamental advantages, like the ability
to specify things like paging ("git -p xyzzy") and making the whole notion
of aliases act like other git commands (which they already do, but they do
*not* have a "git-xyzzy" form!)

Anyway, while actually removing the "git-xyzzy" things is not practical
right now, we can certainly start slowly to deprecate it internally inside
git itself - in the shell scripts we use, and the test vectors.

This patch adds a "remove-dashes" makefile target, which does that. It
isn't particularly efficient or smart, but it *does* successfully rewrite
a lot of our shell scripts to use the "git xyzzy" form for all built-in
commands.

(For non-builtins, the "git xyzzy" format implies an extra execve(), so
this script leaves those alone).

So apply this patch, and then run

	make remove-dashes
	make test
	git commit -a

to generate a much larger patch that actually starts this transformation.

(The only half-way subtle thing about this is that it also fixes up
git-filter-branch.sh for the new world order by adding quoting around
the use of "git-commit-tree" as an argument. It doesn't need it in that
format, but when changed into "git commit-tree" it is no longer a single
word, and the quoting maintains the old behaviour).

NOTE! This does not yet mean that you can actually stop installing the
"git-xyzzy" binaries for the builtins. There are some remaining places
that want to use the old form, this just removes the most obvious ones
that can easily be done automatically.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 22:39:10 -07:00
Junio C Hamano
3b0d9992ee Merge branch 'jo/init'
* jo/init:
  Quiet the output from git-init when cloning, if requested.
  Add an option to quiet git-init.
2007-07-02 21:48:08 -07:00
Johannes Schindelin
68f6c019fd git-fsck: add --lost-found option
With this option, dangling objects are not only reported, but also
written to .git/lost-found/commit/ or .git/lost-found/other/. This
option implies '--full' and '--no-reflogs'.

'git fsck --lost-found' is meant as a replacement for git-lost-found.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 21:34:12 -07:00
Junio C Hamano
1a6f399999 Merge branch 'maint'
* maint:
  Correctly document the name of the global excludes file configuration
2007-07-02 21:05:59 -07:00
Adam Roben
dbd2144736 format-patch: Add format.subjectprefix config option
This change lets you use the format.subjectprefix config option to override the
default subject prefix.

Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 21:05:45 -07:00
Johannes Sixt
05dcd69891 Test 'git add' for unmerged entries when core.symlinks=false.
In 20314271679e169f324c118c69c8d9e0399feec9 git add was fixed if unmerged
entries are in the index and core.filemode=false. core.symlinks=false is
a similar case, which touches the same code path. Here is a test that
makes sure that the symlink property in the index is preserved, too.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 20:58:16 -07:00
Junio C Hamano
098e711e6c "git-push $URL" without refspecs pushes only matching branches
When "git push" is run without any refspec (neither on the
command line nor in the config), we used to push "matching refs"
in the sense that anything under refs/ hierarchy that exist on
both ends were updated.  This used to be a sane default for
publishing your repository to another back when we did not have
refs/remotes/ hierarchy, but it does not make much sense these
days.

This changes the semantics to push only "matching branches".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 20:57:45 -07:00
Michael Hendricks
e8964a5b91 Correctly document the name of the global excludes file configuration
Signed-off-by: Michael Hendricks <michael@ndrix.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 20:54:01 -07:00
Junio C Hamano
b941ffac50 Merge branch 'maint'
* maint:
  Make git-prune submodule aware (and fix a SEGFAULT in the process)
2007-07-02 17:12:48 -07:00
Andy Parkins
8d2244ba74 Make git-prune submodule aware (and fix a SEGFAULT in the process)
I ran git-prune on a repository and got this:

 $ git-prune
 error: Object 228f8065b930120e35fc0c154c237487ab02d64a is a blob, not a commit
 Segmentation fault (core dumped)

This repository was a strange one in that it was being used to provide
its own submodule.  That is, the repository was cloned into a
subdirectory, an independent branch checked out in that subdirectory,
and then it was marked as a submodule.  git-prune then failed in the
above manner.

The problem was that git-prune was not submodule aware in two areas.

Linus said:

 > So what happens is that something traverses a tree object, looks at each
 > entry, sees that it's not a tree, and tries to look it up as a blob. But
 > subprojects are commits, not blobs, and then when you look at the object
 > more closely, you get the above kind of object type confusion.

and included a patch to add an S_ISGITLINK() test to reachable.c's
process_tree() function.  That fixed the first git-prune error, and
stopped it from trying to process the gitlink entries in trees as if
they were pointers to other trees (and of course failing, because
gitlinks _aren't_ trees).  That part of this patch is his.

The second area is add_cache_refs().  This is called before starting the
reachability analysis, and was calling lookup_blob() on every object
hash found in the index.  However, it is no longer true that every hash
in the index is a pointer to a blob, some of them are gitlinks, and are
not backed by any object at all, they are commits in another repository.
Normally this bug was not causing any problems, but in the case of the
self-referencing repository described above, it meant that the gitlink
hash was being marked as being of type OBJ_BLOB by add_cache_refs() call
to lookup_blob().  Then later, because that hash was also pointed to by
a ref, add_one_ref() would treat it as a commit; lookup_commit() would
return a NULL because that object was already noted as being an
OBJ_BLOB, not an OBJ_COMMIT; and parse_commit_buffer() would SEGFAULT on
that NULL pointer.

The fix made by this patch is to not blindly call lookup_blob() in
reachable.c's add_cache_refs(), and instead skip any index entries that
are S_ISGITLINK().

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 16:41:18 -07:00
Junio C Hamano
1fd81efad0 Merge branch 'ew/svn'
* ew/svn:
  git-svn: allow dcommit to retain local merge information
2007-07-02 01:46:22 -07:00
Junio C Hamano
7425dcc95e Merge branch 'ns/stash'
* ns/stash:
  Documentation: quote {non-attributes} for asciidoc
  git-stash: don't complain when listing in a repo with no stash
  git-stash: fix "can't shift that many" with no arguments
  git-stash: fix "no arguments" case in documentation
  git-stash: require "save" to be explicit and update documentation
  Document git-stash
  Add git-stash script
2007-07-02 01:45:57 -07:00
Junio C Hamano
f36db54905 Merge branch 'js/rebase'
* js/rebase:
  Teach rebase -i about --preserve-merges
  rebase -i: provide reasonable reflog for the rebased branch
  rebase -i: several cleanups
  ignore git-rebase--interactive
  Teach rebase an interactive mode
  Move the pick_author code to git-sh-setup
2007-07-02 01:45:47 -07:00
Junio C Hamano
e1bc8dc66d Merge branch 'jc/diffcore'
* jc/diffcore:
  diffcore-delta.c: Ignore CR in CRLF for text files
  diffcore-delta.c: update the comment on the algorithm.
  diffcore_filespec: add is_binary
  diffcore_count_changes: pass diffcore_filespec
2007-07-02 01:45:12 -07:00
Jeff King
792d2370f9 Documentation: minor cleanups to branch/checkout wording
Change "to made" to "made to", which is a typo. Use "reflog"
instead of "ref log", which is used elsewhere throughout the
documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:45 -07:00
Jeff King
967506bbbd Documentation: quote {non-attributes} for asciidoc
Asciidoc treats {foo} as an attribute to be substituted; if
'foo' doesn't exist as an attribute, then the entire line
gets dropped. When the literal {foo} is desired, \{foo} is
required.

The exceptions to this rule are:
  - inside literal blocks
  - if the 'foo' contains non-alphanumeric characters (e.g.,
    {foo|bar} is assumed not to be an attribute)

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Johannes Schindelin
a2f8028d3d Make '!' aliases more useful
When an alias starts with an exclamation mark, the rest is interpreted
as a shell command. However, all arguments passed to git used to be
ignored.

Now you can have an alias like

	$ git config alias.e '!echo'

and

	$ git e Hello World

does what you expect it to do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Matthias Lederhofer
7627943a1b getenv/setenv: use constants if available
There were places using "GIT_DIR" instead of GIT_DIR_ENVIRONMENT and
"GIT_CONFIG" instead of CONFIG_ENVIRONMENT.  This makes it easier to
find all places touching an environment variable using git grep or
similar tools.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Sven Verdoolaege
59c93929c8 git-clone: fetch possibly detached HEAD over dumb http
git-clone supports cloning from a repo with detached HEAD,
but if this HEAD is not behind any branch tip then it
would not have been fetched over dumb http, resulting in a

	fatal: Not a valid object name HEAD

Since 928c210a, this would also happen on a http repo
with a HEAD that is a symbolic link where someone has
forgotton to run update-server-info.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Emil Medve
bffe71f4cd git-submodule: Instead of using only annotated tags, use any tags.
Some repositories might not use/have annotated tags (for example the
ones created with git-cvsimport) and git-submodule status might fail
because git-describe might fail to find a tag.  This change allows the
status of a submodule to be described/displayed relative to lightweight
tags as well.

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Sven Verdoolaege
ecda072380 git-submodule: provide easy way of adding new submodules
To make a submodule effectively usable, the path and
a URL where the submodule can be cloned need to be stored
in .gitmodules.  This subcommand takes care of setting
this information after cloning the new submodule.
Only the index is updated, so, if needed, the user may still
change the URL or switch to a different branch of the submodule
before committing.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Junio C Hamano
444649e5a8 Update public documentation links for 1.5.2.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:14:00 -07:00
Junio C Hamano
9a54463a8a Merge 1.5.2.3 in
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:12:57 -07:00
Junio C Hamano
57887443c2 GIT 1.5.2.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.2.3
2007-07-02 00:35:58 -07:00
Jeff King
9a5391cf18 Documentation: quote {non-attributes} for asciidoc
Asciidoc treats {foo} as an attribute to be substituted; if
'foo' doesn't exist as an attribute, then the entire line
gets dropped. When the literal {foo} is desired, \{foo} is
required.

The exceptions to this rule are:
  - inside literal blocks
  - if the 'foo' contains non-alphanumeric characters (e.g.,
    {foo|bar} is assumed not to be an attribute)

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 23:33:52 -07:00
Jeff King
401de4057a git-stash: don't complain when listing in a repo with no stash
Previously, the git-log invocation would complain if a repo
had not had any stashes created in it yet:

$ git-init
$ git-stash
fatal: ambiguous argument 'refs/stash': unknown revision or
  path not in the working tree.
Use '--' to separate paths from revisions

Instead, we only call git-log if we actually have a
refs/stash. We could alternatively create the ref when any
stash command is called, but it's better for the 'list'
command to not require write access to the repo.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 21:45:13 -07:00
Jeff King
006a866464 git-stash: fix "can't shift that many" with no arguments
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 21:38:27 -07:00
Jeff King
aaca4914e9 git-stash: fix "no arguments" case in documentation
Commit 9488e875 changed this from 'save' to 'list', but
missed this spot in the documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 21:38:05 -07:00
Junio C Hamano
9488e87586 git-stash: require "save" to be explicit and update documentation
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 15:29:01 -07:00
Junio C Hamano
71e55854fd Merge branch 'rs/diff'
* rs/diff:
  diff: round down similarity index
  diffcore-rename: don't change similarity index based on basename equality
2007-07-01 14:58:09 -07:00
Junio C Hamano
660d579d6f Merge branch 'jc/quote'
* jc/quote:
  Add core.quotepath configuration variable.
2007-07-01 14:57:51 -07:00
Brian Gernhardt
9a3c6f7ba7 Fix t5516-fetch for systems where wc -l outputs whitespace.
When wc outputs whitespace, the test "$(command | wc -l)" = 1 is
broken because "   1" != "1".  Let the shell eat the whitespace by
using test 1 = $(command | wc -l) instead.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 14:47:20 -07:00
Johannes Schindelin
2031427167 git add: respect core.filemode with unmerged entries
When a merge left unmerged entries, git add failed to pick up the
file mode from the index, when core.filemode == 0. If more than one
unmerged entry is there, the order of stage preference is 2, 1, 3.

Noticed by Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 13:26:05 -07:00
Johannes Schindelin
a44c426709 t7004: ship trustdb to avoid gpg warnings
This avoids warning messages from gpg while verifying the tags; without it,
the program complains that the key is not certified with a trusted signature.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 13:25:55 -07:00
Junio C Hamano
96c48153c9 Merge branch 'ml/worktree'
* ml/worktree:
  make git barf when an alias changes environment variables
2007-07-01 13:11:01 -07:00
Junio C Hamano
0305b63654 Merge branch 'ei/worktree+filter'
* ei/worktree+filter:
  filter-branch: always export GIT_DIR if it is set
  setup_git_directory: fix segfault if repository is found in cwd
  test GIT_WORK_TREE
  extend rev-parse test for --is-inside-work-tree
  Use new semantics of is_bare/inside_git_dir/inside_work_tree
  introduce GIT_WORK_TREE to specify the work tree
  test git rev-parse
  rev-parse: introduce --is-bare-repository
  rev-parse: document --is-inside-git-dir
2007-07-01 13:10:42 -07:00
Junio C Hamano
cd5ada993d Merge branch 'fl/config'
* fl/config:
  config: add support for --bool and --int while setting values
2007-06-30 23:49:01 -07:00