Commit Graph

2757 Commits

Author SHA1 Message Date
Alex Riesen
8bf2c69c2d [PATCH] Add tests for git-mv in subdirectories
Junio C Hamano, Sat, Nov 26, 2005 03:45:52 +0100:

> I haven't seriously used git-mv myself, so
> somebody needs to test it, and if it actually works and Ack on
> it, please.

It actually works in subdirs.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 15:43:20 -08:00
Johannes Schindelin
4518bb8839 [PATCH] Make git-mv work in subdirectories, too
Turns out, all git programs git-mv uses are capable of operating in
a subdirectory just fine. So don't complain about it.

[jc: I think that sounds sane.  You need to grab the exit status from
 `git-rev-parse --git-dir`, which I added.  Alex Riesen says this
 worked fine.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 15:34:46 -08:00
Paul Mackerras
712fcc08c7 gitk: Add a preferences dialog with some basic stuff
There is a lot more that could be put in, such as a selector for
the font family etc., but this is a start.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-30 09:28:16 +11:00
Junio C Hamano
830273d10c format-patch: run diff in C locale
Otherwise it would show incomplete line and binary markers in
a locale dependent way.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:27:59 -08:00
Junio C Hamano
a004d3f70f format-patch: do not abuse 3-dash marker line.
Before GIT version at the end of output we used a 3-dash marker;
but 3-dash marker is special and should not be overused.
Instead, use "-- " which is a standard practice in e-mails to
signal the beginning of trailing garbage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:26:48 -08:00
Junio C Hamano
99e368b996 format-patch: remove applies-to.
The attempt to help 3-way fallback by recording the tree object
id for the entire pre-image was unnecessary, and we already have
an better alternative in the form of per-blob "index" lines.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:25:00 -08:00
Junio C Hamano
bf3e274873 applypatch: use "index" lines not "applies-to".
This matches the 3-way fallback used by applypatch to use
per-blob "index" lines, not "applies-to" tree object name, to
match what git-am does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:18:27 -08:00
Junio C Hamano
e1355547fd applymbox: typofix to enable -m option.
The -m option to fall back on 3-way merge was not honoured at
all because of a typo.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 14:14:42 -08:00
Matthias Urlichs
034908047d SVN import: Use one log call
One "svn log" (or its equivalent) per revision adds delay and server load.
Instead, open two SVN connections -- one for the log, and one for the files.

Positive side effect: Only those log entries which actually contain data
are committed => no more empty commits.

Also, change the "-l" option to set the maximum revision to be pulled,
not the number of revisions.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 10:51:43 -08:00
jdl@freescale.com
b020dcd54c Fix typos and minor format issues.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 10:51:41 -08:00
Nick Hengeveld
3e9fabc85e http-push cleanup
The malloc patch from Jan Andres fixed the problem that was causing a
segfault when freeing the lock token, and Johannes Schindelin found
and fixed a problem when no URL is specified on the command line.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29 10:51:39 -08:00
Pavel Roskin
2c4ed386e8 git-clone --shared should imply --local
The "--shared" option to git-clone is silently ignored if "--local" is
not specified.  The manual doesn't mention such dependency.  Make
"--shared" imply "--local".

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:55:12 -08:00
Junio C Hamano
99e0169206 hash-object.c: type-fix to squelch compiler warnings.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
d165fa14f0 define die() for scripts that use it.
As a fallout from not using git-sh-setup in scripts that can
operate from a subdirectory, we lost definition of die() from
them.  It might make sense to do some cleanup to consolidate
them back again, but this should suffice for now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
d6ea70af77 verify-tag: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
7ea2fc47d2 tag: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
eefaa4fca7 lost-found: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
9cc2527cd2 branch: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
1abacf3b5b ls-remote: define die() now we do not use git-sh-setup
Another interesting "property" is that from inside a git managed
tree, "git-ls-remote ." names the current repository no matter
how deep a subdirectory you are in.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:03 -08:00
Junio C Hamano
710b7098e2 count-objects: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
53228a5fb8 Make the rest of commands work from a subdirectory.
These commands are converted to run from a subdirectory.

    commit-tree convert-objects merge-base merge-index mktag
    pack-objects pack-redundant prune-packed read-tree tar-tree
    unpack-file unpack-objects update-server-info write-tree

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
5a3277133d Make networking commands to work from a subdirectory.
These are whole-tree operations and there is not much point
making them operable from within a subdirectory, but it is easy
to do so, and using setup_git_directory() upfront helps git://
proxy specification picked up from the correct place.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
b191fa72ea ls-tree: work from subdirectory.
This makes ls-tree to work from subdirectory.  It defaults to
show the paths under the current subdirectory, and interprets
user-supplied paths as relative to the current subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
706fe6ae03 hash-object: work within subdirectory.
When -w is given, it needs to find out where the .git directory
is, so run the setup_git_directory() when we see a -w.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
c3e9a6534c checkout-index: work from subdirectory.
With this, git-checkout-index from a subdirectory works as
expected.  Note that "git-checkout-index -a" checks out files
only in the current directory and under.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
61e2b01529 fsck-objects: work from subdirectory.
Not much point making it work from subdirectory, but for a
consistency make it so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
e44eb3e4c7 peek-remote: honor proxy config even from subdirectory.
Use setup_git_directory_gently() at the beginning of peek-remote
so that git:// proxy can be picked up from the configuration
file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:02 -08:00
Junio C Hamano
edf2e37002 git-apply: work from subdirectory.
When applying a patch to index file, we need to know where GIT_DIR is;
use setup_git_directory() to find it out.  This also allows us to work
from a subdirectory if we wanted to.

When git-apply is run from a subdirectory, it applies the given patch
only to the files under the current directory and below.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:01 -08:00
Junio C Hamano
4ca0660816 working from subdirectory: preparation
- prefix_filename() is like prefix_path() but can be used to
   name any file on the filesystem, not the files that might go
   into the index file.

 - setup_git_directory_gently() tries to find the GIT_DIR, but does
   not die() if called outside a git repository.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:13:01 -08:00
Junio C Hamano
e9a45d75b5 bisect: quote pathnames for eval safety.
... and make sure they are on the same line.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:11:38 -08:00
Linus Torvalds
b3cfd939c3 bisect: limit the searchspace by pathspecs
It was surprisingly easy to do.

	git bisect start <pathspec>

followed by all the normal "git bisect good/bad" stuff.

Almost totally untested, and I guarantee that if your pathnames have
spaces in them (or your GIT_DIR has spaces in it) this won't work. I don't
know how to fix that, my shell programming isn't good enough.

This involves small changes to make "git-rev-list --bisect" work in the
presense of a pathspec limiter, and then truly trivial (and that's the
broken part) changes to make "git bisect" save away and use the pathspec.

I tried one bisection, and a "git bisect visualize", and it all looked
correct. But hey, don't be surprised if it has problems.

		Linus

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:11:38 -08:00
Junio C Hamano
246cc52f38 ls-tree: match the test to the new semantics.
The diff for this commit is a good illustration of what changed
in ls-tree behaviour.

 - With -r, tree nodes themselves are not shown anymore, but
   blobs in subtrees are shown.

 - The order of paths parameters do not matter, since they are
   not like arguments to /bin/ls, but are filter patterns.

 - When filter patterns overlap, unintuitive things happen.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:06:29 -08:00
Junio C Hamano
32b5904b5f ls-tree: Resurrect funny name quoting lost during rewrite.
The rewrite to match ls-files/diff-tree behaviour accidentally
lost the name quoting.  I am not proud about this code, but this
would get the test going.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 23:03:12 -08:00
Linus Torvalds
e2466376ec ls-tree: further tweaks of the rewrite
It modifies the selection a bit, so that a pathspec that is a superset of
a particular tree path will always cause it to recurse into that tree.

As an example, let's say that we do

	git-ls-tree HEAD drivers/char

_without_ the "-r". What will happen is that it will start out doing all
the base tree, and for "drivers" it will notice that it's a proper subset
of "drivers/char", so it will always recurse into _that_ tree (but not
into other trees).

Then, it will not match anything else than "char" in that subdirectory,
and because that's not a proper superset (it's an exact match), it will
_not_ recurse into it, so you get:

	[torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char
	040000 tree 9568cda453aae205bb58983747fa73b9696d9d51    drivers/char

which is what you got with the old git-ls-tree too.

But interestingly, if you add the slash, it will become a proper superset
and it will recurse into _that_ subdirectory (but no deeper: so if you
want all subdirectories _below_ drivers/char/, you still need to give
"-r"):

	[torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char/
	100644 blob 2b6b1d772ed776fff87927fc34adc2e40500218e    drivers/char/.gitignore
	100644 blob 56b8a2e76ab10a5c21787cb7068a846075cbaffd    drivers/char/ChangeLog
	100644 blob 970f70d498f4c814e1cf3362e33d7e23ac53c299    drivers/char/Kconfig
	...

See? This is on top of the previous two diffs, holler if you want a whole
new "everything combined" version..

It hasn't gotten lots of testing, but it should work.

		Linus
2005-11-28 23:00:14 -08:00
Linus Torvalds
b45c569b6f ls-tree: further cleanup to parallel ls-files.
To get more a "git-ls-files" approach, this trivial patch (on top of my
previous one) enables recursion, and doesn't show partial trees.

[jc: after further discussion, this version enables recursion by default,
 and you can disable it with "-d" flag.

	git-ls-tree -d HEAD Documentation/no/such/directory

 shows Documentation tree (without -d it shows nothing).

	git-ls-tree HEAD

 shows everything from the tree.  Only to get the single level from the top

	git-ls-tree -d HEAD

 is needed.  But there is no way to get the single level with pathspec.
 You need to extract the object name of Documentation tree from the parent
 tree and run

	git-ls-tree -d $tree_id_of_Documentation_tree

 to get something similar to what you can get from the current

	git-ls-tree HEAD Documentation
 ]
2005-11-28 23:00:14 -08:00
Linus Torvalds
3c5e8468a9 ls-tree: major rewrite to do pathspec
git-ls-tree should be rewritten to use a pathspec the same way everybody
else does. Right now it's the odd man out: if you do

	git-ls-tree HEAD divers/char drivers/

it will show the same files _twice_, which is not how pathspecs in general
work.

How about this patch? It breaks some of the git-ls-tree tests, but it
makes git-ls-tree work a lot more like other git pathspec commands, and it
removes more than 150 lines by re-using the recursive tree traversal (but
the "-d" flag is gone for good, so I'm not pushing this too hard).

		Linus
2005-11-28 23:00:14 -08:00
Junio C Hamano
9ef2b3cbf6 write_name_quoted(): make one of the path a counted string.
This is to prepare for ls-tree updates.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 22:55:25 -08:00
Junio C Hamano
ffb1a4bed5 Documentation: Describe merge operation a bit better.
In git-merge documentation, add a section to describe what happens to
the index and working tree during merge, and what their cleanliness
requirements are before the merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 22:54:30 -08:00
Jan Andres
3e2f62bebf Fix typo in http-push.c
Typo resulted in accessing past the beginning of a string causing segfaults.

[jc: signoffs?]
2005-11-28 21:56:30 -08:00
Junio C Hamano
f2e6f1c976 name-rev: fix parent counting.
Noticed by linux@horizon.com.  The first merge parent (typically
"our branch") is ^1, not ^0, and the first other branch is ^2.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 20:51:44 -08:00
Junio C Hamano
7f4bd5d831 rebase: one safety net, one bugfix and one optimization.
When a .dotest from a previously failed rebase or patch
application exists, rebase got confused and tried to apply
mixture of what was already there and what is being rebased.
Check the existence of the directory and barf.

It failed with an mysterious "fatal: cannot read mbox" message
if the branch being rebased is fully in sync with the base.
Also if the branch is a proper descendant of the base, there is
no need to run rebase logic.  Prevent these from happening by
checking where the merge-base is.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 13:00:31 -08:00
Junio C Hamano
36d277c72d Merge http://www.kernel.org/pub/scm/gitk/gitk 2005-11-28 03:11:11 -08:00
Junio C Hamano
90109b320d git-mv: quote $src in regexp properly.
Noticed and fixed by Matthias Urlichs and Josef Weidendorfer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 02:54:05 -08:00
Junio C Hamano
671bc1538a [PATCH] gitk: Use i18n.commitencoding configuration item.
Hardcoding "utf-8" in the script breaks projects that use local
encoding, so allow setting i18n.commitEncoding.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-28 20:46:49 +11:00
Junio C Hamano
0dccc7dcee config.c: constness tightening to avoid compilation warning.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 01:46:15 -08:00
Paul Mackerras
d327244a84 gitk: Fix diff this->selected and selected->this functions
The change in 8b7e5d76e8, which makes
a couple of git-diff-tree calls supply only one id rather than two,
fixes the display when showing what a single commit did with dense
revlists, but broke the diff this->selected and diff selected->this
right-click menu functions.

Yann Dirson pointed this out and had a patch that fixed the diff
menu functions by passing a "singlecommit" flag around.  This fixes
it a bit differently, by making the ids and diffids variables be
either a single id, in the case of showing what a commit did, or
{oldid newid}, in the case of the diff menu functions.  That way
we can just pass $ids to git-diff-tree as is.  Most of the changes
in fact are just reversing the order of ids in $ids and $diffids,
because they used to be {child parent}, but git-diff-tree requires
old id before new id.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-11-28 20:41:56 +11:00
Junio C Hamano
9f63892b38 mailinfo: Do not use -u=<encoding>; say --encoding=<encoding>
Specifying the value for a single letter, single dash option
parameter with equal sign looked funny, and more importantly
calling the flag to override encoding from utf-8 to something
else "-u" (obviously abbreviated from "utf-8") did not make any
sense.  So spell it out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 01:29:52 -08:00
Junio C Hamano
f1f909e318 mailinfo: Use i18n.commitencoding
This uses i18n.commitencoding configuration item to pick up the
default commit encoding for the repository when converting form
e-mail encoding to commit encoding (the default is utf8).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-27 16:29:38 -08:00
Junio C Hamano
650e4be59b mailinfo: allow -u to fall back on latin1 to utf8 conversion.
When the message body does not identify what encoding it is in,
-u assumes it is in latin-1 and converts it to utf8, which is
the recommended encoding for git commit log messages.

With -u=<encoding>, the conversion is made into the specified
one, instead of utf8, to allow project-local policies.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-27 16:26:50 -08:00
Junio C Hamano
4e72dcec89 Introduce i18n.commitencoding.
This is to hold what the project-local rule as to the
charset/encoding for the commit log message is.  Lack of it
defaults to utf-8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-27 16:09:40 -08:00