1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 07:17:58 +01:00
Commit graph

5735 commits

Author SHA1 Message Date
Junio C Hamano
bc9e1b8483 Merge branch 'rs/rebase'
* rs/rebase:
  rebase: Make the fast-fowarding message more user-friendly by using branch names instead of SHA1 IDs.
  rebase: Fix the detection of fast-forwarding of the current branch to upstream.
2006-07-31 23:02:28 -07:00
Junio C Hamano
056d6d4e89 Merge branch 'ml/pager' 2006-07-31 23:00:51 -07:00
Junio C Hamano
0225de86a4 Merge branch 'jc/checkout'
* jc/checkout:
  git-checkout: allow "checkout HEAD -- path"
2006-07-31 22:59:33 -07:00
Matthias Lederhofer
aa086eb813 pager: config variable pager.color
enable/disable colored output when the pager is in use

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 15:32:24 -07:00
Junio C Hamano
9590b041ea Builtins: control the use of pager from the command table.
This moves the built-in "always-use-pager" logic for log family
to the command dispatch table of git wrapper.  This makes it
easier to change the default use of pager, and has an added
benefit that we fork and exec the pager early before packs are
mmapped.

Pointed out by Juergen Ruehle <j.ruehle@bmiag.de>.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 15:32:23 -07:00
Linus Torvalds
3e04228b0c Fix up some fallout from "setup_git_directory()" cleanups
git-ls-files was broken by the setup_git_directory() calling changes,
because I had missed the fact that the "prefix" variable in that file was
static to the whole file, and unlike git-ls-tree (where I had fixed it
up), it ended up using two different variables with the same name
depending on what the scoping happened to be.

This fixes it up properly (by just removing the static variable, and
passing the automatic one around properly), and git-ls-files should work
again.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 13:42:13 -07:00
Linus Torvalds
7f8508e8d3 Fix double "close()" in ce_compare_data
Doing an "strace" on "git diff" shows that we close() a file descriptor
twice (getting EBADFD on the second one) when we end up in ce_compare_data
if the index does not match the checked-out stat information.

The "index_fd()" function will already have closed the fd for us, so we
should not close it again.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 11:55:56 -07:00
Junio C Hamano
2608003f55 git-checkout: allow "checkout HEAD -- path"
Even though -- is redundant in this case, we should allow it to prevent
confusion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 03:07:12 -07:00
Robert Shearman
d587ed13bc rebase: Make the fast-fowarding message more user-friendly by using branch names instead of SHA1 IDs.
Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 00:15:59 -07:00
Robert Shearman
83c31614ce rebase: Fix the detection of fast-forwarding of the current branch to upstream.
Previously, a rebasing operation with on a branch that is just tracking
an upstream branch would output a confusing "Nothing to do" due to no
patches being given to git-am.

The test brings the behaviour back into line with that of just before
e646c9c8c0.

Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-31 00:15:59 -07:00
Johannes Schindelin
b63fafdfd8 tar-tree: illustrate an obscure feature better
Since you can tar just a subdirectory of a certain revision, tell
the users so, by showing an example how to do it.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 18:18:13 -07:00
Matthias Lederhofer
0347a8c764 git.c: allow alias expansion without a git directory
With this, the configuration mechanism can be used to say:

	[alias]
		init = init-db --template=/path/to/template

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 17:45:57 -07:00
Matthias Lederhofer
41e95f6990 setup_git_directory_gently: do not barf when GIT_DIR is given.
Earlier we barfed when GIT_DIR environment variable points at a
directory yet to be created, which made it impossible to use
configuration mechanism in "git-init-db".

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 17:45:57 -07:00
Gerrit Pape
ca7a741647 Build on Debian GNU/kFreeBSD
Patch from Petr Salinger to make the build process detect and support the
Debian GNU/kFreeBSD architecture, see
 http://bugs.debian.org/380209

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 13:36:12 -07:00
Junio C Hamano
e6a4e5816e Merge branch 'lt/web'
* lt/web:
  gitweb.cgi: git_blame2: slight optimization reading the blame lines
  gitweb.cgi: git_blame2: Revision blocks now have alternating colors
  gitweb.cgi: git_blame2: Allow back-trekking through commits
  gitweb.cgi: git_blame2: an alternative simple working git blame
2006-07-30 13:35:08 -07:00
Junio C Hamano
3fe5dbf57f Merge branch '__/setup-n-mv'
* __/setup-n-mv:
  Call setup_git_directory() much earlier
  Call setup_git_directory() early
2006-07-30 13:34:52 -07:00
Junio C Hamano
522a98caa5 Merge branch 'js/mv'
* js/mv:
  builtin git-mv: support moving directories
  Make git-mv a builtin
  Extract helper bits from c-merge-recursive work
2006-07-30 13:24:48 -07:00
Junio C Hamano
2dcb927f37 Merge branch 'jn/make'
* jn/make:
  Set datarootdir in config.mak.in
  Quote all calls to GIT_CONF_APPEND_LINE
  Typofix in configure.ac comment.
  configure.ac vertical whitespace usage cleanup
  autoconf: Checks for some programs
  autoconf: Checks for libraries
  autoconf: Checks for some library functions.
  autoconf: Checks for typedefs, structures, and compiler characteristics.
  autoconf: Preparing the way for autodetection
  Copy description of build configuration variables to configure.ac
  Teach make clean about configure and autoconf
  autoconf: Use autoconf to write installation directories to config.mak.autogen
2006-07-30 13:24:29 -07:00
Junio C Hamano
7061cf0f20 Merge branch 'lt/setup' into __/setup-n-mv
This merges the new built-in calling convention code into Johannes's
builtin-mv topic in order to resolve their conflicts early on.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-29 01:54:54 -07:00
Linus Torvalds
a633fca0c0 Call setup_git_directory() much earlier
This changes the calling convention of built-in commands and
passes the "prefix" (i.e. pathname of $PWD relative to the
project root level) down to them.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-29 01:34:07 -07:00
Linus Torvalds
db6296a566 Call setup_git_directory() early
Any git command that expects to work in a subdirectory of a project, and
that reads the git config files (which is just about all of them) needs to
make sure that it does the "setup_git_directory()" call before it tries to
read the config file.

This means, among other things, that we need to move the call out of
"init_revisions()", and into the caller.

This does the mostly trivial conversion to do that.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 22:03:06 -07:00
Shawn Pearce
818f477c40 Display an error from update-ref if target ref name is invalid.
Alex Riesen (raa.lkml@gmail.com) recently observed that git branch
would fail with no error message due to unexpected situations with
regards to refs.  For example, if .git/refs/heads/gu is a file but
"git branch -b refs/heads/gu/fixa HEAD" was invoked by the user
it would fail silently due to refs/heads/gu being a file and not
a directory.

This change adds a test for trying to create a ref within a directory
that is actually currently a file, and adds error printing within
the ref locking routine should the resolve operation fail.

The error printing code probably belongs at this level of the library
as other failures within the ref locking, writing and logging code
are also currently at this level of the code.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 20:53:53 -07:00
Johannes Schindelin
1b03dfed18 Fix http-fetch
With the latest changes in fetch.c, http-fetch crashed accessing
write_ref[i], where write_ref was NULL.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 17:13:00 -07:00
Junio C Hamano
fff8fd5b1e Merge branch 'pb/multi-fetch'
* pb/multi-fetch:
  Teach git-http-fetch the --stdin switch
  Teach git-local-fetch the --stdin switch
  Make pull() support fetching multiple targets at once
  Make pull() take some implicit data as explicit arguments
2006-07-28 13:25:20 -07:00
Junio C Hamano
556032566e Merge branch 'lt/web' 2006-07-28 13:19:38 -07:00
Junio C Hamano
922819c3d5 Merge branch 'js/cvs'
* js/cvs:
  cvsserver: imitate git-update-ref when committing
2006-07-28 13:18:19 -07:00
Junio C Hamano
205be1ee07 Merge branch 'js/alias-p'
* js/alias-p:
  git wrapper: add --git-dir=<path> and --bare options
  Allow an alias to start with "-p"
2006-07-28 12:33:57 -07:00
Junio C Hamano
f789f82993 Merge branch 'jc/diff'
* jc/diff:
  git-diff A...B to (usually) mean "git-diff `git-merge-base A B` B"
2006-07-28 12:23:52 -07:00
Junio C Hamano
5afa69b415 t4103: fix binary patch application test.
The generated binary patch was _not_ binary -- earlier I made
the --full-index flag to imply binary patch generation to the diff
machinery, but later we made it independent from --binary (although
the latter implies the former).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 12:23:28 -07:00
Junio C Hamano
ab9f30fd75 git-apply -R: binary patches are irreversible for now.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 12:21:17 -07:00
Johannes Schindelin
e5a94313c0 Teach git-apply about '-R'
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 11:18:02 -07:00
Johannes Schindelin
2941cab99c Makefile: ssh-pull.o depends on ssh-fetch.c
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 11:15:35 -07:00
Junio C Hamano
ef1d9c5aa4 log and diff family: honor config even from subdirectories
There currently is an unfortunate circular dependency between
what init_revisions (the command line revision specification
parser) does and setting up the log and diff options.  The
function uses setup_git_directory() to find the root of the
project relative to the current directory and calls diff_setup()
to prepare diff generation.  However, some of the things that
diff_setup() does needs to depend on the configuration variable,
which needs to be read after setup_git_directory() is called.

This patch is a low impact workaround.  It first lets
init_revisions() to run and do its thing, then uses git_config()
and diff_setup() after it returns, so that configuration
variables that affects the diff operation can be used from
subdirectories.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 22:55:44 -07:00
Junio C Hamano
dee4e384f3 git-reset: detect update-ref error and report it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 22:27:44 -07:00
Junio C Hamano
5f468c4805 lost-found: use fsck-objects --full
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 22:15:01 -07:00
Petr Baudis
8e29f6a07e Teach git-http-fetch the --stdin switch
Speeds up things quite a lot when fetching tags with Cogito.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 19:33:48 -07:00
Petr Baudis
8e87ca6615 Teach git-local-fetch the --stdin switch
This makes it possible to fetch many commits (refs) at once, greatly
speeding up cg-clone.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 19:33:48 -07:00
Petr Baudis
4211e4d10c Make pull() support fetching multiple targets at once
pull() now takes an array of arguments instead of just one of each kind.
Currently, no users use the new capability, but that'll change.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 19:33:48 -07:00
Petr Baudis
c6b69bdbc1 Make pull() take some implicit data as explicit arguments
Currently it's a bit weird that pull() takes a single argument
describing the commit but takes the write_ref from a global variable.
This makes it take that as a parameter as well, which might be nicer
for the libification in the future, but especially it will make for
nicer code when we implement pull()ing multiple commits at once.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 19:33:48 -07:00
Michael S. Tsirkin
c2c487cf3a mailinfo: accept >From in message header
Mail I get sometimes has multiple From lines, like this:

    From Majordomo@vger.kernel.org  Thu Jul 27 16:39:36 2006
    >From mtsirkin  Thu Jul 27 16:39:36 2006
    Received: from yok.mtl.com [10.0.8.11]
    ...

which confuses git-mailinfo since that does not recognize >From
as a valid header line.

This patch makes it recognize >From XXX as a valid header line.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 19:33:06 -07:00
Petr Baudis
cc41cd2e60 Remove -d from *-fetch usage strings
This is a really ancient remnant of the short era of delta objects stored
directly in the object database.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 14:21:03 -07:00
Matthias Lederhofer
6c35119ac7 daemon: documentation for --reuseaddr, --detach and --pid-file
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 13:55:31 -07:00
Johannes Schindelin
cadbcf2712 cvsserver: imitate git-update-ref when committing
git-update-ref writes into the lockfile, and renames it afterwards. Like
commit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared
setups: every developer can have a different primary group; what matters
is that $GIT_DIR/refs/heads has to be writable by a group you are in.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 14:32:13 -07:00
Johannes Schindelin
5209eda863 instaweb: Be more clear if httpd or the browser fail
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 14:29:40 -07:00
Johannes Schindelin
ac64a72207 builtin git-mv: support moving directories
This fixes the builtin mv for the test which Josef provided, and also
fixes moving directories into existing directories, as noted by Jon Smirl.
In case the destination exists, fail early (this cannot be overridden
by -f).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Johannes Schindelin
11be42a476 Make git-mv a builtin
This also moves add_file_to_index() to read-cache.c. Oh, and while
touching builtin-add.c, it also removes a duplicate git_config() call.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Johannes Schindelin
8fd2cb4069 Extract helper bits from c-merge-recursive work
This backports the pieces that are not uncooked from the merge-recursive
WIP we have seen earlier, to be used in git-mv rewritten in C.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Junio C Hamano
24cf6e5847 Merge branch 'pb/configure'
* pb/configure:
  Rename man1 and man7 variables to man1dir and man7dir
  Allow INSTALL, bindir, mandir to be set in main Makefile
2006-07-26 13:35:35 -07:00
Johannes Schindelin
2c3cff4930 git-cvsserver: support multiline commit messages
Earlier, cvsserver barfed when you tried to check in files with a
multiline commit message.

That is what Argumentx is for... Argument: lines can be followed by
several Argumentx: lines, which means they should be appended.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:03:01 -07:00
Johannes Schindelin
a1dad607fa t7001: add test for git-mv dir1 dir2/
If dir2 already exists, git-mv should move dir1 _into_dir2/.
Noticed by Jon Smirl.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 12:24:49 -07:00