1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 08:47:56 +01:00
Commit graph

2151 commits

Author SHA1 Message Date
Junio C Hamano
71ac8356d8 Update git-status to new git-diff-* and git-ls-files output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:56 -07:00
Junio C Hamano
cf9dfc669e Update git-diff-* to use C-style quoting for funny pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:56 -07:00
Junio C Hamano
caf4f582b2 Improve "git add" again.
This makes it possible to add paths that have funny characters (TAB
and LF) in them, and makes adding many paths more efficient in
general.

New flag "--stdin" to update-index was initially added for different
purpose, but it turns out to be a perfect match for feeding "ls-files
--others -z" output to improve "git add".

It also adds "--verbose" flag to update-index for use with "git add"
command.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:55 -07:00
Junio C Hamano
22ddf71979 Update ls-files and ls-tree to use C-style quoting for funny pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:55 -07:00
Junio C Hamano
22943f1a52 Update git-apply to use C-style quoting for funny pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:54 -07:00
Junio C Hamano
4f6fbcdcf9 Functions to quote and unquote pathnames in C-style.
Following the list discussion, define two functions, quote_c_style and
unquote_c_style, to help adopting the proposed way for quoting funny
pathname letters for GNU patch.  The rule is described in:

    http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2

Currently we do not support the leading '!', but we probably should
barf upon seeing it.  Rule B4. is interpreted to require always 3
octal digits in \XYZ notation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:41:54 -07:00
Junio C Hamano
2b2dabc29f Merge branch 'fixes' 2005-10-17 17:41:37 -07:00
Junio C Hamano
fd25c82a80 git-checkout-index: documentation updates.
Now the behaviour of '-a' has been straightened out, document it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:38:09 -07:00
Linus Torvalds
a65a686f49 make checkout-index '-a' flag saner.
The original semantics of pretending as if all files were
specified where '-a' appeared and using only the flags given so
far was too confusing.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 17:32:12 -07:00
Junio C Hamano
622ef9df19 ref-format documentation.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 22:41:59 -07:00
Junio C Hamano
b8041fe4d8 Sparse-directory safety fix.
This will be removed when merging the second phase of Linus' "Create
object subdirectories on demand" change anyway, but the code to
recreate the empty .git/objects/??/ directory was confused.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 14:09:50 -07:00
Junio C Hamano
f865a2ad98 Merge branch 'fixes' 2005-10-16 12:23:59 -07:00
Junio C Hamano
a34484e1c9 We do not depend on patch.
Deb packaging claim we depend on patch, but I think we use git-apply
where it matters.  When a patch does not apply with git-apply, using
GNU patch still is helpful sometimes.  So demote it from "Depends" to
"Suggests".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 12:01:28 -07:00
Junio C Hamano
29504118f8 Merge branch 'svn' of http://netz.smurf.noris.de/git/git
[jc: I have my pre-commit hook enabled to catch trailing whitespaces,
 and fixed them up while merging.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 11:55:35 -07:00
Matthias Urlichs
40dad96e41 svn commit: re-word the exit-due-to-memory-leak message
Reworded the exit message, as per Kalle Valo's suggestion (but shorter).

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
2005-10-16 19:57:38 +02:00
Kalle Valo
f005dba7c1 Makefile entry for git-svnimport contained a small typo.
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
2005-10-16 19:37:25 +02:00
Junio C Hamano
6abf5c0c6f Squelch compiler warnings from connect.c
Forgot to include necessary header file to get the function declaration.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 00:25:26 -07:00
Junio C Hamano
c09a69a83e Disable hooks during tests.
Individual tests for hooks would want to have their own tests when
written.  Also we should not pick up from random templates the user
happens to have.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 00:24:34 -07:00
Peter Hagervall
f5dce80611 Sparse fixes for http-fetch
This patch cleans out all sparse warnings from http-fetch.c

I'm a bit uncomfortable with adding extra #ifdefs to avoid either
'mixing declaration with code' or 'unused variable' warnings, but I
figured that since those functions are already littered with #ifdefs I
might just get away with it. Comments?

[jc: I adjusted Peter's patch to address uncomfortableness issues.]

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16 00:01:08 -07:00
Junio C Hamano
15fad5f4d7 whatchanged: document -m option from git-diff-tree.
The documentation for git-whatchanged is meant to describe only
the most frequently used options from git-diff-tree.  Because "why
doesn't it show merges" was asked more than once, we'd better
describe '-m' option there.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 23:49:27 -07:00
Junio C Hamano
f6b42a81fd Show peeled onion from upload-pack and server-info.
This updates git-ls-remote to show SHA1 names of objects that are
referred by tags, in the "ref^{}" notation.

This would make git-findtags (without -t flag) almost trivial.

    git-peek-remote . |
    sed -ne "s:^$target	"'refs/tags/\(.*\)^{}$:\1:p'

Also Pasky could do:

    git-ls-remote --tags $remote |
    sed -ne 's:\(	refs/tags/.*\)^{}$:\1:p'

to find out what object each of the remote tags refers to, and
if he has one locally, run "git-fetch $remote tag $tagname" to
automatically catch up with the upstream tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:41 -07:00
Junio C Hamano
5385f52da8 Introduce notation "ref^{type}".
Existing "tagname^0" notation means "dereference tag zero or more
times until you cannot dereference it anymore, and make sure it is a
commit -- otherwise barf".  But tags do not necessarily reference
commit objects.

This commit introduces a bit more generalized notation, "ref^{type}".
Existing "ref^0" is a shorthand for "ref^{commit}".  If the type
is empty, it just dereferences tags until it hits a non-tag object.

With this, "git-rev-parse --verify 'junio-gpg-pub^{}'" shows the blob
object name -- there is no need to manually read the tag object and
find out the object name anymore.

"git-rev-parse --verify 'HEAD^{tree}'" can be used to find out the
tree object name of the HEAD commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:40 -07:00
Junio C Hamano
1a7141ff28 Ignore funny refname sent from remote
This allows the remote side (most notably, upload-pack) to show
additional information without affecting the downloader.  Peek-remote
does not ignore them -- this is to make it useful for Pasky's
automatic tag following.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:40 -07:00
Junio C Hamano
d8a1deecc6 Refuse to create funny refs in clone-pack, git-fetch and receive-pack.
Using git-check-ref-format, make sure we do not create refs with
funny names when cloning from elsewhere (clone-pack), fast forwarding
local heads (git-fetch), or somebody pushes into us (receive-pack).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:39 -07:00
Junio C Hamano
03feddd6e8 git-check-ref-format: reject funny ref names.
Update check_ref_format() function to reject ref names that:

 * has a path component that begins with a ".", or
 * has a double dots "..", or
 * has ASCII control character, "~", "^", ":" or SP, anywhere, or
 * ends with a "/".

Use it in 'git-checkout -b', 'git-branch', and 'git-tag' to make sure
that newly created refs are well-formed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:39 -07:00
Junio C Hamano
f51248eb48 Merge branch 'fixes' 2005-10-15 11:19:09 -07:00
Junio C Hamano
f80376c597 Show curl error a bit better.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:13:55 -07:00
Johannes Schindelin
7baa3e8694 Some curl versions lack curl_easy_duphandle()
Hi,

On Fri, 14 Oct 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > This patch looks bigger than it really is: The code to get the
> > default handle was refactored into a function, and is called
> > instead of curl_easy_duphandle() if that does not exist.
>
> I'd like to take Nick's config file patch first, which
> unfortunately interferes with your patch.  I'd hate to ask you
> this, but could you rebase it on top of Nick's patch, [...]

No need to hate it. Here comes the rebased patch, and this time, I
actually tested it a bit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:10:46 -07:00
Linus Torvalds
4546738b58 Unlocalized isspace and friends
Do our own ctype.h, just to get the sane semantics: we want
locale-independence, _and_ we want the right signed behaviour. Plus we
only use a very small subset of ctype.h anyway (isspace, isalpha,
isdigit and isalnum).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:17:27 -07:00
Nick Hengeveld
d402d5566f Use config file settings for http
Use "http." config file settings if they exist.  Environment variables
still work, and they will override config file settings.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:16:01 -07:00
Sergey Vlasov
bc8f265270 git-http-fetch: Remove size limit for objects/info/{packs,alternates}
git-http-fetch received objects/info/packs into a fixed-size buffer
and started to fail when this file became larger than the buffer.
Change it to grow the buffer dynamically, and do the same thing for
objects/info/alternates.  Also add missing free() calls for these
buffers.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:15:46 -07:00
Aneesh Kumar
e70ec8632c debian packaging
Make it build with stable testing and unstable.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:15:11 -07:00
Linus Torvalds
c05186cc38 Support git+ssh:// and ssh+git:// URL
It seemed to be such a stupid syntax. It's both what "ssh://" means,
and it's what not specifying a protocol at _all_ means.

But hey, since we already have two ways of saying "use ssh with
pack-files", here's two more.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:14:56 -07:00
Tom Prince
01eea6f355 Add new programs and stamp file to .gitignore.
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:13:49 -07:00
Junio C Hamano
603d874587 format-patch: take sequence of ranges.
This enhances set of revs you can give format-patch.

Originally, format-patch took either one rev, or two revs:

    format-patch rev1
    format-patch rev1 rev2

The first format was a short-hand for "format-patch rev1 HEAD"
(i.e. rev2==HEAD).  What this meant was to find commits that are
in branch rev2 that has not been merged to branch rev1.

The above notation is still supported, but now it takes sequence
of "from1..to1 from2..to2 ...".  In short, the second format has
become a short-hand for "format-patch rev1..rev2".  Commits in
to1 but not in from1, to2 but not in from2, ... are formatted as
emailable patches.

With this, cherry-picking from other branch can be written as:

    git-format-patch -k --stdout master..branch1 master..branch2 |
    git-am -k -3

which is generally faster than traditional cherry-pick (which
always did 3-way merge) if patches apply cleanly, and still
falls back on 3-way merge if some of them do not.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 23:18:46 -07:00
Linus Torvalds
f7aac2eac9 Add "-l" flag for repacking only local packs
This uses the new "--local" flag to git-pack-objects.  It currently only
makes a difference together with "-a", since a normal incremental repack
won't pack any packed objects at all (whether local or remote).

Eventually, it might end up skipping any objects that aren't local to
the current object directory, but for now it only knows to skip packed
objects.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 15:38:29 -07:00
Linus Torvalds
64560374cc Add support for "local" packing
This adds the "--local" flag to git-pack-objects, which acts like
"--incremental", except that instead of ignoring all packed objects, it
only ignores objects that are packed and in an alternate object tree.

As a result, it effectively only does a local re-pack: any remote-packed
objects will stay in the alternate object directories.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 15:38:28 -07:00
Linus Torvalds
9d835df246 Keep track of whether a pack is local or not
If we want to re-pack just local packfiles, we need to know whether a
particular object is local or not.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 15:38:28 -07:00
Junio C Hamano
5990efb0c4 tutorial: update the initial commit example.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 11:57:05 -07:00
Junio C Hamano
73319032c8 git-am: do not fail if 3-way fallback succeeds.
The current one incorrectly stops there without committing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 11:46:43 -07:00
Johannes Schindelin
2ae6c70674 Adapt tutorial to cygwin and add test case
Lacking reliable symlinks, the instructions in the tutorial did not work
in a cygwin setup. Also, a few outputs were not correct.

This patch fixes these, and adds a test case which follows the
instructions of the tutorial (except git-clone, -fetch and -push, which I
have not done yet).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 11:36:37 -07:00
Martin Langhoff
8af12741ee Add findtags - reworked
A short perl script that will walk the tag refs, tag objects, and even commit
objects in its quest to figure out whether the given SHA1 (for a commit or
tree) was ever tagged.

This version is reworked incorporating sanity, feature and style fixes from
Junio.

Usage: git-findtags.perl [ -t ] <commit-or-tree-sha1>

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 10:47:42 -07:00
Sergey Vlasov
35613ba4ba Revert "Also use 'track_object_refs = 0' in update-server-info."
This reverts d119e3de13 commit.

Object references are used in server-info.c:find_pack_info_one() to
find out which objects in the pack are heads, therefore tracking of
references cannot be disabled.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 10:01:57 -07:00
Ralf Baechle
257380896f rsh.c: typo fix
Example in a comment used a wrong environment variable.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-13 10:01:38 -07:00
Junio C Hamano
64c381bf74 clone-pack: new option --keep tells it not to explode the pack.
With new option --keep, or a configuration item clone.keeppack (we
need a better name, or start allowing dash,"clone.keep-pack"), the packed
data downloaded while cloning is saved as a pack in .git/objects/pack/
locally, with index generated for it with git-index-pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:32:03 -07:00
Junio C Hamano
11dcec07a4 clone-pack: new option --keep tells it not to explode the pack.
With new option --keep, or a configuration item clone.keeppack (we
need a better name, or start allowing dash,"clone.keep-pack"), the packed
data downloaded while cloning is saved as a pack in .git/objects/pack/
locally, with index generated for it with git-index-pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:32:03 -07:00
Junio C Hamano
84c8d8aec5 Fix packname hash generation.
This changes the generation of hash packfiles have in their names, from
"hash of object names as fed to us" to "hash of object names in the
resulting pack, in the order they appear in the index file".  The new
"git-index-pack" command is taught to output the computed hash value
to its standard output.

With this, we can store downloaded pack in a temporary file without
knowing its final name, run git-index-pack to generate idx for it
while finding out its final name, and then rename the pack and idx to
their final names.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:32:02 -07:00
Sergey Vlasov
9cf6d3357a Add git-index-pack utility
git-index-pack builds a pack index file for an existing packed
archive.  With this utility a packed archive which was transferred
without the corresponding pack index can be added to objects/pack/
without repacking.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:32:02 -07:00
Junio C Hamano
a1451104ac git-am: interactive should fail gracefully.
When feeding patches from standard input, and --interactive is specified,
quit, so that the user can re-run the command, instead of infinitely
looping.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-12 18:31:41 -07:00
Junio C Hamano
221e743c03 git-fetch --tags: deal with tags with spaces in them.
"git-fetch --tags" can get confused with tags with spaces in their names,
it used to use shell IFS to split the list of tags and also used curl
which insists the URL to be escaped.  Fix it so it can work with Martin's
moodle repository http://locke.catalyst.net.nz/git/moodle.git/.

We still reserve characters like leading plus-sign '+' and colon
':' anywhere to represent refspec src-dst pair, and obviously we
cannot use LF (that terminates Pull: line in .git/remotes
files), but now you can have spaces with this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-11 22:05:09 -07:00