1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-31 22:37:54 +01:00
Commit graph

1088 commits

Author SHA1 Message Date
Linus Torvalds
f85639c303 Rename the RPM from "git" to "git-core"
That way we avoid any confusion with "GNU Interactive Tools", and it's
more descriptive anyway (the rpm documentation talks about how git is
split into a "core" part and an "SCM" part, this makes it clear that
this is the core one).
2005-07-12 10:07:18 -07:00
Linus Torvalds
37f1a519f2 Add "git branch" script
You can use it as

	git branch <branchname> [start-point]

and it creates a new branch of name <branchname>.  If a starting point
is specified, that will be where the branch is created, otherwise it
will be created at the current HEAD.

The sequence

	git branch xyz abc
	git checkout xyz

can also be written as

	git checkout -b xyz abc

as per the previous commit.
2005-07-11 21:30:23 -07:00
Linus Torvalds
91dcdfd3b5 Make "git checkout" create new branches on demand
In particular, if we check out something that isn't an old branch, it
now requires a new branch-name to check the thing out into.

So, for example:

	git checkout -b my-branch v2.6.12

will create the new branch "my-branch", and start it at v2.6.12, while

	git checkout master

will just switch back to the master branch.

Of course, if you want to create a new branch "my-branch" and _not_
check it out, you could have done so with just

	git-rev-parse v2.6.12^0 > .git/refs/heads/my-branch

which I think I will codify as "git branch".
2005-07-11 20:44:20 -07:00
Linus Torvalds
714fff2aa8 Make "git checkout" verify that the argument refers to a commit
We still need to create a new branch if it didn't refer to an existing
branch, otherwise our HEAD will continue to point to something totally
different than what we just checked out.

I'll need to think about it.  Maybe only do it with "-f" and force it to
the "master" branch?
2005-07-11 18:32:30 -07:00
Linus Torvalds
79162bb8ad git-rev-parse: Allow a "zeroth" parent of a commit - the commit itself.
This sounds nonsensical, but it's useful to make sure that the result is
a commit.

For example, "git-rev-parse v2.6.12" will return the _tag_ object for
v2.6.12, but "git-rev-parse v2.6.12^0" will return the _commit_ object
associated with that tag (and v2.6.12^1 will return the first parent).

Also, since the "parent" code will actually parse the commit, this,
together with the "--verify" flag, will verify not only that the result
is a single SHA1, but will also have verified that it's a proper commit
that we can see.
2005-07-11 18:27:25 -07:00
Linus Torvalds
e33b2ef8f5 git-send-pack: Fix duplicate refname match
Cut-and-paste dup noticed by Junio.  It's not even harmless, since a
match also causes that match to be invalidated, so this made it
impossible to update an existing branch by name.

I'd only tested the case of "ref doesn't exist at all on the other end",
which worked fine.
2005-07-11 18:03:34 -07:00
Chris Wright
b1de9de2b9 [PATCH] Bootstrap "make dist"
Use git-tar-tree directly from git source during make dist.  This
handles bootstrap issue with git not being installed.

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 14:20:10 -07:00
Junio C Hamano
ab6625e06a [PATCH] git-clone-script local optimization tweaks
- When local optimization is used, the variable repo has
   already been passed through get_repo_base so there is no need
   to check for .git subdirectory in there.

 - Use cpio -l instead of "cp -l".

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 14:06:57 -07:00
Sven Verdoolaege
c1c774e796 [PATCH] git-cvsimport-script: add "import only" option
git-cvsimport-script: add "import only" option which tells the script
not to perform a checkout after importing.

This ensures that the working directory and cache remain untouched and
will not create them if they do not exist.

Acked-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 10:26:07 -07:00
Bryan Larsen
9c1fa70aaa [PATCH] add --missing-ok option to write-tree
This option allows a write-tree even if the referenced objects are not
in the database.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 10:20:53 -07:00
Junio C Hamano
ab90ea5d6e [PATCH] Check packs and then files.
This reverses the order of object lookup, to check pack index first and
then go to the filesystem to find .git/objects/??/ hierarchy.

When most of the objects are packed, this saves quite many stat() calls
and negative dcache entries; while the price this approach has to pay is
negligible, even when most of the objects are outside pack, because
checking pack index file is quite cheap.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 10:13:09 -07:00
Junio C Hamano
013aab8265 [PATCH] Dereference tag repeatedly until we get a non-tag.
When we allow a tag object in place of a commit object, we only
dereferenced the given tag once, which causes a tag that points at a tag
that points at a commit to be rejected.  Instead, dereference tag
repeatedly until we get a non-tag.

This patch makes change to two functions:

 - commit.c::lookup_commit_reference() is used by merge-base,
   rev-tree and rev-parse to convert user supplied SHA1 to that of
   a commit.
 - rev-list uses its own get_commit_reference() to do the same.

Dereferencing tags this way helps both of these uses.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-11 10:13:09 -07:00
Junio C Hamano
a3eb250f99 [PATCH] alternate object store and fsck
The location alt_odb[j].name[0..] is filled with ??/?{38} to form a sha1
filename to try, but I was too lazy to allocate a copy, so while
fsck_object_dir() is running for the directory, the filenames ??/?{38}
are filled after NUL (usually and always the location should have '/'),
making them "not found".

This should fix it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-10 16:16:34 -07:00
Linus Torvalds
cf219196a8 Fix up progress report for off-by-one error
We used to print the index of the object we unpacked, not how many we
had unpacked.  Which caused slightly confusing progress reports like

	100% (2/3) done

rather than the more obvious "3/3" for 100% ;)
2005-07-10 16:14:22 -07:00
Linus Torvalds
4bc5fbf82e Make "git log" exit properly if not in a git archive
Instead of getting an incomprehensible error message from git-rev-list.
2005-07-10 16:10:21 -07:00
Linus Torvalds
0ee19dce2c Avoid signedness warnings in sha1_file.c
Very irritating.  But "snprintf()" wants "char *", and zlib wants
"unsigned char *".
2005-07-10 15:43:54 -07:00
Daniel Barkalow
d5f1befca8 [PATCH] Remove map_sha1_file
Remove map_sha1_file(), now unused.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-10 15:39:08 -07:00
Daniel Barkalow
a5eda52bfe [PATCH] write_sha1_to_fd()
Add write_sha1_to_fd(), which writes an object to a file descriptor. This
includes support for unpacking it and recompressing it.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-10 15:39:08 -07:00
Linus Torvalds
454fbbcde3 git-rev-list: allow missing objects when the parent is marked UNINTERESTING
We still want the "top-most" uninteresting object to exist, so that we
know that we have reached it.
2005-07-10 15:09:46 -07:00
Linus Torvalds
167a4a3308 Add "-q" flag to "git commit"
Maybe you don't want the progress report.
2005-07-09 10:52:35 -07:00
Linus Torvalds
d36f7b805e git-unpack-objects: show progress report by default
This ends up being very calming for big "git clone"s, since otherwise
you just get very frustrated with a long silence, wondering whether it's
working at all.

Use "-q" to quiet it down.

Now if we could just do the same for the initial "figure out what to
pack" phase, which can also be quite slow if the other end is busy (or
not packed and not in cache)...
2005-07-09 10:43:02 -07:00
Junio C Hamano
1855c04462 [PATCH] format-patch: fix skipping of blank-lines
If it is fed a commit with more than one leading blank lines,
the sed scripts git-format-patch-script used looped forever.
Using git-stripspace upfront makes the sed script somewhat
simpler to work around this problem.

Also use git-rev-parse so that we can say

    $ git-format-patch-script HEAD^^^^

to prepare the latest four patches for e-mail submission.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 19:48:44 -07:00
Linus Torvalds
ed616049d7 Update the tutorial a bit
Add notes on branches, merging, tagging, and update some of the usage to
the friendlier "git cmd" syntax.

It's still ridiculously lacking, but perhaps it's a _bit_ more useful.
2005-07-08 18:26:19 -07:00
Linus Torvalds
918c05f1b6 Make "git tag" more user-friendly
Instead of having to cut-and-paste the result, write it to the tag
directory directly.  Also, start an editor for the tag message, rather
than just reading it from stdin.
2005-07-08 18:23:06 -07:00
Linus Torvalds
3ba513c32e Make "git resolve" take the merge message in $3
It used to do "Merge $3" as the message, but that ends up being
inconvenient, and much more easily done inside git-pull-script instead.

This makes the third argument to "git resolve" much easier to explain.
2005-07-08 17:38:44 -07:00
Bryan Larsen
69a97f1d9b [PATCH] Use SHA1 for git-update-cache --refresh
Change git-update-cache --refresh behaviour to use sha1's rather than
comparing byte by byte.

[JC demangled whitespace from the posted patch himself because he
 liked it so much.  Also adjusted to the index_fd() interface
 slightly done differently from the original one.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 17:07:37 -07:00
Bryan Larsen
df6e151636 [PATCH] Add --info-only option to git-update-cache.
Add --info-only option to git-update-cache.

[JC demangled whitespace from the posted patch himself because he
 liked it so much.  Also adjusted to the index_fd() interface
 slightly done differently from the original one.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 17:07:37 -07:00
Bryan Larsen
7672db20c2 [PATCH] Expose object ID computation functions.
This patch makes the first half of write_sha1_file() and
index_fd() externally visible, to allow callers to compute the
object ID without actually storing it in the object database.

[JC demangled the whitespaces himself because he liked the patch
 so much, and reworked the interface to index_fd() slightly,
 taking suggestion from Linus and of his own.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 17:07:37 -07:00
Linus Torvalds
7558ef89ed Teach "git clone" about rsync sources
That will be the normal way of cloning anonymously for a while, so let's
make sure it's easy to use.
2005-07-08 17:07:12 -07:00
Linus Torvalds
113b94751d Make "upload-pack" match git-fetch-pack usage
Do the default "try xyz.git xyz fails" thing for the directory we get
passed in.
2005-07-08 16:22:22 -07:00
Linus Torvalds
26c8a533af Add "mkpath()" helper function
I'm bored with doing it by hand all the time.
2005-07-08 16:20:59 -07:00
Linus Torvalds
5c5dc2fb51 Mark git-relink-script and git-repack-script executable
Sure, "install" will default to installing it executable anyway, but
this is the right thing to do.
2005-07-08 15:59:29 -07:00
Linus Torvalds
ba375acff7 Make "git clone" a lot more user-friendly
This silently adds the ".git" directory component if needed, so you
don't need to state it explicitly for the source.  Also, it turns the
source into an absolute pathname when local, so that you can use
relative pathnames without losing sight of the source when we cd into
the destination.
2005-07-08 15:46:33 -07:00
Linus Torvalds
51cb06c36d Add "git-push-script" to make a more regular interface
It only does local and ssh pushes, because it's really just a wrapper
for git-send-pack.  We might make it do an rsync mirror or something, of
course.
2005-07-08 14:24:25 -07:00
Linus Torvalds
584c6cc91a Teach 'git-send-pack' to send new branches and tags.
The protocol always supported it, but send-pack didn't actually know how
to tell the other side about a new branch/tag.

NOTE! You'll have to name it explicitly on the command line: if you
don't name any branches, git-send-pack will default to the branches that
already exist.
2005-07-08 13:58:40 -07:00
Linus Torvalds
99a0a6e09f Make "for_each_ref()" always use the "canonical" refname.
It always uses a git-relative pathname, ie "refs/heads/master" instead of
".git/refs/heads/master" or whatever your GIT_DIR might be.

This way when we send refs back-and-forth between repositories, there's
never any question about GIT_DIR on either side.
2005-07-08 13:56:05 -07:00
Junio C Hamano
b10d0ec732 [PATCH] Use sq_quote() to properly quote the parameter to call shell.
This tries to be more lenient to the users and stricter to the
attackers by quoting the input properly for shell safety,
instead of forbidding certain characters from the input.

Things to note:

 - We do not quote "prog" parameter (which comes from --exec).
   The user should know what he is doing.  --exec='echo foo'
   will supply the first two parameters to the resulting
   command, while --exec="'echo foo'" will give the first
   parameter, a single string with a space inside.

 - We do not care too much about leaking the sq_quote() output
   just before running exec().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 11:01:10 -07:00
Junio C Hamano
6fb737be5e [PATCH] Make sq_expand() available as sq_quote().
A useful shell safety helper sq_expand() was hidden as a static
function in diff.c.  Extract it out and make it available as
sq_quote().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-08 11:01:10 -07:00
Linus Torvalds
b33e966608 Add "git-sh-setup-script" for common git shell script setup
It sets up the normal git environment variables and a few helper
functions (currently just "die()"), and returns ok if it all looks like
a git archive.  So use it something like

	. git-sh-setup-script || die "Not a git archive"

to make the rest of the git scripts more careful and readable.
2005-07-08 10:57:21 -07:00
Linus Torvalds
acb46f8769 git-diff-*: support "-u" as a synonym for "-p"
I'm probably not the only one whose fingers have gotten hard-wired to
use "-u" for "unified diff".
2005-07-08 10:45:07 -07:00
Junio C Hamano
0acfc97252 [PATCH] git-format-patch: Prepare patches for e-mail submission.
This is the script I use to prepare patches for e-mail submission.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07 18:07:12 -07:00
Linus Torvalds
924e121954 Mark more characters shell-safe.
I still worry about just quoting things when passing it off to "ssh" or
"sh -c", so I'm being anal.  But _, ^ and , are certainly ok and while
both ~ and @ can have speacial meaning to shell/ssh they are benign.
2005-07-07 17:59:23 -07:00
Linus Torvalds
659cacf5a9 git-fsck-cache: don't complain about lacking references when they are all in packs.
We used to not count them at all, which then made us complain that there
were no refs.
2005-07-07 17:05:41 -07:00
Linus Torvalds
e27a56a676 Merge master.kernel.org:/pub/scm/linux/kernel/git/chrisw/git 2005-07-07 15:56:49 -07:00
Junio C Hamano
1038f0c0a1 [PATCH] Typofix an error message in pack-check.c
The current error message does not make any sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07 15:54:57 -07:00
Junio C Hamano
776566000f [PATCH] Prevent t6000 series from dropping useless sed.script in t/
The Makefile in the test suite directory considers any file
matching t[0-9][0-9][0-9][0-9]-*.sh as the top-level test script
to be executed.  Unfortunately this was not documented, and the
common test library, t6000-lib.sh was named to match that
pattern.  This caused t6000-lib.sh to be called from Makefile as
the top-level program, causing it to leave t/sed.script file
behind.  Rename it to t6000lib.sh to prevent this, and document
the naming convention a bit more clearly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07 15:53:35 -07:00
Junio C Hamano
e95ab1edf3 [PATCH] Short-circuit git-clone-pack while cloning locally (take 2).
When we are cloning a repository on a local filesystem, it is
faster to just create a hard linkfarm of .git/object hierarchy
and copy the .git/refs files.  By default, the script uses the
clone-pack method, but it can be told with the -l flag to do the
hard linkfarm (falling back on recursive file copy) to replicate
the .git/object hierarchy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-07 15:53:35 -07:00
Chris Wright
a9db297485 Infrastructure for git rpm builds. Adds GIT_VERSION to Makefile and new make
targets: git.spec, dist, and rpm.  A simple 'make rpm' will build the rpm.
Also adds git.spec.in which is used to generate git.spec.

Signed-off-by: Chris Wright <chrisw@osdl.org>
2005-07-07 13:09:50 -07:00
Linus Torvalds
dd7ba8b494 git-clone-pack: fix sparse warning
Local function that wasn't marked static
2005-07-06 18:51:56 -07:00
Jon Seymour
84b18a8e63 [PATCH] Tidy up - remove use of (*f)() idiom from epoch.c
Replace (*f)() with f() where the former idiom was used in epoch.c

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06 18:47:38 -07:00