Commit graph

20569 commits

Author SHA1 Message Date
Junio C Hamano e33cc592de Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  blame: prevent a segv when -L given start > EOF
2010-02-08 21:53:54 -08:00
Jay Soffian 92f9e273e8 blame: prevent a segv when -L given start > EOF
blame would segv if given -L <lineno> with <lineno> past the end of the file.
While we're fixing the bug, add test cases for an invalid <start> when called
as -L <start>,<end> or -L<start>.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 21:52:44 -08:00
Junio C Hamano a598331f95 Merge branch 'jc/maint-push-doc-status' into maint
* jc/maint-push-doc-status:
  git-push: document all the status flags used in the output
2010-02-08 16:49:22 -08:00
Junio C Hamano b7047abc12 git-push: document all the status flags used in the output
We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 16:49:00 -08:00
Junio C Hamano 0c15da68e8 Merge branch 'jc/maint-imap-config-parse' into maint
* jc/maint-imap-config-parse:
  Fix parsing of imap.preformattedHTML and imap.sslverify
2010-02-08 15:09:19 -08:00
Junio C Hamano ace706e2a6 Fix parsing of imap.preformattedHTML and imap.sslverify
These two variables are boolean and can lack "= value" in the
configuration file.  Do not reject such input early in the
parser callback function.

Also the key are downcased before being given to the callback,
so we should run strcmp() with keyword spelled in all-lowercase.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 15:08:31 -08:00
Junio C Hamano 35da43e9bb Merge branch 'jc/maint-doc-git-add-example' into maint
* jc/maint-doc-git-add-example:
  git-add documentation: Fix shell quoting example
2010-02-08 12:13:56 -08:00
Junio C Hamano bf7cbb2f04 git-add documentation: Fix shell quoting example
When 921177f (Documentation: improve "add", "pull" and "format-patch"
examples, 2008-05-07) converted this from enumeration header to displayed
text, it failed to adjust for the AsciiDoc's rule to quote backslashes.
In displayed text, backslash is shown verbatim, while in enumeration
header, we need to double it.

We have a similar construct in git-rm.txt documentation, and need to be
careful when somebody wants to update it to match the style of the "git
add" example.

Noticed by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 12:12:41 -08:00
René Scharfe fe12d8e84f archive: simplify archive format guessing
The code to guess an output archive's format consumed any --format
options and built a new one.  Jonathan noticed that it does so in an
unsafe way, risking to overflow the static buffer fmt_opt.

Change the code to keep the existing --format options intact and to only
add a new one if a format could be guessed based on the output file name.
The new option is added as the first one, allowing the existing ones to
overrule it, i.e. explicit --format options given on the command line win
over format guesses, as before.

To simplify the code further, format_from_name() is changed to return the
full --format option, thus no potentially dangerous sprintf() calls are
needed any more.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-07 15:40:27 -08:00
Wesley J. Landaker 2b26e0e189 Update git fsck --full short description to mention packs
The '--full' option to git fsck does two things:

  1) Check objects in packs
  2) Check alternate objects

This is documented in the git fsck manual; this patch reflects that in
the short git fsck option help message as well.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05 13:01:45 -08:00
Junio C Hamano b401a12a2c Merge branch 'jc/maint-limit-note-output' into maint
* jc/maint-limit-note-output:
  Fix "log --oneline" not to show notes
  Fix "log" family not to be too agressive about showing notes
2010-02-05 10:59:05 -08:00
Junio C Hamano 153559a964 Merge branch 'sb/maint-octopus' into maint-1.6.5
* sb/maint-octopus:
  octopus: remove dead code
  octopus: reenable fast-forward merges
  octopus: make merge process simpler to follow
2010-02-01 00:06:11 -08:00
Junio C Hamano 4b683658be Merge branch 'bg/maint-add-all-doc' into maint-1.6.5
* bg/maint-add-all-doc:
  git-rm doc: Describe how to sync index & work tree
  git-add/rm doc: Consistently back-quote
  Documentation: 'git add -A' can remove files
2010-02-01 00:04:12 -08:00
Junio C Hamano 3325cea0f7 Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  fix memcpy of overlapping area
2010-01-29 23:36:13 -08:00
Jeff King 65d41d48a4 fix memcpy of overlapping area
Caught by valgrind in t5500, but it is pretty obvious from
reading the code that this is shifting elements of an array
to the left, which needs memmove.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-29 09:52:21 -08:00
SZEDER Gábor 63d04a7804 bash: don't offer remote transport helpers as subcommands
Since commits a2d725b7 (Use an external program to implement fetching
with curl, 2009-08-05) and c9e388bb (Make the
"traditionally-supported" URLs a special case, 2009-09-03) remote
transport helpers like 'remote-ftp' and 'remote-curl' are offered by the
completion script as available subcommands.  Not good, since they are
helpers, therefore should not be offered, so filter them out.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-28 12:36:12 -08:00
Junio C Hamano b30ccd7573 Merge branch 'maint' of git://git.spearce.org/git-gui into maint
* 'maint' of git://git.spearce.org/git-gui:
  git-gui: work from the .git dir
  git-gui: Fix applying a line when all following lines are deletions
  git-gui: Correct file_states when unstaging partly staged entry
  git-gui: Fix gitk for branch whose name matches local file
  git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
  git-gui: handle really long error messages in updateindex.
  git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
  git-gui: Makefile: consolidate .FORCE-* targets
2010-01-24 11:16:26 -08:00
Giuseppe Bilotta 87cd09f43e git-gui: work from the .git dir
When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:04 -08:00
Jeff Epler 390425bdef git-gui: Fix applying a line when all following lines are deletions
If a diff looked like:

 @@
  context
 -del1
 -del2

and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:00:09 -08:00
Jens Lehmann 7ec2b69f1a git-gui: Correct file_states when unstaging partly staged entry
When unstaging a partly staged file or submodule, the file_states
list was not updated properly (unless unstaged linewise). Its
index_info part did not contain the former head_info as it should
have but kept its old value.

This seems not to have had any bad effects but diminishes the value
of the file_states list for future enhancements.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:13 -08:00
Peter Krefting e27d106ec4 git-gui: Fix gitk for branch whose name matches local file
When trying to run gitk on a branch name whose name matches a local
file, it will toss an error saying that the name is ambiguous. Adding
a pair of dashes will make gitk parse the options to the left of
it as branch names. Since wish eats the first pair of dashes we
throw at it, we need to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:12 -08:00
Christopher Beelby 3c6a287027 git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
When the number of recent repo's gets to ten there can be a
situation where an item is removed from the .gitconfig file via
a call to git config --unset, but the internal representation of
that file (repo_config(gui.recentrepo)) is not updated.  Then a
subsequent attempt to remove an item from the list fails because
git-gui attempts to call --unset on a value that has already
been removed.  This leads to duplicates in the .gitconfig file,
which then also cause errors if the git-gui tries to --unset them
(rather than using --unset-all. --unset-all is not used because it
is not expected that duplicates should ever be allowed to exist.)

When loading the list of recent repositories (proc _get_recentrepos)
if a repo in the list is not considered a valid git reposoitory
then we should go ahead and remove it so it doesn't take up a slot
in the list (since we limit to 10 items). This will prevent a bunch
of invalid entries in the list (which are not shown) from making
valid entries dissapear off the list even when there are less than
ten valid entries.

See: http://code.google.com/p/msysgit/issues/detail?id=362
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:12 -08:00
Pat Thoyts ea888f84bd git-gui: handle really long error messages in updateindex.
As reported to msysGit (bug #340) it is possible to get some very
long error messages when updating the index. The use of a label to
display this prevents scrolling the output. This patch replaces the
label with a scrollable text widget configured to look like a label.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:22:28 -08:00
Junio C Hamano 288123f01c ignore duplicated slashes in make_relative_path()
The function takes two paths, an early part of abs is supposed to match
base; otherwise abs is not a path under base and the function returns the
full path of abs.  The caller can easily confuse the implementation by
giving duplicated and needless slashes in these path arguments.

Credit for test script, motivation and initial patch goes to Thomas Rast.
A follow-up fix (squashed) is by Hannes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22 15:34:56 -08:00
Junio C Hamano 19c6a4f836 merge-recursive: do not return NULL only to cause segfault
merge-recursive calls write_tree_from_memory() to come up with a virtual
tree, with possible conflict markers inside the blob contents, while
merging multiple common ancestors down.  It is a bug to call the function
with unmerged entries in the index, even if the merge to come up with the
common ancestor resulted in conflicts.  Otherwise the result won't be
expressible as a tree object.

We _might_ want to suggest the user to set GIT_MERGE_VERBOSITY to 5 and
re-run the merge in the message.  At least we will know which part of
process_renames() or process_entry() functions is not correctly handling
the unmerged paths, and it might help us diagnosing the issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21 17:02:30 -08:00
Tay Ray Chuan 703e6e76a1 retry request without query when info/refs?query fails
When "info/refs" is a static file and not behind a CGI handler, some
servers may not handle a GET request for it with a query string
appended (eg. "?foo=bar") properly.

If such a request fails, retry it sans the query string. In addition,
ensure that the "smart" http protocol is not used (a service has to be
specified with "?service=<service name>" to be conformant).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reported-and-tested-by: Yaroslav Halchenko <debian@onerussian.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21 15:01:37 -08:00
Junio C Hamano 7dccadf363 Fix "log --oneline" not to show notes
This option should be treated pretty much the same as --format="%h %s".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21 14:57:41 -08:00
Junio C Hamano 8f376a50ec Merge branch 'jc/maint-refresh-index-is-optional-for-status' into maint
* jc/maint-refresh-index-is-optional-for-status:
  status: don't require the repository to be writable
2010-01-20 20:25:11 -08:00
Junio C Hamano 66b2ed09c2 Fix "log" family not to be too agressive about showing notes
Giving "Notes" information in the default output format of "log" and
"show" is a sensible progress (the user has asked for it by having the
notes), but for some commands (e.g. "format-patch") spewing notes into the
formatted commit log message without being asked is too aggressive.

Enable notes output only for "log", "show", "whatchanged" by default and
only when the user didn't ask any specific --pretty/--format from the
command line; users can explicitly override this default with --show-notes
and --no-notes option.

Parts of tests are taken from Jeff King's fix.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20 19:57:02 -08:00
Junio C Hamano 9504f3d3d2 Git 1.6.6.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20 13:29:21 -08:00
Junio C Hamano 66276d972c Merge branch 'bg/maint-remote-update-default' into maint
* bg/maint-remote-update-default:
  Fix "git remote update" with remotes.defalt set
2010-01-20 13:23:59 -08:00
Junio C Hamano ce67b3eed8 Merge branch 'sb/maint-octopus' into maint
* sb/maint-octopus:
  octopus: remove dead code
  octopus: reenable fast-forward merges
  octopus: make merge process simpler to follow

Conflicts:
	git-merge-octopus.sh
2010-01-20 13:02:24 -08:00
Junio C Hamano cae7151e25 Merge branch 'bg/maint-add-all-doc' into maint
* bg/maint-add-all-doc:
  git-rm doc: Describe how to sync index & work tree
  git-add/rm doc: Consistently back-quote
  Documentation: 'git add -A' can remove files
2010-01-20 13:01:33 -08:00
Junio C Hamano f0b0d78489 Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  Git 1.6.5.8
  Fix mis-backport of t7002
  bash completion: factor submodules into dirty state
  reset: unbreak hard resets with GIT_WORK_TREE

Conflicts:
	Documentation/git.txt
	GIT-VERSION-GEN
	RelNotes
2010-01-20 13:01:19 -08:00
Junio C Hamano 35eabd1579 Git 1.6.5.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20 12:44:59 -08:00
Junio C Hamano 806e5c8682 Merge branch 'jk/maint-1.6.5-reset-hard' into maint-1.6.5
* jk/maint-1.6.5-reset-hard:
  reset: unbreak hard resets with GIT_WORK_TREE
2010-01-20 12:22:58 -08:00
Junio C Hamano 91d23be167 Merge branch 'tr/maint-1.6.5-bash-prompt-show-submodule-changes' into maint-1.6.5
* tr/maint-1.6.5-bash-prompt-show-submodule-changes:
  bash completion: factor submodules into dirty state
2010-01-20 12:22:54 -08:00
Junio C Hamano e7706554c5 Merge branch 'dp/maint-1.6.5-fast-import-non-commit-tag' into maint-1.6.5
* dp/maint-1.6.5-fast-import-non-commit-tag:
  fast-import: tag may point to any object type
2010-01-20 12:17:24 -08:00
Junio C Hamano 27132ca85a Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint-1.6.5
* jm/maint-1.6.5-grep-NUL-terminate:
  grep: NUL terminate input from a file
2010-01-20 12:16:46 -08:00
Junio C Hamano ab6854515e status: don't require the repository to be writable
We need to update the index before hooks run when actually making a
commit, but we shouldn't have to write the index when running "status".
If we can, then we have already spent cycles to refresh the index and
it is a waste not to write it out, but it is not a disaster if we cannot
write it out.  The main reason the user is running "git status" is to get
the "status", and refreshing the index is a mere side effect that we can
do without.

Discovery and initial attempted fix by Dscho.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19 17:10:35 -08:00
David Ripton 6329bade66 bisect: fix singular/plural grammar nit
Remove the trailing 's' from "revisions" and "steps" when there is
only one.

Signed-off-by: David Ripton <dripton@ripton.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19 12:50:48 -08:00
Junio C Hamano 03c6e97f80 Merge branch 'maint-1.6.4' into maint-1.6.5
* maint-1.6.4:
  Fix mis-backport of t7002
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails
2010-01-18 21:37:12 -08:00
Junio C Hamano 814035c12a Merge branch 'maint-1.6.3' into maint-1.6.4
* maint-1.6.3:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails

Conflicts:
	builtin-commit.c
2010-01-18 21:37:06 -08:00
Junio C Hamano 011c181cc6 Merge branch 'maint-1.6.2' into maint-1.6.3
* maint-1.6.2:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
  textconv: stop leaking file descriptors
  commit: --cleanup is a message option
  git count-objects: handle packs bigger than 4G
  t7102: make the test fail if one of its check fails

Conflicts:
	diff.c
2010-01-18 21:29:47 -08:00
Junio C Hamano 18d97f5fed Merge commit 'v1.6.4.4-8-g8de6518' into maint-1.6.4
* commit 'v1.6.4.4-8-g8de6518':
  Fix mis-backport of t7002
2010-01-18 21:18:41 -08:00
Junio C Hamano 8de65185e8 Fix mis-backport of t7002
The original patch that became cfe370c (grep: do not segfault when -f is
used, 2009-10-16), was made against "maint" or newer branch back then, but
the fix addressed the issue that was present as far as in 1.6.4 series.

The maintainer backported the patch to the 1.6.4 maintenance branch, but
failed to notice that the new tests assumed the setup done by the script
in "maint", which did quite a lot more than the same test script in 1.6.4
series, and the output didn't match the expected result.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18 21:14:49 -08:00
Junio C Hamano 6f9752d2e2 Update draft release notes to 1.6.6.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18 18:16:15 -08:00
Junio C Hamano 6304c4068e Merge branch 'dp/maint-1.6.5-fast-import-non-commit-tag' into maint
* dp/maint-1.6.5-fast-import-non-commit-tag:
  fast-import: tag may point to any object type
2010-01-18 18:15:12 -08:00
Junio C Hamano 7d0dafe394 Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
* jm/maint-1.6.5-grep-NUL-terminate:
  grep: NUL terminate input from a file
2010-01-18 17:03:34 -08:00
Jim Meyering 34f3999206 grep: NUL terminate input from a file
Internally "git grep" runs regexec(3) that expects its input string
to be NUL terminated.  When searching inside blob data, read_sha1_file()
automatically gives such a buffer, but builtin-grep.c forgot to put
the NUL at the end, even though it allocated enough space for it.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18 17:01:29 -08:00