1
0
mirror of https://github.com/git/git.git synced 2025-04-12 02:45:22 +00:00
Andy Parkins 8d2244ba74 Make git-prune submodule aware (and fix a SEGFAULT in the process)
I ran git-prune on a repository and got this:

 $ git-prune
 error: Object 228f8065b930120e35fc0c154c237487ab02d64a is a blob, not a commit
 Segmentation fault (core dumped)

This repository was a strange one in that it was being used to provide
its own submodule.  That is, the repository was cloned into a
subdirectory, an independent branch checked out in that subdirectory,
and then it was marked as a submodule.  git-prune then failed in the
above manner.

The problem was that git-prune was not submodule aware in two areas.

Linus said:

 > So what happens is that something traverses a tree object, looks at each
 > entry, sees that it's not a tree, and tries to look it up as a blob. But
 > subprojects are commits, not blobs, and then when you look at the object
 > more closely, you get the above kind of object type confusion.

and included a patch to add an S_ISGITLINK() test to reachable.c's
process_tree() function.  That fixed the first git-prune error, and
stopped it from trying to process the gitlink entries in trees as if
they were pointers to other trees (and of course failing, because
gitlinks _aren't_ trees).  That part of this patch is his.

The second area is add_cache_refs().  This is called before starting the
reachability analysis, and was calling lookup_blob() on every object
hash found in the index.  However, it is no longer true that every hash
in the index is a pointer to a blob, some of them are gitlinks, and are
not backed by any object at all, they are commits in another repository.
Normally this bug was not causing any problems, but in the case of the
self-referencing repository described above, it meant that the gitlink
hash was being marked as being of type OBJ_BLOB by add_cache_refs() call
to lookup_blob().  Then later, because that hash was also pointed to by
a ref, add_one_ref() would treat it as a commit; lookup_commit() would
return a NULL because that object was already noted as being an
OBJ_BLOB, not an OBJ_COMMIT; and parse_commit_buffer() would SEGFAULT on
that NULL pointer.

The fix made by this patch is to not blindly call lookup_blob() in
reachable.c's add_cache_refs(), and instead skip any index entries that
are S_ISGITLINK().

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 16:41:18 -07:00
2007-07-02 00:35:58 -07:00
2007-02-03 21:49:54 -08:00
2007-05-10 13:26:26 -07:00
2007-04-22 10:44:56 -07:00
2007-05-30 15:03:50 -07:00
2007-05-06 00:21:03 -07:00
2007-02-27 22:15:42 -08:00
2007-04-29 01:52:43 -07:00
2007-03-17 00:34:19 -07:00
2007-05-14 18:50:01 -07:00
2007-04-07 02:26:24 -07:00
2007-03-20 22:17:47 -07:00
2007-02-24 01:42:06 -08:00
2007-04-25 23:31:45 -07:00
2007-05-31 00:09:26 -07:00
2007-06-02 12:00:26 -07:00
2007-04-25 21:39:43 -07:00
2007-03-27 13:00:13 -07:00
2007-04-21 17:21:10 -07:00
2007-04-22 22:16:14 -07:00
2007-05-26 00:33:03 -07:00
2007-02-03 21:49:54 -08:00
2007-04-23 21:39:28 -07:00
2007-05-26 00:33:03 -07:00
2007-07-02 00:35:58 -07:00
2007-05-20 19:57:00 -07:00
2007-05-13 13:34:40 -07:00
2007-03-27 16:57:57 -07:00
2007-03-07 10:47:10 -08:00
2007-03-07 10:47:10 -08:00
2007-05-06 00:21:03 -07:00
2007-04-07 02:29:40 -07:00
2007-03-19 02:48:37 -07:00
2007-04-24 00:08:49 -07:00
2007-04-10 12:48:14 -07:00
2007-03-07 10:47:10 -08:00
2007-02-08 17:48:22 -08:00
2007-04-21 17:21:10 -07:00
2007-07-02 00:35:58 -07:00
2007-06-15 23:48:35 -07:00
2007-03-12 23:40:18 -07:00
2007-03-10 22:07:26 -08:00
2007-06-26 18:02:15 -07:00
2007-04-24 00:08:49 -07:00
2007-05-28 23:54:26 -07:00
2007-05-01 02:59:08 -07:00
2007-05-07 22:02:40 -07:00

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.
Description
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Readme 829 MiB
Languages
C 50.1%
Shell 38.4%
Perl 5.1%
Tcl 3.2%
Python 0.8%
Other 2.1%