Commit graph

17499 commits

Author SHA1 Message Date
Felipe Contreras 67052c9dcf git config: don't allow multiple config file locations
Either --global, --system, or --file can be used, but not any
combination.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:37:44 -08:00
Felipe Contreras d64ec16c2a git config: reorganize to use parseopt
This patch has benefited from comments by Johannes
Schindelin and Junio C Hamano.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:37:37 -08:00
Felipe Contreras 0e854a280a git config: reorganize get_color*
In preparation for parseopt.

Also remove some unecessary comments since the usage is described in the
documentation.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:37:19 -08:00
Felipe Contreras b408457f2e git config: trivial rename in preparation for parseopt
Essentially this replaces 'file' with 'prefix' in the cases where the
variable is used as a prefix, which is consistent with other git
commands.

When using the --list option general errors where not properly reported,
only errors related with the 'file'. Now they are reported, and 'file'
is irrelevant.

That reduces the rest of 'file' usage to nothing, therefore now only
'prefix' remains.

Suggested by Johannes Schindelin.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:36:07 -08:00
Felipe Contreras aa38740791 git_config(): not having a per-repo config file is not an error
Currently git_config() returns an error if there is no repo config file
available (cwd is not a git repo); it will correctly parse the system
and global config files, but still return an error.

It doesn't affect anything else since almost nobody is checking for the
return code (with the exception of 'git remote update').

A reorganization in 'git config' would benefit from being able to
properly detect errors in git_config() without the noise generated when
cwd is not a git repo.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:35:50 -08:00
Johannes Schindelin 414f2e5337 git config: trivial cleanup for editor action
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:35:48 -08:00
Felipe Contreras 4b951b7eb0 git config: codestyle cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-21 20:35:43 -08:00
Felipe Contreras 3bec8ff99a config: Add new option to open an editor.
The idea was originated by discussion about usability of manually
editing the config file in 'special needs' systems such as Windows. Now
the user can forget a bit about where the config files actually are.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-08 13:02:34 -08:00
Junio C Hamano 621f1b4bcf GIT 1.6.2-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07 11:18:40 -08:00
Junio C Hamano c19923add0 Merge branch 'tr/add-p-single'
* tr/add-p-single:
  add -p: import Term::ReadKey with 'require'
  add -p: print errors in separate color
  add -p: prompt for single characters
2009-02-07 11:10:16 -08:00
Junio C Hamano df4364a429 Merge branch 'js/filter-branch-submodule'
* js/filter-branch-submodule:
  filter-branch: do not consider diverging submodules a 'dirty worktree'
  filter-branch: Fix fatal error on bare repositories
2009-02-07 11:09:48 -08:00
Junio C Hamano 7de265a4cf Merge branch 'maint'
* maint:
  GIT 1.6.1.3

Conflicts:
	GIT-VERSION-GEN
	RelNotes
2009-02-07 10:44:25 -08:00
Alexandre Julliard 7851386948 emacs: Remove the no longer maintained vc-git package.
vc-git is distributed with Emacs since version 22.2, and is maintained
in the Emacs CVS tree. This file is obsolete and causes trouble for
people who want to add contrib/emacs to their load-path.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 15:14:27 +01:00
Alexandre Julliard 5a7b3bf527 git.el: Add some notes about Emacs versions compatibility.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 15:14:22 +01:00
Alexandre Julliard 6c4f70d5b2 git.el: Use integer instead of character constants in case statement.
This is for compatibility with XEmacs. Reported by Vassili Karpov.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 14:01:44 +01:00
Alexandre Julliard efd49f50fc git.el: Set a regexp for paragraph-separate in log-edit mode.
This allows using fill-paragraph on the log message without
interference from the various header fields.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard a7da5c4259 git.el: Make git-run-command-region display the error if any.
This makes it easier to figure out why a commit has failed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard ab69e3e43a git.el: Add commands for cherry-pick and revert.
Support for cherry-picking and reverting commits, with automatic
formatting of the commit log message. Bound to C-c C-p and C-c C-v
respectively.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard 811b10c746 git.el: Add a command to create a new branch.
Prompts for a branch name, create a new branch at HEAD and switch to
it. Bound to C-c C-b by default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard c375e9d04c git.el: Add a checkout command.
Prompts for a branch name and checks it out. Bound to C-c C-o by
default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:48 +01:00
Junio C Hamano b59122f86f GIT 1.6.1.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07 00:51:47 -08:00
Thomas Rast 748aa689ba add -p: import Term::ReadKey with 'require'
eval{use...} is no good because the 'use' is evaluated at compile
time, so manually 'require' it.  We need to forward declare the
functions we use, otherwise Perl raises a compilation error.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07 00:37:36 -08:00
Junio C Hamano ba743d1b0c Merge branch 'js/maint-remote-remove-mirror'
* js/maint-remote-remove-mirror:
  builtin-remote: make rm operation safer in mirrored repository
  builtin-remote: make rm() use properly named variable to hold return value
2009-02-05 19:40:41 -08:00
Junio C Hamano 7b75b331f6 Merge branch 'js/notes'
* js/notes:
  git-notes: fix printing of multi-line notes
  notes: fix core.notesRef documentation
  Add an expensive test for git-notes
  Speed up git notes lookup
  Add a script to edit/inspect notes
  Introduce commit notes

Conflicts:
	pretty.c
2009-02-05 19:40:39 -08:00
Junio C Hamano 5d680a67d7 Merge branch 'jc/refuse-push-to-current'
* jc/refuse-push-to-current:
  receive-pack: explain what to do when push updates the current branch
2009-02-05 19:40:36 -08:00
Junio C Hamano 7aa4e736b2 Merge branch 'rc/http-push'
* rc/http-push:
  http-push: wrap signature of get_remote_object_url
  http-push: add back underscore separator before lock token
  http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI
  http-push: refactor request url creation
2009-02-05 19:40:36 -08:00
Junio C Hamano 9242431ca0 Merge branch 'gt/utf8-width'
* gt/utf8-width:
  builtin-blame.c: Use utf8_strwidth for author's names
  utf8: add utf8_strwidth()
2009-02-05 19:40:35 -08:00
Junio C Hamano 74b11bc3be Merge branch 'jk/head-symref'
* jk/head-symref:
  symbolic ref: refuse non-ref targets in HEAD
  validate_headref: tighten ref-matching to just branches
2009-02-05 19:40:35 -08:00
Junio C Hamano b371922aa5 Merge branch 'cb/mergetool'
* cb/mergetool:
  mergetool: fix running mergetool in sub-directories
  mergetool: Add a test for running mergetool in a sub-directory
  mergetool: respect autocrlf by using checkout-index
2009-02-05 19:40:35 -08:00
Junio C Hamano 84b96278cc Merge branch 'maint'
* maint:
  Fixed broken git help -w when installing from RPM
2009-02-05 19:40:25 -08:00
Junio C Hamano 919ab6429a Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  Fixed broken git help -w when installing from RPM
2009-02-05 19:38:58 -08:00
Junio C Hamano c7893501e8 Merge branch 'jc/maint-apply-fix' into maint
* jc/maint-apply-fix:
  builtin-apply.c: do not set bogus mode in check_preimage() for deleted path
2009-02-05 18:06:11 -08:00
Junio C Hamano 7b261711a6 Merge branch 'am/maint-push-doc' into maint
* am/maint-push-doc:
  Documentation: rework src/dst description in git push
  Documentation: more git push examples
  Documentation: simplify refspec format description
2009-02-05 18:06:03 -08:00
Junio C Hamano f20408dadb Merge branch 'sg/maint-gitdir-in-subdir' into maint
* sg/maint-gitdir-in-subdir:
  Fix gitdir detection when in subdir of gitdir
2009-02-05 18:05:43 -08:00
Junio C Hamano 141b6b83d7 Merge branch 'lt/maint-wrap-zlib' into maint
* lt/maint-wrap-zlib:
  Wrap inflate and other zlib routines for better error reporting

Conflicts:
	http-push.c
	http-walker.c
	sha1_file.c
2009-02-05 18:01:00 -08:00
Junio C Hamano cc91e1bd05 Merge branch 'jc/maint-split-diff-metainfo' into maint
* jc/maint-split-diff-metainfo:
  diff.c: output correct index lines for a split diff
2009-02-05 17:54:17 -08:00
Junio C Hamano 8abc61880d Merge branch 'js/maint-all-implies-HEAD' into maint
* js/maint-all-implies-HEAD:
  bundle: allow the same ref to be given more than once
  revision walker: include a detached HEAD in --all
2009-02-05 17:54:12 -08:00
Junio C Hamano 8c4c286c39 Merge branch 'kc/maint-diff-bwi-fix' into maint
* kc/maint-diff-bwi-fix:
  Fix combined use of whitespace ignore options to diff
  test more combinations of ignore-whitespace options to diff
2009-02-05 17:52:22 -08:00
Johannes Schindelin 26be15f09d filter-branch: do not consider diverging submodules a 'dirty worktree'
At the end of filter-branch in a non-bare repository, the work tree is
updated with "read-tree -m -u HEAD", to carry the change forward in case
the current branch was rewritten.  In order to avoid losing any local
change during this step, filter-branch refuses to work when there are
local changes in the work tree.

This "read-tree -m -u HEAD" operation does not affect what commit is
checked out in a submodule (iow, it does not touch .git/HEAD in a
submodule checkout), and checking if there is any local change to the
submodule is not useful.

Staged submodules _are_ considered to be 'dirty', however,  as the
"read-tree -m -u HEAD" could result in loss of staged information
otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 17:48:04 -08:00
Thomas Rast a301973641 add -p: print errors in separate color
Print interaction error messages in color.interactive.error, which
defaults to the value of color.interactive.help.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 17:44:39 -08:00
Thomas Rast ca6ac7f135 add -p: prompt for single characters
Use Term::ReadKey, if available and enabled with interactive.singlekey,
to let the user answer add -p's prompts by pressing a single key.  We're
not doing the same in the main 'add -i' interface because file selection
etc. may expect several characters.

Two commands take an argument: 'g' can easily cope since it'll just
offer a choice of chunks.  '/' now (unconditionally, even without
readkey) offers a chance to enter a regex if none was given.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 17:44:10 -08:00
Jay Soffian 7233d221ad Makefile: minor improvements for Mac OS X (Darwin)
1) Instead of requesting OLD_ICONV on all Mac OS X versions except for 10.5
(which will break when 10.6 is released), exlicitly request it for versions
older than 10.5.

2) NO_STRLCPY is not needed since Mac OS X 10.2. Noticed by Benjamin Kramer.

Note that uname -r returns the underlying Darwin version, which can be mapped
to Mac OS X version at http://www.opensource.apple.com/darwinsource/

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 00:33:40 -08:00
Pascal Obry 98bb1ff83c config.mak.in: define paths without trailing slash
The main Makefile defines gitexecdir and template_dir without trailing
slash.  config.mak.in should do the same to be consistent.

Signed-off-by: Pascal Obry <pascal@obry.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 00:29:23 -08:00
Junio C Hamano 0c0ead7e79 Makefile: fix misdetection of relative pathnames
The installation rules wanted to differentiate between a template_dir that
is given as an absolute path (e.g. /usr/share/git-core/templates) and a
relative one (e.g. share/git-core/templates) but it was done by checking
if $(abspath $(template_dir)) and $(template_dir) yield the same string.

This was wrong in at least two ways.

 * The user can give template_dir with a trailing slash from the command
   line to invoke make or from the included config.mak.  A directory path
   ought to mean the same thing with or without such a trailing slash but
   use of $(abspath) means an absolute path with a trailing slash fails
   the test.

 * Versions of GNU make older than 3.81 do not have $(abspath) to begin
   with.

This changes the detection logic to see if the given path begins with a
slash.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 00:28:43 -08:00
David J. Mellor ab2fdb3b62 Fixed broken git help -w when installing from RPM
After the git-core package was renamed to git, git help -w was still looking
for files in /usr/share/doc/git-core-$VERSION instead of
/usr/share/doc/git-$VERSION.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 22:00:49 -08:00
Junio C Hamano 88ccb9f974 Merge branch 'jc/fsck' (early part)
* 'jc/fsck' (early part):
  fsck: check loose objects from alternate object stores by default
  fsck: HEAD is part of refs
2009-02-04 16:40:15 -08:00
Geoffrey Thomas ffaf9cc0ff builtin-blame.c: Use utf8_strwidth for author's names
git blame misaligns output if a author's name has a differing display width and
strlen; for instance, an accented Latin letter that takes two bytes to encode
will cause the rest of the line to be shifted to the left by one. To fix this,
use utf8_strwidth instead of strlen (and compute the padding ourselves, since
printf doesn't know about UTF-8).

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 16:30:45 -08:00
Geoffrey Thomas 8a9391e944 utf8: add utf8_strwidth()
I'm about to use this pattern more than once, so make it a common function.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 16:30:43 -08:00
Nanako Shiraishi 8aa7eebfb3 git-bundle doc: update examples
This rewrites the example part of the bundle doucmentation to follow
the suggestion made by Junio during a recent discussion (gmane 108030).

Instead of just showing different ways to create and use bundles in a
disconnected fashion, the rewritten example first shows the simplest
"full cycle" of sneakernet workflow, and then introduces various
variations.

The words are mostly taken from Junio's outline. I only reformatted
them and proofread to make sure the end result flows naturally.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 15:16:35 -08:00
Alexander Potashev 34263de026 Replace deprecated dashed git commands in usage
Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 15:08:49 -08:00