Commit graph

16191 commits

Author SHA1 Message Date
Andreas Ericsson f8cca019b9 rebase: Support preserving merges in non-interactive mode
As a result of implementation details, 'git rebase' could
previously only preserve merges in interactive mode. That
limitation was hard for users to understand and awkward to
explain.

This patch works around it by running the interactive rebase
helper git-rebase--interactive with GIT_EDITOR set to ':'
when the user passes "-p" but not "-i" to the rebase command.
The effect is that the interactive rebase helper is used but
the user never sees an editor.

The test-case included in this patch was originally written
by Stephen Habermann <stephen@exigencecorp.com>, but has
been extensively modified since its creation.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 15:34:52 -07:00
Shawn O. Pearce 8b745e3ffd Merge branch 'maint'
* maint:
  git-svn: call 'fatal' correctly in set-tree
  Replace svn.foo.org with svn.example.com in git-svn docs (RFC 2606)
  t0024: add executable permission
2008-09-30 14:14:09 -07:00
Luc Heinrich 0a1a1c8615 git-svn: call 'fatal' correctly in set-tree
When doing a set-tree and there is no revision to commit to, the following unrelated error message is displayed: "Undefined subroutine &Git::SVN::fatal called at /opt/local/libexec/git-core/git-svn line 2575." The following patch fixes the problem and allows the real error message to be shown.

Signed-off-by: Luc Heinrich <luc@honk-honk.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:58:59 -07:00
Michael Prokop 2670ddce53 Replace svn.foo.org with svn.example.com in git-svn docs (RFC 2606)
foo.org is an existing domain, use RFC 2606 complying example.com instead
as used in other docs as well.

Signed-off-by: Michael Prokop <mika@grml.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:57:47 -07:00
Brandon Casey 416f80a60b diff.c: remove duplicate bibtex pattern introduced by merge 92bb9785
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:49:07 -07:00
David Bryson d3154b44c2 Use "git_config_string" to simplify "builtin-gc.c" code where "prune_expire" is set
Signed-off-by: David Bryson <david@statichacks.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:41:50 -07:00
Jeff King 87539416fd tests: grep portability fixes
We try to avoid using the "-q" or "-e" options, as they are
largely useless, as explained in aadbe44f.

There is one exception for "-e" here, which is in t7701 used
to produce an "or" of patterns. This can be rewritten as an
egrep pattern.

This patch also removes use of "grep -F" in favor of the
more widely available "fgrep".

[sp: Tested on AIX 5.3 by Mike Ralphson,
     Tested on MinGW by Johannes Sixt]

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 12:39:58 -07:00
Jonathan del Strother c33912ae24 Add OS X support to the pre-auto-gc example hook
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 12:27:20 -07:00
SZEDER Gábor 4b3729e637 t0024: add executable permission
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 12:16:59 -07:00
Ralf Wildenhues 79fd4cc749 Correct typos in RelNotes-1.6.1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 11:51:16 -07:00
SZEDER Gábor 1d4c498670 remove vim syntax highlighting in favor of upstream
As of version 7.2, vim ships with its own syntax
highlighting for git commit messages, which is:

  1. more comprehensive in splitting up the various
     components of the file

  2. in accordance with the usual vim behavior for syntax
     highlighting (e.g., respecting b:current_syntax)

  3. presumably better maintained (I have not been using
     what's in git's contrib/ directory for some time in
     favor of the upstream version)

Furthermore, vim upsream also provides syntax highlighting
for other git filetypes (gitconfig, rebase, send-email).

This patch gets rid of our local version and just points
interested parties to the upstream version.

The code for auto-detecting filetypes is taken from vim's
runtime/filetype.vim.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 11:48:41 -07:00
Shawn O. Pearce 9800c0df41 Merge branch 'bc/master-diff-hunk-header-fix'
* bc/master-diff-hunk-header-fix:
  Clarify commit error message for unmerged files
  Use strchrnul() instead of strchr() plus manual workaround
  Use remove_path from dir.c instead of own implementation
  Add remove_path: a function to remove as much as possible of a path
  git-submodule: Fix "Unable to checkout" for the initial 'update'
  Clarify how the user can satisfy stash's 'dirty state' check.
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  make "git remote" report multiple URLs
  diff hunk pattern: fix misconverted "\{" tex macro introducers
  diff: fix "multiple regexp" semantics to find hunk header comment
  diff: use extended regexp to find hunk headers
  diff: use extended regexp to find hunk headers
  diff.*.xfuncname which uses "extended" regex's for hunk header selection
  diff.c: associate a flag with each pattern and use it for compiling regex
  diff.c: return pattern entry pointer rather than just the hunk header pattern

Conflicts:
	builtin-merge-recursive.c
	t/t7201-co.sh
	xdiff-interface.h
2008-09-29 11:04:20 -07:00
Shawn O. Pearce 5a139ba483 Merge branch 'maint' into bc/master-diff-hunk-header-fix
* maint: (41 commits)
  Clarify commit error message for unmerged files
  Use strchrnul() instead of strchr() plus manual workaround
  Use remove_path from dir.c instead of own implementation
  Add remove_path: a function to remove as much as possible of a path
  git-submodule: Fix "Unable to checkout" for the initial 'update'
  Clarify how the user can satisfy stash's 'dirty state' check.
  Remove empty directories in recursive merge
  Documentation: clarify the details of overriding LESS via core.pager
  Update release notes for 1.6.0.3
  checkout: Do not show local changes when in quiet mode
  for-each-ref: Fix --format=%(subject) for log message without newlines
  git-stash.sh: don't default to refs/stash if invalid ref supplied
  maint: check return of split_cmdline to avoid bad config strings
  builtin-prune.c: prune temporary packs in <object_dir>/pack directory
  Do not perform cross-directory renames when creating packs
  Use dashless git commands in setgitperms.perl
  git-remote: do not use user input in a printf format string
  make "git remote" report multiple URLs
  Start draft release notes for 1.6.0.3
  git-repack uses --no-repack-object, not --no-repack-delta.
  ...

Conflicts:
	RelNotes
2008-09-29 10:52:34 -07:00
Shawn O. Pearce edb7e82f72 Merge branch 'bc/maint-diff-hunk-header-fix' into maint
* bc/maint-diff-hunk-header-fix:
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  diff hunk pattern: fix misconverted "\{" tex macro introducers
  diff: use extended regexp to find hunk headers
  diff.*.xfuncname which uses "extended" regex's for hunk header selection
  diff.c: associate a flag with each pattern and use it for compiling regex
  diff.c: return pattern entry pointer rather than just the hunk header pattern

Conflicts:
	Documentation/gitattributes.txt
2008-09-29 10:23:19 -07:00
Shawn O. Pearce 9ba929ed65 Merge branch 'jc/better-conflict-resolution'
* jc/better-conflict-resolution:
  Fix AsciiDoc errors in merge documentation
  git-merge documentation: describe how conflict is presented
  checkout --conflict=<style>: recreate merge in a non-default style
  checkout -m: recreate merge when checking out of unmerged index
  git-merge-recursive: learn to honor merge.conflictstyle
  merge.conflictstyle: choose between "merge" and "diff3 -m" styles
  rerere: understand "diff3 -m" style conflicts with the original
  rerere.c: use symbolic constants to keep track of parsing states
  xmerge.c: "diff3 -m" style clips merge reduction level to EAGER or less
  xmerge.c: minimum readability fixups
  xdiff-merge: optionally show conflicts in "diff3 -m" style
  xdl_fill_merge_buffer(): separate out a too deeply nested function
  checkout --ours/--theirs: allow checking out one side of a conflicting merge
  checkout -f: allow ignoring unmerged paths when checking out of the index

Conflicts:
	Documentation/git-checkout.txt
	builtin-checkout.c
	builtin-merge-recursive.c
	t/t7201-co.sh
2008-09-29 10:15:07 -07:00
Shawn O. Pearce e9a06f1eeb Merge branch 'mg/maint-remote-fix' into maint
* mg/maint-remote-fix:
  make "git remote" report multiple URLs
2008-09-29 09:39:53 -07:00
Nanako Shiraishi c11c7a5db3 Add contrib/rerere-train script
This script takes a range of commits (e.g. maint..next) as its arguments,
recreates merge commits in the range to prime rr-cache database.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 09:15:41 -07:00
Rafael Garcia-Suarez cbce6c0be3 Clarify commit error message for unmerged files
Currently, trying to use git-commit with unmerged files in the index
will show the message "Error building trees", which can be a bit
obscure to the end user. This patch makes the error message clearer, and
consistent with what git-write-tree reports in a similar situation.

Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 09:13:20 -07:00
Johan Herland 94e02e7f3b Use strchrnul() instead of strchr() plus manual workaround
Also gets rid of a C++ comment.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:56:26 -07:00
Dmitry Potapov 8252df6218 mingw: remove use of _getdrive() from lstat/fstat
The field device is not used by Git, and putting the number of the
current device is meaningless anyway.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:55:47 -07:00
Alex Riesen 175a494823 Use remove_path from dir.c instead of own implementation
Besides, it fixes a memleak (builtin-rm.c) and accidental change of
the input const argument (builtin-merge-recursive.c).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:37:07 -07:00
Alex Riesen 4a92d1bfb7 Add remove_path: a function to remove as much as possible of a path
The function has two potential users which both managed to get wrong
their implementations (the one in builtin-rm.c one has a memleak, and
builtin-merge-recursive.c scribles over its const argument).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:37:07 -07:00
Ping Yin b9b378a001 git-submodule: Fix "Unable to checkout" for the initial 'update'
Since commit 55218("checkout: do not lose staged removal"), in
cmd_add/cmd_update, "git checkout <commit>" following
"git clone -n" may fail if <commit> is different from HEAD.

So Use "git checkout -f <commit>" to fix this.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:24:19 -07:00
Johannes Sixt d317851a7f compat/mingw: Support a timeout in the poll emulation if no fds are given
Our poll() emulation did not support the timeout argument. With this patch
we support it for the simple case where poll() does not need to wait on
file descriptors as well because this case amounts to a mere Sleep().

This is needed if the user sets help.autocorrect is set to a positive
value.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:22:40 -07:00
Stephen Haberman 2a79d2f662 Clarify how the user can satisfy stash's 'dirty state' check.
Signed-off-by: Stephen Haberman <stephen@exigencecorp.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:13:10 -07:00
Nanako Shiraishi 07ad5a157d usage.c: remove unused functions
This removes three functions that are not used anywhere.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Acked-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 07:30:16 -07:00
Shawn O. Pearce 15dc66abf0 Merge branch 'maint'
* maint:
  Remove empty directories in recursive merge
  Documentation: clarify the details of overriding LESS via core.pager

Conflicts:
	builtin-merge-recursive.c
2008-09-26 08:31:56 -07:00
Alex Riesen eb53586ba9 Cleanup remove_path
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 08:24:19 -07:00
Alex Riesen 41f13af558 Remove empty directories in recursive merge
The code was actually supposed to do that, but was accidentally broken.
Noticed by Anders Melchiorsen.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 08:05:20 -07:00
Chris Frey fee75457fc Documentation: clarify the details of overriding LESS via core.pager
The process of overriding the default LESS options using only
git-specific methods is rather obscure.  Show the end user how
to do it in a step-by-step manner.

Signed-off-by: Chris Frey <cdfrey@foursquare.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 07:55:30 -07:00
Shawn O. Pearce ed520a8f27 Merge branch 'mv/merge-recursive'
* mv/merge-recursive:
  builtin-merge: release the lockfile in try_merge_strategy()
  merge-recursive: get rid of virtual_id
  merge-recursive: move current_{file,directory}_set to struct merge_options
  merge-recursive: move the global obuf to struct merge_options
  merge-recursive: get rid of the index_only global variable
  merge-recursive: move call_depth to struct merge_options
  cherry-pick/revert: make direct internal call to merge_tree()
  builtin-merge: avoid run_command_v_opt() for recursive and subtree
  merge-recursive: introduce merge_options
  merge-recursive.c: Add more generic merge_recursive_generic()
  Split out merge_recursive() to merge-recursive.c
2008-09-25 09:49:19 -07:00
Shawn O. Pearce 1ad6d46235 Merge branch 'jc/alternate-push'
* jc/alternate-push:
  push: receiver end advertises refs from alternate repositories
  push: prepare sender to receive extended ref information from the receiver
  receive-pack: make it a builtin
  is_directory(): a generic helper function
2008-09-25 09:39:24 -07:00
Shawn O. Pearce 6ef1daf772 Merge branch 'am/status'
* am/status:
  wt-status: Teach how to discard changes in the working directory
  wt-status: Split header generation into three functions
2008-09-25 09:32:49 -07:00
Shawn O. Pearce d22d53db65 Merge branch 'pb/autocorrect-wrapper'
* pb/autocorrect-wrapper:
  git wrapper: also use aliases to correct mistyped commands
2008-09-25 09:23:48 -07:00
Shawn O. Pearce 1fa24f8f3d Merge branch 'mv/commit-tree'
* mv/commit-tree:
  t7603: add new testcases to ensure builtin-commit uses reduce_heads()
  builtin-commit: use commit_tree()
  commit_tree(): add a new author parameter
2008-09-25 09:16:33 -07:00
Shawn O. Pearce 81b84bcbe3 Merge branch 'jc/apply-include-exclude'
* jc/apply-include-exclude:
  git-apply:--include=pathspec
2008-09-25 09:09:41 -07:00
Shawn O. Pearce 58245a5e40 Merge branch 'jc/safe-c-l-d'
* jc/safe-c-l-d:
  safe_create_leading_directories(): make it about "leading" directories
2008-09-25 08:50:01 -07:00
Giuseppe Bilotta ec3e97b84e gitweb: shortlog now also obeys $hash_parent
If $hash_parent is defined, shortlog now limits the list of commits at
those between $hash_parent (exclusive) and $hash (inclusive).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:49:13 -07:00
Shawn O. Pearce de81343562 Merge branch 'ho/dirstat-by-file'
* ho/dirstat-by-file:
  diff --dirstat-by-file: count changed files, not lines
2008-09-25 08:41:42 -07:00
Shawn O. Pearce 1500f7bc13 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: Reenable staging unmerged files by clicking the icon.
  git-gui: Support the encoding menu in gui blame.
  git-gui: Optimize encoding name resolution using a lookup table.
  git-gui: Allow forcing display encoding for diffs using a submenu.
  git-gui: Add a menu of available encodings.
  git-gui: Cleanup handling of the default encoding.
  git-gui: Assume `blame --incremental` output is in UTF-8
  git-gui: Use gitattribute "encoding" for file content display
  git-gui: Add support for calling out to the prepare-commit-msg hook
  git-gui: Hide commit related UI during citool --nocommit
  git-gui: Add more integration options to citool.
  git-gui: Updated German translation.
  git-gui: I18n fix sentence parts into full sentences for translation again.
  git-gui: Restore ability to Stage Working Copy for conflicts.
  git-gui: Fix Blame Parent & Context for working copy lines.
2008-09-25 08:41:07 -07:00
Shawn O. Pearce c9c6cc8d7d Merge branch 'maint'
* maint:
  Update release notes for 1.6.0.3
  checkout: Do not show local changes when in quiet mode
  for-each-ref: Fix --format=%(subject) for log message without newlines
  git-stash.sh: don't default to refs/stash if invalid ref supplied
  maint: check return of split_cmdline to avoid bad config strings
2008-09-25 08:27:53 -07:00
Shawn O. Pearce 93feb4bb14 Update release notes for 1.6.0.3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:27:41 -07:00
Johan Herland baede9f803 Fix submodule sync with relative submodule URLs
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:11:03 -07:00
Nanako Shiraishi 064bfbde45 graph.c: make many functions static
These function are not used anywhere.  Also removes graph_release()
that is never called.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:00:28 -07:00
Nanako Shiraishi 697d7f5dad remote.c: make free_ref(), parse_push_refspec() and free_refspecs() static.
These functions are not used by any other file.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:00:28 -07:00
Jonas Fonseca 7fe4a728a1 checkout: Do not show local changes when in quiet mode
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 07:46:59 -07:00
Johan Herland 85cf643f1b for-each-ref: Fix --format=%(subject) for log message without newlines
'git for-each-ref --format=%(subject)' currently returns an empty string
if the log message does not contain a newline.

This patch teaches 'git for-each-ref' to return the entire log message
(instead of an empty string) if there is no newline in the log message.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 17:02:05 -07:00
Petr Baudis 3b9b1163c0 git-web--browse: Support for using /bin/start on MinGW
In the future, I think we should also default to xdg-open on Linux instead
of having a KDE-specific hack.

This patch has been sponsored by Novartis.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 15:49:21 -07:00
Alexander Gavrilov 3e34838caf git-gui: Reenable staging unmerged files by clicking the icon.
This restores functionality of the file icon for unmerged files.
Safety is enforced by loading the diff and checking for lines
that look like conflict markers. If such lines are found, or
the conflict involves deletion and/or symlinks, a confirmation
dialog is presented. Otherwise, the icon immediately stages the
working copy version of the file.

Includes a revert of 2fe5b2ee42
(Restore ability to Stage Working Copy for conflicts)

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 12:51:43 -07:00
Alexander Gavrilov 6fc835a3f3 git-gui: Support the encoding menu in gui blame.
Allow dynamically changing the encoding from the blame
viewer as well.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 12:48:32 -07:00