Code

git.git
15 years agoFix parsing of @{-1}@{1}
Johannes Schindelin [Sat, 17 Jan 2009 18:08:12 +0000 (19:08 +0100)]
Fix parsing of @{-1}@{1}

To do that, Git no longer looks forward for the '@{' corresponding to the
closing '}' but backward, and dwim_ref() as well as dwim_log() learnt
about the @{-<N>} notation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agointerpret_nth_last_branch(): avoid traversing the reflog twice
Junio C Hamano [Mon, 19 Jan 2009 08:04:25 +0000 (00:04 -0800)]
interpret_nth_last_branch(): avoid traversing the reflog twice

You can have quite a many reflog entries, but you typically won't recall
which branch you were on after switching branches for more than several
times.

Instead of reading the reflog twice, this reads the branch switching event
and keeps as many entries as the user asked from the latest such entries,
which is the minimum required to be able to switch back to the branch we
were recently on.

[jc: improvements from Dscho squashed in]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: implement "-" abbreviation, add docs and tests
Thomas Rast [Sat, 17 Jan 2009 16:09:56 +0000 (17:09 +0100)]
checkout: implement "-" abbreviation, add docs and tests

Have '-' mean the same as '@{-1}', i.e., the last branch we were on.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosha1_name: support @{-N} syntax in get_sha1()
Thomas Rast [Sat, 17 Jan 2009 16:09:55 +0000 (17:09 +0100)]
sha1_name: support @{-N} syntax in get_sha1()

Let get_sha1() parse the @{-N} syntax, with docs and tests.

Note that while @{-1}^2, @{-2}~5 and such are supported, @{-1}@{1} is
currently not allowed.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosha1_name: tweak @{-N} lookup
Thomas Rast [Sat, 17 Jan 2009 16:09:54 +0000 (17:09 +0100)]
sha1_name: tweak @{-N} lookup

Have the lookup only look at "interesting" checkouts, meaning those
that tell you "Already on ..." don't count even though they also cause
a reflog entry.

Let interpret_nth_last_branch() return the number of characters
parsed, so that git-checkout can verify that the branch spec was
@{-N}, not @{-1}^2 or something like that.  (The latter will be added
later.)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: implement "@{-N}" shortcut name for N-th last branch
Junio C Hamano [Sat, 17 Jan 2009 16:09:53 +0000 (17:09 +0100)]
checkout: implement "@{-N}" shortcut name for N-th last branch

Implement a shortcut @{-N} for the N-th last branch checked out, that
works by parsing the reflog for the message added by previous
git-checkout invocations.  We expand the @{-N} to the branch name, so
that you end up on an attached HEAD on that branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 16 Jan 2009 02:52:35 +0000 (18:52 -0800)]
Merge branch 'maint'

* maint:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Thu, 15 Jan 2009 22:33:54 +0000 (14:33 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done

15 years agot3404: Add test case for auto-amending only edited commits after "edit"
Stephan Beyer [Thu, 15 Jan 2009 12:56:16 +0000 (13:56 +0100)]
t3404: Add test case for auto-amending only edited commits after "edit"

Add a test case for the bugfix introduced by commit c14c3c82d
"git-rebase--interactive: auto amend only edited commit".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3404: Add test case for aborted --continue after "edit"
Stephan Beyer [Thu, 15 Jan 2009 12:56:15 +0000 (13:56 +0100)]
t3404: Add test case for aborted --continue after "edit"

Add a test case for the bugfix introduced by commit 8beb1f33d
"git-rebase-interactive: do not squash commits on abort".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3501: check that commits are actually done
Stephan Beyer [Thu, 15 Jan 2009 13:03:17 +0000 (14:03 +0100)]
t3501: check that commits are actually done

The basic idea of t3501 is to check whether revert
and cherry-pick works on renamed files.
But as there is no pure cherry-pick/revert test, it is
good to also check if commits are actually done in that
scenario.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Add comments to remind about required arguments
Ted Pavlic [Thu, 15 Jan 2009 16:02:23 +0000 (11:02 -0500)]
bash-completion: Add comments to remind about required arguments

Add a few simple comments above commands that take arguments. These
comments are meant to remind developers of potential problems that
can occur when the script is sourced on systems with "set -u." Any
function which requires arguments really ought to be called with
explicit arguments given.

Also adds a #!bash to the top of bash completions so that editing
software can always identify that the file is of sh type.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Try bash completions before simple filetype
Ted Pavlic [Thu, 15 Jan 2009 16:02:22 +0000 (11:02 -0500)]
bash-completion: Try bash completions before simple filetype

When a git completion is not found, a bash shell should try bash-type
completions first before going to standard filetype completions. This
patch adds "-o bashdefault" to the completion line. If that option is
not available, it uses the old method.

This behavior was inspired by Mercurial's bash completion script.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Support running when set -u is enabled
Ted Pavlic [Thu, 15 Jan 2009 16:02:21 +0000 (11:02 -0500)]
bash-completion: Support running when set -u is enabled

Under "set -u" semantics, it is an error to access undefined variables.
Some user environments may enable this setting in the interactive shell.

In any context where the completion functions access an undefined
variable, accessing a default empty string (aka "${1-}" instead of "$1")
is a reasonable way to code the function, as it silences the undefined
variable error while still supplying an empty string.

In this patch, functions that should always take an argument still use
$1. Functions that have optional arguments use ${1-}.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 15 Jan 2009 06:58:46 +0000 (22:58 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.6.1.1
  Make t3411 executable
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"

15 years agoUpdate draft release notes to 1.6.1.1
Junio C Hamano [Thu, 15 Jan 2009 06:43:04 +0000 (22:43 -0800)]
Update draft release notes to 1.6.1.1

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Thu, 15 Jan 2009 06:34:05 +0000 (22:34 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"

15 years agoMake t3411 executable
Miklos Vajna [Thu, 15 Jan 2009 00:33:19 +0000 (01:33 +0100)]
Make t3411 executable

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix handling of multiple untracked files for git mv -k
Michael J Gruber [Wed, 14 Jan 2009 17:03:22 +0000 (18:03 +0100)]
fix handling of multiple untracked files for git mv -k

The "-k" option to "git mv" should allow specifying multiple untracked
files. Currently, multiple untracked files raise an assertion if they
appear consecutively as arguments. Fix this by decrementing the loop
index after removing one entry from the array of arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd test cases for "git mv -k"
Michael J Gruber [Wed, 14 Jan 2009 17:03:21 +0000 (18:03 +0100)]
add test cases for "git mv -k"

Add test cases for ignoring nonexisting and untracked files using the -k
option to "git mv". There is one known breakage related to multiple
untracked files specfied as consecutive arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate 1.6.2 draft release notes
Junio C Hamano [Wed, 14 Jan 2009 07:41:32 +0000 (23:41 -0800)]
Update 1.6.2 draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 14 Jan 2009 07:12:51 +0000 (23:12 -0800)]
Merge branch 'maint'

* maint:
  fast-import: Cleanup mode setting.
  Git.pm: call Error::Simple() properly

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 14 Jan 2009 07:10:50 +0000 (23:10 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  fast-import: Cleanup mode setting.
  Git.pm: call Error::Simple() properly

15 years agoMerge branch 'nd/grep-assume-unchanged'
Junio C Hamano [Wed, 14 Jan 2009 07:10:02 +0000 (23:10 -0800)]
Merge branch 'nd/grep-assume-unchanged'

* nd/grep-assume-unchanged:
  grep: grep cache entries if they are "assume unchanged"
  grep: support --no-ext-grep to test builtin grep

15 years agoMerge branch 'as/maint-shortlog-cleanup'
Junio C Hamano [Wed, 14 Jan 2009 07:10:00 +0000 (23:10 -0800)]
Merge branch 'as/maint-shortlog-cleanup'

* as/maint-shortlog-cleanup:
  builtin-shortlog.c: use string_list_append(), and don't strdup unnecessarily

15 years agoMerge branch 'jc/maint-ls-tree'
Junio C Hamano [Wed, 14 Jan 2009 07:09:57 +0000 (23:09 -0800)]
Merge branch 'jc/maint-ls-tree'

* jc/maint-ls-tree:
  Document git-ls-tree --full-tree
  ls-tree: add --full-tree option

15 years agoMerge branch 'js/bundle-tags'
Junio C Hamano [Wed, 14 Jan 2009 07:09:50 +0000 (23:09 -0800)]
Merge branch 'js/bundle-tags'

* js/bundle-tags:
  bundle: allow rev-list options to exclude annotated tags

15 years agoMerge branch 'js/add-not-submodule'
Junio C Hamano [Wed, 14 Jan 2009 07:09:47 +0000 (23:09 -0800)]
Merge branch 'js/add-not-submodule'

* js/add-not-submodule:
  git add: do not add files from a submodule

15 years agoMerge branch 'pb/maint-git-pm-false-dir'
Junio C Hamano [Wed, 14 Jan 2009 07:09:42 +0000 (23:09 -0800)]
Merge branch 'pb/maint-git-pm-false-dir'

* pb/maint-git-pm-false-dir:
  Git.pm: correctly handle directory name that evaluates to "false"

15 years agoMerge branch 'pj/maint-ldflags'
Junio C Hamano [Wed, 14 Jan 2009 07:09:38 +0000 (23:09 -0800)]
Merge branch 'pj/maint-ldflags'

* pj/maint-ldflags:
  configure clobbers LDFLAGS

15 years agoMerge branch 'fe/cvsserver'
Junio C Hamano [Wed, 14 Jan 2009 07:09:35 +0000 (23:09 -0800)]
Merge branch 'fe/cvsserver'

* fe/cvsserver:
  cvsserver: change generation of CVS author names
  cvsserver: add option to configure commit message

15 years agoMerge branch 'js/maint-bisect-gitk'
Junio C Hamano [Wed, 14 Jan 2009 07:09:29 +0000 (23:09 -0800)]
Merge branch 'js/maint-bisect-gitk'

* js/maint-bisect-gitk:
  bisect view: call gitk if Cygwin's SESSIONNAME variable is set

15 years agoMerge branch 'np/no-loosen-prune-expire-now'
Junio C Hamano [Wed, 14 Jan 2009 07:09:24 +0000 (23:09 -0800)]
Merge branch 'np/no-loosen-prune-expire-now'

* np/no-loosen-prune-expire-now:
  objects to be pruned immediately don't have to be loosened

15 years agoMerge branch 'cb/maint-unpack-trees-absense'
Junio C Hamano [Wed, 14 Jan 2009 07:09:20 +0000 (23:09 -0800)]
Merge branch 'cb/maint-unpack-trees-absense'

* cb/maint-unpack-trees-absense:
  unpack-trees: remove redundant path search in verify_absent
  unpack-trees: fix path search bug in verify_absent
  unpack-trees: handle failure in verify_absent

15 years agoMerge branch 'mc/cd-p-pwd'
Junio C Hamano [Wed, 14 Jan 2009 07:09:13 +0000 (23:09 -0800)]
Merge branch 'mc/cd-p-pwd'

* mc/cd-p-pwd:
  git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X

15 years agoMerge branch 'mh/cherry-default'
Junio C Hamano [Wed, 14 Jan 2009 07:09:09 +0000 (23:09 -0800)]
Merge branch 'mh/cherry-default'

* mh/cherry-default:
  Documentation: clarify which parameters are optional to git-cherry
  git-cherry: make <upstream> parameter optional

15 years agofast-import: Cleanup mode setting.
Felipe Contreras [Wed, 14 Jan 2009 01:37:07 +0000 (03:37 +0200)]
fast-import: Cleanup mode setting.

"S_IFREG | mode" makes only sense for 0644 and 0755.

Even though doing (S_IFREG | mode) may not hurt when mode is any other
supported value, that is only true because S_IFREG mode bit happens to
be already on for S_IFLNK or S_IFGITLINK.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGit.pm: call Error::Simple() properly
Jay Soffian [Tue, 13 Jan 2009 22:41:35 +0000 (17:41 -0500)]
Git.pm: call Error::Simple() properly

The error message to Error::Simple() must be passed as a single argument.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 13 Jan 2009 09:25:55 +0000 (01:25 -0800)]
Merge branch 'maint'

* maint:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files

15 years agoMerge branch 'kk/maint-http-push' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:15:49 +0000 (01:15 -0800)]
Merge branch 'kk/maint-http-push' into maint

* kk/maint-http-push:
  http-push: support full URI in handle_remote_ls_ctx()

15 years agoMerge branch 'js/maint-merge-recursive-r-d-conflict' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:15:19 +0000 (01:15 -0800)]
Merge branch 'js/maint-merge-recursive-r-d-conflict' into maint

* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged

15 years agoMerge branch 'cb/maint-merge-recursive-fix' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:13:56 +0000 (01:13 -0800)]
Merge branch 'cb/maint-merge-recursive-fix' into maint

* cb/maint-merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file

Conflicts:
builtin-merge-recursive.c

15 years agoMerge branch 'ap/maint-apply-modefix' into maint
Junio C Hamano [Tue, 13 Jan 2009 08:56:40 +0000 (00:56 -0800)]
Merge branch 'ap/maint-apply-modefix' into maint

* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Tue, 13 Jan 2009 08:40:19 +0000 (00:40 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files

15 years agoAvoid spurious error messages on error mistakes.
Pierre Habouzit [Mon, 12 Jan 2009 23:09:36 +0000 (00:09 +0100)]
Avoid spurious error messages on error mistakes.

Prior to that, if the user chose "squash" as a first action, the stderr
looked like:

    grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory
    Cannot 'squash' without a previous commit

Now the first line is gone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix Documentation typos surrounding the word 'handful'.
Jon Loeliger [Mon, 12 Jan 2009 20:02:07 +0000 (14:02 -0600)]
Fix Documentation typos surrounding the word 'handful'.

Some instances replaced by "handful of", others use
the word "few", a couple get a slight rewording.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosha1_file: make "read_object" static
Christian Couder [Mon, 12 Jan 2009 17:42:24 +0000 (18:42 +0100)]
sha1_file: make "read_object" static

This function is only used from "sha1_file.c".

And as we want to add a "replace_object" hook in "read_sha1_file",
we must not let people bypass the hook using something other than
"read_sha1_file".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib/vim: change URL to point to the latest syntax files
Markus Heidelberg [Tue, 13 Jan 2009 02:10:26 +0000 (03:10 +0100)]
contrib/vim: change URL to point to the latest syntax files

Vim's SVN repository doesn't offer the latest runtime files, since
normally they are only updated there on a release. Though currently
there is no difference between the SVN and HTTP/FTP version of the git
syntax files.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib/examples/README: give an explanation of the status of these files
jidanni@jidanni.org [Tue, 13 Jan 2009 01:19:42 +0000 (09:19 +0800)]
contrib/examples/README: give an explanation of the status of these files

We attempt to give an explanation of the status of the files in this
directory.

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Jan 2009 07:29:26 +0000 (23:29 -0800)]
Merge branch 'maint'

* maint:
  Documentation/git-push.txt: minor: compress one option

15 years agoMerge branch 'mh/maint-sendmail-cc-doc' into maint
Junio C Hamano [Mon, 12 Jan 2009 07:27:29 +0000 (23:27 -0800)]
Merge branch 'mh/maint-sendmail-cc-doc' into maint

* mh/maint-sendmail-cc-doc:
  doc/git-send-email: mention sendemail.cc config variable

15 years agoMerge branch 'jc/maint-do-not-switch-to-non-commit' into maint
Junio C Hamano [Mon, 12 Jan 2009 07:24:42 +0000 (23:24 -0800)]
Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint

* jc/maint-do-not-switch-to-non-commit:
  git checkout: do not allow switching to a tree-ish that is not a commit

15 years agoDocumentation/git-push.txt: minor: compress one option
jidanni@jidanni.org [Mon, 12 Jan 2009 03:05:54 +0000 (11:05 +0800)]
Documentation/git-push.txt: minor: compress one option

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: add --authors-file test
Eric Wong [Sun, 11 Jan 2009 23:44:07 +0000 (15:44 -0800)]
git-svn: add --authors-file test

I'm not sure how often this functionality is used, but in case
it's not, having an extra test here will help catch breakage
sooner.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCleanup of unused symcache variable inside diff-lib.c
Kjetil Barvik [Sun, 11 Jan 2009 18:36:42 +0000 (19:36 +0100)]
Cleanup of unused symcache variable inside diff-lib.c

Commit c40641b77b0274186fd1b327d5dc3246f814aaaf, 'Optimize
symlink/directory detection' by Linus Torvalds, removed the 'char
*symcache' parameter to the has_symlink_leading_path() function.  This
made all variables currently named 'symcache' inside diff-lib.c
unnecessary.

This also let us throw away the 'struct oneway_unpack_data', and
instead directly use the 'struct rev_info *revs' member, which
was the only member left after removal of the 'symcache[] array'
member.  The 'struct oneway_unpack_data' was introduced by the
following commit:

  948dd346  "diff-files: careful when inspecting work tree items"

Impact: cleanup
        PATH_MAX bytes less memory stack usage in some cases

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: clean up TEST_PROGRAMS definition
Jeff King [Sun, 11 Jan 2009 11:25:06 +0000 (06:25 -0500)]
Makefile: clean up TEST_PROGRAMS definition

We try to keep lines under 80 characters, not to mention
that sticking a bunch of stuff on one line makes diffs
messier.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot7501-commit.sh: explicitly check that -F prevents invoking the editor
Adeodato Simó [Fri, 9 Jan 2009 17:30:05 +0000 (18:30 +0100)]
t7501-commit.sh: explicitly check that -F prevents invoking the editor

The "--signoff" test case in t7500-commit.sh was setting VISUAL while
using -F -, which indeed tested that the editor is not spawned with -F.
However, having it there was confusing, since there was no obvious reason
to the casual reader for it to be there.

This commits removes the setting of VISUAL from the --signoff test, and
adds in t7501-commit.sh a dedicated test case, where the rest of tests for
-F are.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Okay-then-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Use 'git add' completions for 'git stage'
Lee Marlow [Wed, 10 Dec 2008 19:39:18 +0000 (12:39 -0700)]
bash completion: Use 'git add' completions for 'git stage'

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Add '--intent-to-add' long option for 'git add'
Lee Marlow [Wed, 10 Dec 2008 19:39:17 +0000 (12:39 -0700)]
bash completion: Add '--intent-to-add' long option for 'git add'

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofilter-branch: add git_commit_non_empty_tree and --prune-empty.
Pierre Habouzit [Fri, 31 Oct 2008 09:12:21 +0000 (10:12 +0100)]
filter-branch: add git_commit_non_empty_tree and --prune-empty.

git_commit_non_empty_tree is added to the functions that can be run from
commit filters. Its effect is to commit only commits actually touching the
tree and that are not merge points either.

The option --prune-empty is added. It defaults the commit-filter to
'git_commit_non_empty_tree "$@"', and can be used with any other
combination of filters, except --commit-hook that must used
'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
usually to achieve the same result.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'mh/maint-sendmail-cc-doc'
Junio C Hamano [Wed, 7 Jan 2009 08:10:19 +0000 (00:10 -0800)]
Merge branch 'mh/maint-sendmail-cc-doc'

* mh/maint-sendmail-cc-doc:
  doc/git-send-email: mention sendemail.cc config variable

15 years agoMerge branch 'rs/diff-ihc'
Junio C Hamano [Wed, 7 Jan 2009 08:10:14 +0000 (00:10 -0800)]
Merge branch 'rs/diff-ihc'

* rs/diff-ihc:
  diff: add option to show context between close hunks

Conflicts:
Documentation/diff-options.txt

15 years agoMerge branch 'js/maint-merge-recursive-r-d-conflict'
Junio C Hamano [Wed, 7 Jan 2009 08:09:42 +0000 (00:09 -0800)]
Merge branch 'js/maint-merge-recursive-r-d-conflict'

* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged

15 years agoMerge branch 'mk/gitweb-feature'
Junio C Hamano [Wed, 7 Jan 2009 08:09:33 +0000 (00:09 -0800)]
Merge branch 'mk/gitweb-feature'

* mk/gitweb-feature:
  gitweb: unify boolean feature subroutines

15 years agoMerge branch 'cb/merge-recursive-fix'
Junio C Hamano [Wed, 7 Jan 2009 08:09:27 +0000 (00:09 -0800)]
Merge branch 'cb/merge-recursive-fix'

* cb/merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file

15 years agoMerge branch 'kk/maint-http-push'
Junio C Hamano [Wed, 7 Jan 2009 08:09:14 +0000 (00:09 -0800)]
Merge branch 'kk/maint-http-push'

* kk/maint-http-push:
  http-push: support full URI in handle_remote_ls_ctx()

15 years agoMerge branch 'mv/um-pdf'
Junio C Hamano [Wed, 7 Jan 2009 08:09:10 +0000 (00:09 -0800)]
Merge branch 'mv/um-pdf'

* mv/um-pdf:
  Add support for a pdf version of the user manual

15 years agoMerge branch 'jn/gitweb-blame'
Junio C Hamano [Wed, 7 Jan 2009 08:09:06 +0000 (00:09 -0800)]
Merge branch 'jn/gitweb-blame'

* jn/gitweb-blame:
  gitweb: cache $parent_commit info in git_blame()
  gitweb: A bit of code cleanup in git_blame()
  gitweb: Move 'lineno' id from link to row element in git_blame

15 years agoMerge branch 'wp/add-p-goto'
Junio C Hamano [Wed, 7 Jan 2009 08:09:00 +0000 (00:09 -0800)]
Merge branch 'wp/add-p-goto'

* wp/add-p-goto:
  Add 'g' command to go to a hunk
  Add subroutine to display one-line summary of hunks

15 years agostrbuf: instate cleanup rule in case of non-memory errors
René Scharfe [Tue, 6 Jan 2009 20:41:14 +0000 (21:41 +0100)]
strbuf: instate cleanup rule in case of non-memory errors

Make all strbuf functions that can fail free() their memory on error if
they have allocated it.  They don't shrink buffers that have been grown,
though.

This allows for easier error handling, as callers only need to call
strbuf_release() if A) the command succeeded or B) if they would have had
to do so anyway because they added something to the strbuf themselves.

Bonus hunk: document strbuf_readlink.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 7 Jan 2009 06:13:41 +0000 (22:13 -0800)]
Merge branch 'maint'

* maint:
  README: tutorial.txt is now called gittutorial.txt

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 7 Jan 2009 06:12:35 +0000 (22:12 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  README: tutorial.txt is now called gittutorial.txt

15 years agoMerge branch 'maint-1.5.6' into maint-1.6.0
Junio C Hamano [Wed, 7 Jan 2009 06:12:30 +0000 (22:12 -0800)]
Merge branch 'maint-1.5.6' into maint-1.6.0

* maint-1.5.6:
  README: tutorial.txt is now called gittutorial.txt

15 years agoREADME: tutorial.txt is now called gittutorial.txt
Joey Hess [Wed, 7 Jan 2009 04:23:37 +0000 (23:23 -0500)]
README: tutorial.txt is now called gittutorial.txt

Signed-off-by: Joey Hess <joey@gnu.kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfigure clobbers LDFLAGS
Paul Jarc [Mon, 5 Jan 2009 02:27:41 +0000 (21:27 -0500)]
configure clobbers LDFLAGS

In a couple of tests, configure clobbers the LDFLAGS value set by the
caller.  This patch fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 6 Jan 2009 00:10:52 +0000 (16:10 -0800)]
Merge branch 'maint'

* maint:
  Be consistent in switch usage for tar
  Use capitalized names where appropriate
  fast-export: print usage when no options specified

15 years agoremove trailing LF in die() messages
Alexander Potashev [Sun, 4 Jan 2009 18:38:41 +0000 (21:38 +0300)]
remove trailing LF in die() messages

LF at the end of format strings given to die() is redundant because
die already adds one on its own.

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agounpack-trees: remove redundant path search in verify_absent
Clemens Buchacher [Thu, 1 Jan 2009 20:54:33 +0000 (21:54 +0100)]
unpack-trees: remove redundant path search in verify_absent

Since the only caller, verify_absent, relies on the fact that o->pos
points to the next index entry anyways, there is no need to recompute
its position.

Furthermore, if a nondirectory entry were found, this would return too
early, because there could still be an untracked directory in the way.
This is currently not a problem, because verify_absent is only called
if the index does not have this entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agounpack-trees: fix path search bug in verify_absent
Clemens Buchacher [Thu, 1 Jan 2009 20:54:32 +0000 (21:54 +0100)]
unpack-trees: fix path search bug in verify_absent

Commit 0cf73755 (unpack-trees.c: assume submodules are clean during
check-out) changed an argument to verify_absent from 'path' to 'ce',
which is however shadowed by a local variable of the same name.

The bug triggers if verify_absent is used on a tree entry, for which
the index contains one or more subsequent directories of the same
length. The affected subdirectories are removed from the index. The
testcase included in this commit bisects to 55218834 (checkout: do not
lose staged removal), which reveals the bug in this case, but is
otherwise unrelated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agounpack-trees: handle failure in verify_absent
Clemens Buchacher [Thu, 1 Jan 2009 20:54:31 +0000 (21:54 +0100)]
unpack-trees: handle failure in verify_absent

Commit 203a2fe1 (Allow callers of unpack_trees() to handle failure)
changed the "die on error" behavior to "return failure code".
verify_absent did not handle errors returned by
verify_clean_subdirectory, however.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoBe consistent in switch usage for tar
Henrik Austad [Mon, 5 Jan 2009 15:25:37 +0000 (16:25 +0100)]
Be consistent in switch usage for tar

tar handles switches with and witout preceding '-', but the
documentation should be consistent nonetheless.

Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse capitalized names where appropriate
Henrik Austad [Mon, 5 Jan 2009 15:25:36 +0000 (16:25 +0100)]
Use capitalized names where appropriate

The Linux kernel and Emacs are both spelled capitalized

Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
Marcel M. Cary [Tue, 30 Dec 2008 15:10:24 +0000 (07:10 -0800)]
git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X

On Mac OS X and possibly BSDs, /bin/pwd reads PWD from the environment if
available and shows the logical path by default rather than the physical
one.

Unset PWD before running /bin/pwd in both cd_to_toplevel and its test.

Still use the external /bin/pwd because in my Bash on Linux, the builtin
pwd prints the same result whether or not PWD is set.

Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org>
Tested-by: Wincent Colaiuta <win@wincent.com> (on Mac OS X 10.5.5)
Tested-by: Marcel Koeppen <git-dev@marzelpan.de> (on Mac OS X 10.5.6)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: clarify which parameters are optional to git-cherry
Markus Heidelberg [Thu, 1 Jan 2009 21:56:29 +0000 (22:56 +0100)]
Documentation: clarify which parameters are optional to git-cherry

An earlier parameter is only optional when all of the later parameters are
omitted.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocvsserver: change generation of CVS author names
Fabian Emmes [Fri, 2 Jan 2009 15:40:14 +0000 (16:40 +0100)]
cvsserver: change generation of CVS author names

CVS username is generated from local part email address.
We take the whole local part but restrict the character set to the
Portable Filename Character Set, which is used for Unix login names
according to Single Unix Specification v3.

This will obviously report different usernames from existing repositories
for commits with the local part of the author e-mail address that contains
characters outside the PFCS.  Hopefully this won't break an old CVS
checkout from an earlier version of git-cvsserver, because the names are
always shown afresh to the CVS clients and not kept on the client side.

Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: add '--merge' to 'git reset'
SZEDER Gábor [Mon, 29 Dec 2008 15:05:46 +0000 (16:05 +0100)]
bash: add '--merge' to 'git reset'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshow <tag>: reuse pp_user_info() instead of duplicating code
Johannes Schindelin [Fri, 2 Jan 2009 18:08:43 +0000 (19:08 +0100)]
show <tag>: reuse pp_user_info() instead of duplicating code

We used to extract the tagger information "by hand" in "git show <tag>",
but the function pp_user_info() already does that.  Even better:
it respects the commit_format and date_format specified by the user.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit add: do not add files from a submodule
Johannes Schindelin [Fri, 2 Jan 2009 18:08:40 +0000 (19:08 +0100)]
git add: do not add files from a submodule

It comes quite as a surprise to an unsuspecting Git user that calling
"git add submodule/file" (which is a mistake, alright) _removes_
the submodule in the index, and adds the file.  Instead, complain loudly.

While at it, be nice when the user said "git add submodule/" which is
most likely the consequence of tab-completion, and stage the submodule,
instead of trying to add the contents of that directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobundle: allow rev-list options to exclude annotated tags
Johannes Schindelin [Fri, 2 Jan 2009 18:08:46 +0000 (19:08 +0100)]
bundle: allow rev-list options to exclude annotated tags

With options such as "--all --since=2.weeks.ago", annotated tags used to
be included, when they should have been excluded.  The reason is that we
heavily abuse the revision walker to determine what needs to be included
or excluded.  And the revision walker does not show tags at all (and
therefore never marks tags as uninteresting).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: use href() when generating URLs in OPML
Giuseppe Bilotta [Fri, 2 Jan 2009 12:15:28 +0000 (13:15 +0100)]
gitweb: use href() when generating URLs in OPML

Since the OPML project list view was hand-coding the RSS and HTML URLs,
it didn't respect global options such as use_pathinfo. Make it use
href() to ensure consistency with the rest of the gitweb setup.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobisect view: call gitk if Cygwin's SESSIONNAME variable is set
Johannes Schindelin [Fri, 2 Jan 2009 18:08:00 +0000 (19:08 +0100)]
bisect view: call gitk if Cygwin's SESSIONNAME variable is set

It seems that Cygwin sets the variable SESSIONNAME when an interactive
desktop session is running, and does not set it when you log in via ssh.

So we can use this variable to determine whether to run gitk or git log
in git bisect view.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-export: print usage when no options specified
Miklos Vajna [Sat, 3 Jan 2009 03:59:12 +0000 (04:59 +0100)]
fast-export: print usage when no options specified

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocvsserver: add option to configure commit message
Fabian Emmes [Fri, 2 Jan 2009 15:40:13 +0000 (16:40 +0100)]
cvsserver: add option to configure commit message

cvsserver annotates each commit message by "via git-CVS emulator". This is
made configurable via gitcvs.commitmsgannotation.

Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/maint-do-not-switch-to-non-commit'
Junio C Hamano [Sat, 3 Jan 2009 21:57:30 +0000 (13:57 -0800)]
Merge branch 'jc/maint-do-not-switch-to-non-commit'

* jc/maint-do-not-switch-to-non-commit:
  git checkout: do not allow switching to a tree-ish that is not a commit

15 years agoMerge branch 'ap/maint-apply-modefix'
Junio C Hamano [Sat, 3 Jan 2009 21:57:10 +0000 (13:57 -0800)]
Merge branch 'ap/maint-apply-modefix'

* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes

15 years agogit checkout: do not allow switching to a tree-ish that is not a commit
Junio C Hamano [Sat, 3 Jan 2009 12:07:32 +0000 (04:07 -0800)]
git checkout: do not allow switching to a tree-ish that is not a commit

"git checkout -b newbranch $commit^{tree}" mistakenly created a new branch
rooted at the current HEAD, because in that case, the two structure fields
used to see if the command was invoked without any argument (hence it
needs to default to checking out the HEAD) were populated incorrectly.

Upon seeing a command line argument that we took as a rev, we should store
that string in new.name, even if that does not name a commit.  This will
correctly trigger the existing safety logic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
15 years agobuiltin-apply: prevent non-explicit permission changes
Junio C Hamano [Fri, 2 Jan 2009 10:55:37 +0000 (02:55 -0800)]
builtin-apply: prevent non-explicit permission changes

A git patch that does not change the executable bit records the mode bits
on its "index" line.  "git apply" used to interpret this mode exactly the
same way as it interprets the mode recorded on "new mode" line, as the
wish by the patch submitter to set the mode to the one recorded on the
line.

The reason the mode does not agree between the submitter and the receiver
in the first place is because there is _another_ commit that only appears
on one side but not the other since their histories diverged, and that
commit changes the mode.  The patch has "index" line but not "new mode"
line because its change is about updating the contents without affecting
the mode.  The application of such a patch is an explicit wish by the
submitter to only cherry-pick the commit that updates the contents without
cherry-picking the commit that modifies the mode.  Viewed this way, the
current behaviour is problematic, even though the command does warn when
the mode of the path being patched does not match this mode, and a careful
user could detect this inconsistencies between the patch submitter and the
patch receiver.

This changes the semantics of the mode recorded on the "index" line;
instead of interpreting it as the submitter's wish to set the mode to the
recorded value, it merely informs what the mode submitter happened to
have, and the presense of the "index" line is taken as submitter's wish to
keep whatever the mode is on the receiving end.

This is based on the patch originally done by Alexander Potashev with a
minor fix; the tests are mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit wrapper: Make while loop more reader-friendly
Johannes Schindelin [Fri, 2 Jan 2009 18:07:52 +0000 (19:07 +0100)]
git wrapper: Make while loop more reader-friendly

It is not a good practice to prefer performance over readability in
something as performance uncritical as finding the trailing slash
of argv[0].

So avoid head-scratching by making the loop user-readable, and not
hyper-performance-optimized.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGit.pm: correctly handle directory name that evaluates to "false"
Philippe Bruhat (BooK) [Mon, 29 Dec 2008 00:25:00 +0000 (01:25 +0100)]
Git.pm: correctly handle directory name that evaluates to "false"

The repository constructor mistakenly rewrote a Directory parameter that
Perl happens to evaluate to false (e.g. "0") to ".".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cb/mergetool'
Junio C Hamano [Thu, 1 Jan 2009 13:48:40 +0000 (05:48 -0800)]
Merge branch 'cb/mergetool'

* cb/mergetool:
  mergetool: Don't keep temporary merge files unless told to
  mergetool: Add prompt to continue after failing to merge a file
  Add -y/--no-prompt option to mergetool
  Fix some tab/space inconsistencies in git-mergetool.sh