Commit Graph

18858 Commits

Author SHA1 Message Date
Junio C Hamano
6096d75980 Documentation/git.txt: update links to release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 22:52:37 -07:00
Junio C Hamano
9831b370b5 Merge branch 'maint' to sync with 1.6.3.2 2009-06-03 22:51:56 -07:00
Junio C Hamano
6c7f58d6f6 GIT 1.6.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 22:47:48 -07:00
Daniel Trstenjak
2414b45ce0 Show presence of stashed changes in bash prompt.
Add a '$' in the __git_ps1 output to show stashed changes are present,
when GIT_PS1_SHOWSTASHSTATE is set to a nonempty value.

The code for checking if the stash has entries is taken from
'git-stash.sh'.

Signed-off-by: Daniel Trstenjak <daniel.trstenjak@online.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 22:38:17 -07:00
René Scharfe
84201eae77 grep: fix empty word-regexp matches
The command "git grep -w ''" dies as soon as it encounters an empty line,
reporting (wrongly) that "regexp returned nonsense".  The first hunk of
this patch relaxes the sanity check that is responsible for that,
allowing matches to start at the end.

The second hunk complements it by making sure that empty matches are
rejected if -w was specified, as they are not really words.

GNU grep does the same:

	$ echo foo | grep -c ''
	1
	$ echo foo | grep -c -w ''
	0

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 11:32:29 -07:00
Junio C Hamano
b11cf09043 Merge branch 'da/pretty-tempname'
* da/pretty-tempname:
  diff: generate pretty filenames in prep_temp_blob()
  compat: add a basename() compatibility function
  compat: add a mkstemps() compatibility function

Conflicts:
	Makefile
2009-06-03 00:50:05 -07:00
Linus Torvalds
ceff8e7ade Clean up and simplify rev_compare_tree()
This simplifies the logic of rev_compare_tree() by removing a special
case.

It does so by turning the special case of finding a diff to be "all new
files" into a more generic case of "all new" vs "all removed" vs "mixed
changes", so now the code is actually more powerful and more generic, and
the added symmetry actually makes it simpler too.

This makes no changes to any existing behavior, but apart from the
simplification it does make it possible to some day care about whether all
changes were just deletions if we want to. Which we may well want to for
merge handling.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:49:50 -07:00
Junio C Hamano
433e972aeb Merge branch 'maint'
* maint:
  blame: correctly handle a path that used to be a directory
  add -i: do not dump patch during application
  Update draft release notes for 1.6.3.2
  grep: fix colouring of matches with zero length
  Documentation: teach stash/pop workflow instead of stash/apply
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge
2009-06-03 00:49:40 -07:00
Junio C Hamano
a9b2d42486 blame: correctly handle a path that used to be a directory
When trying to see if the same path exists in the parent, we ran
"diff-tree" with pathspec set to the path we are interested in with the
parent, and expect either to have exactly one resulting filepair (either
"changed from the parent", "created when there was none") or nothing (when
there is no change from the parent).

If the path used to be a directory, however, we will also see unbounded
number of entries that talk about the files that used to exist underneath
the directory in question.  Correctly pick only the entry that describes
the path we are interested in in such a case (namely, the creation of the
path as a regular file).

Noticed by Ben Willard.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:49:34 -07:00
Thomas Rast
8dc3a47c3e add -i: do not dump patch during application
Remove a debugging print that snuck in at 7a26e65 (Revert
"git-add--interactive: remove hunk coalescing", 2009-05-16).

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:11:15 -07:00
Junio C Hamano
40bad52d7d Update draft release notes for 1.6.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-02 08:11:30 -07:00
Junio C Hamano
456cb4cf3e Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint
* cb/maint-1.6.0-xdl-merge-fix:
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge

Conflicts:
	xdiff/xmerge.c
2009-06-02 07:48:44 -07:00
Junio C Hamano
3489428367 Merge branch 'rs/maint-grep-word-regexp-fix' into maint
* rs/maint-grep-word-regexp-fix:
  grep: fix colouring of matches with zero length
  grep: fix word-regexp at the beginning of lines
2009-06-02 07:48:09 -07:00
Junio C Hamano
b91ffd37d5 Merge branch 'sb/maint-1.6.2-opt-filename-fix' into maint
* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t
2009-06-02 07:47:03 -07:00
Junio C Hamano
f2823263bd Merge branch 'jc/maint-add-p-coalesce-fix' into maint
* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"
2009-06-02 07:46:52 -07:00
Junio C Hamano
db8af4b5ea Merge branch 'tr/maint-doc-stash-pop' into maint
* tr/maint-doc-stash-pop:
  Documentation: teach stash/pop workflow instead of stash/apply
2009-06-02 07:43:45 -07:00
Clemens Buchacher
a5adcbe377 test-lib: fix http exit codes
Previously, die() would report the exit code of stop_httpd. Instead,
save and reset the exit code before dying.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:45:01 -07:00
Clemens Buchacher
6e7b5aaf40 test-lib: allow exit trap to be used for cleanup by tests
Exit trap should not be removed in case tests require cleanup code. This
is especially important if tests are executed with the --immediate option.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:44:54 -07:00
Clemens Buchacher
1f729dca93 test-lib: fail if invalid options are passed
Previously, unknown options would be ignored, including any subsequent
valid options.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:44:51 -07:00
René Scharfe
1f5b9cc40e grep: fix colouring of matches with zero length
If a zero-length match is encountered, break out of loop and show the rest
of the line uncoloured.  Otherwise we'd be looping forever, trying to make
progress by advancing the pointer by zero characters.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:30:39 -07:00
Stephen Boyd
b3f298ab03 git-show-branch.txt: document --date-order option
Copy the description of date-order from rev-list-options.txt, and then
reword it to be commit specific. While we're at it, put <rev> <glob>...
on a new line to not exceed 80 characters.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 00:41:58 -07:00
David Aguilar
003b33a8ad diff: generate pretty filenames in prep_temp_blob()
Naturally, prep_temp_blob() did not care about filenames.
As a result, GIT_EXTERNAL_DIFF and textconv generated
filenames such as ".diff_XXXXXX".

This modifies prep_temp_blob() to generate user-friendly
filenames when creating temporary files.

Diffing "name.ext" now generates "XXXXXX_name.ext".

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 17:57:59 -07:00
David Aguilar
e1c0688692 compat: add a basename() compatibility function
Some systems such as Windows lack libgen.h so provide a
basename() implementation for cross-platform use.

This introduces the NO_LIBGEN_H construct to the Makefile
and autoconf scripts.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 17:57:59 -07:00
David Aguilar
0620b39b3b compat: add a mkstemps() compatibility function
mkstemps() is a BSD extension so provide an implementation
for cross-platform use.

Signed-off-by: David Aguilar <davvid@gmail.com>
Tested-by: Johannes Sixt <j6t@kdbg.org> (Windows)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 17:56:44 -07:00
Junio C Hamano
f9275c68af Merge branch 'sb/opt-filename'
* sb/opt-filename:
  parse-opts: add OPT_FILENAME and transition builtins
  parse-opts: prepare for OPT_FILENAME

Conflicts:
	builtin-log.c
2009-05-31 16:57:42 -07:00
Junio C Hamano
714cdcd03e Merge branch 'jc/solaris-0811'
* jc/solaris-0811:
  OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV
  Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6
2009-05-31 16:18:02 -07:00
Junio C Hamano
c6e73936b9 Merge branch 'sb/show-branch-parse-options'
* sb/show-branch-parse-options:
  show-branch: migrate to parse-options API
  parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's

Conflicts:
	parse-options.h
2009-05-31 16:17:58 -07:00
Junio C Hamano
919cc4d068 Merge branch 'mm/apply-double-slash'
* mm/apply-double-slash:
  apply: handle filenames with double slashes better
2009-05-31 16:17:46 -07:00
Junio C Hamano
1af4731b54 Merge branch 'sb/format-patch-parseopt'
* sb/format-patch-parseopt:
  format-patch: migrate to parse-options API

Conflicts:
	builtin-log.c
2009-05-31 16:17:31 -07:00
Junio C Hamano
128b0c08ca Merge branch 'jc/mktree'
* jc/mktree:
  mktree: validate entry type in input
  mktree --batch: build more than one tree object
  mktree --missing: updated usage message and man page
  mktree --missing: allow missing objects
  t1010: add mktree test
  mktree: do not barf on a submodule commit
  builtin-mktree.c: use a helper function to handle one line of input
  mktree: use parse-options
  build-in git-mktree
2009-05-31 16:17:11 -07:00
Junio C Hamano
22cdab5b3f Merge branch 'ew/svn-test-and-old-i18n'
* ew/svn-test-and-old-i18n:
  t8005: fix typo, it's ISO-8859-5, not KOI8-R
  t8005: convert CP1251 character set to ISO8859-5
  t8005: use more portable character encoding names
  t5100: use ancient encoding syntax for backwards compatibility
  t9301: use ISO8859-1 rather than ISO-8859-1
  t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
  t3901: avoid negation on right hand side of '|'
  builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding
  builtin-mailinfo.c: compare character encodings case insensitively
  Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
  t3900: use ancient iconv names for backward compatibility
2009-05-31 16:17:07 -07:00
Junio C Hamano
06676213d2 Merge branch 'mw/send-email'
* mw/send-email:
  send-email: Remove superfluous `my $editor = ...'
  send-email: 'References:' should only reference what is sent
  send-email: Handle "GIT:" rather than "GIT: " during --compose
  Docs: send-email: --smtp-server-port can take symbolic ports
  Docs: send-email: Refer to CONFIGURATION section for sendemail.multiedit
  Docs: send-email: Put options back into alphabetical order
2009-05-31 16:16:52 -07:00
Junio C Hamano
1136e2c642 Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
  bisect: check ancestors without forking a "git rev-list" process
  commit: add function to unparse a commit and its parents
  bisect: rework some rev related functions to make them more reusable
2009-05-31 16:16:48 -07:00
Jeff King
6e4f981ffb git-add: no need for -f when resolving a conflict in already tracked path
When a path F that matches ignore pattern has a conflict, "git add F"
insisted the -f option be given, which did not make sense.  It would have
required -f when the path was originally added, but when resolving a
conflict, it already is tracked.

So this should work (and does):

  $ echo file >.gitignore
  $ echo content >file
  $ git add -f file ;# need -f because we are adding new path
  $ echo more content >>file
  $ git add file ;# don't need -f; it is not actually an "other" file

This is handled under the hood by the COLLECT_IGNORED option to
read_directory. When that code finds an ignored file, it checks the
index to make sure it is not actually a tracked file. However, the test
it uses does not take into account unmerged entries, and considers them
to still be ignored. "git ls-files" uses a more elaborate test and gets
the right answer and the same test should be used here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 15:59:16 -07:00
Stephen Boyd
13bd213408 config.txt: document add.ignore-errors
Use the description of "--ignore-errors" from git-add.txt as
inspiration.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 15:40:09 -07:00
SZEDER Gábor
ee6b71141f bash: remove always true if statement from __git_ps1()
The recent commits 8763dbb1 (completion: fix PS1 display during a
merge on detached HEAD, 2009-05-16), ff790b6a (completion: simplify
"current branch" in __git_ps1(), 2009-05-10), and d7107ca6
(completion: fix PS1 display during an AM on detached HEAD,
2009-05-26) ensure that the branch name in __git_ps1() is always set
to something sensible.  Therefore, the condition for checking the
non-empty branch name is always fulfilled, and can be removed.

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>
2009-05-31 15:39:32 -07:00
Björn Steinbrink
c4d5359230 git-apply(1): Clarify that one can select where to apply the patch
The patch can be applied to the work tree, the index or both, but the
short description made it look like it's always applied to both.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 15:39:04 -07:00
Clemens Buchacher
0bf8c1f9be http-push: reuse existing is_null_ref
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 15:38:32 -07:00
Eric Wong
188643140b t9139 uses ancient, backwards-compatible iconv names
This resolves a semantic conflicts early to work with 5ae93df (t3900: use
ancient iconv names for backward compatibility, 2009-05-18).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-30 22:30:55 -07:00
Junio C Hamano
0ddbbb6661 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: refuse to dcommit non-UTF-8 messages
2009-05-30 22:25:41 -07:00
Thomas Rast
d183663785 Documentation: teach stash/pop workflow instead of stash/apply
Recent discussion on the list showed some comments in favour of a
stash/pop workflow:

  http://marc.info/?l=git&m=124234911423358&w=2
  http://marc.info/?l=git&m=124235348327711&w=2

Change the stash documentation and examples to document pop in its own
right (and apply in terms of pop), and use stash/pop in the examples.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-30 22:21:29 -07:00
Junio C Hamano
9affecbc89 Merge branch 'sb/maint-1.6.2-opt-filename-fix'
* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t
2009-05-29 15:01:16 -07:00
Junio C Hamano
659f096896 Merge branch 'jc/maint-add-p-coalesce-fix'
* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"
2009-05-29 15:00:15 -07:00
Junio C Hamano
8e105e3928 Merge branch 'rs/maint-grep-word-regexp-fix'
* rs/maint-grep-word-regexp-fix:
  grep: fix word-regexp at the beginning of lines
2009-05-29 14:59:50 -07:00
Stephen Boyd
3be7e06713 t9120: don't expect failure with SVN_HTTPD_PORT unset
The test still passes when SVN_HTTPD_PORT is not set. Futhermore, t9115
and t9118 don't check if SVN_HTTPD_PORT is set even though they both use
start_httpd() from lib-git-svn.sh. Admittedly, the test is not very
meaningful without SVN_HTTPD_PORT, as commit f5530b (support for funky
branch and project names over HTTP(S) 2007-11-11) states that the URI
escaping is only done over HTTP(S).

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-29 00:53:43 -07:00
Thomas Rast
7b8988e113 Documentation: teach stash/pop workflow instead of stash/apply
Recent discussion on the list showed some comments in favour of a
stash/pop workflow:

  http://marc.info/?l=git&m=124234911423358&w=2
  http://marc.info/?l=git&m=124235348327711&w=2

Change the stash documentation and examples to document pop in its own
right (and apply in terms of pop), and use stash/pop in the examples.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-28 23:52:25 -07:00
Junio C Hamano
a9d29038a7 Merge branch 'maint'
* maint:
  fix segfault showing an empty remote
2009-05-28 22:50:23 -07:00
Eric Wong
b510df8af2 git-svn: refuse to dcommit non-UTF-8 messages
...without i18n.commitencoding set in the config.

SVN tries to store all commit messages in UTF-8, however it is
up to the job of the clients to enforce this rule.  SVN servers
themselves do not always enforce this; allowing clients to
commit malformed UTF-8 messages and break repositories.

So git-svn will enforce this and tell the user to set
i18n.commitencoding when a git commit is is not in UTF-8.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-05-28 00:57:07 -07:00
Clemens Buchacher
6a01554e63 fix segfault showing an empty remote
In case of an empty list, the search for its tail caused a
NULL-pointer dereference.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Reported-by: Erik Faye-Lund <kusmabite@googlemail.com>
Acked-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-27 23:16:16 -07:00
Brandon Casey
ed43bc8c4c t8005: fix typo, it's ISO-8859-5, not KOI8-R
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-27 20:24:55 -07:00