Bug #2006

Add shallow src/pkgsrc option to /usr/Makefile

Added by marino over 5 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:sjg% Done:


Target version:-


This "feature" tracks the need for a shallow checkout of src and pkgsrc git
repositories. A patch of the former follows. Originally posted on 29 Sep 2010
on @users:

With regards to the source code at /usr/src, there are some of us users that
don't need the entire history of the repository going back to version 2.0, but
rather are only looking for head revision.

Currently, typing "make src-create" will clone the entire repository, which is
currently at 306.8K objects and has a download of 229MB (and 226K deltas).

I created a patch that adds makefile option "make src-create-shallow" which will
set the fetch depth to 1. When I ran this today, the object count for the head
revision was 98.6K and took 186MB to download (58K deltas).

I know 43 MB doesn't seem like a whole lot, but some people don't fast internet
connections and don't have commit authority, so this shallow pull might be
desirable for them. As time passes, the difference between a full repository
and head pull will increase, so the benefit of such an option will increase as

My proposed patch follows.


--- Makefile.orig 2010-09-29 12:53:57 +0200
+++ Makefile 2010-09-29 13:41:02 +0200
@@ -29,6 +29,7 @@
@echo " make src-create - fetch initial src repo from the net"
+ @echo " make src-create-shallow - fetch initial history-free src repo"
@echo " make src-update - update your src repo from the net"
@echo ""
@@ -75,6 +76,18 @@
cd ${.CURDIR}/src && git checkout master
cd ${.CURDIR}/src && git pull

+ @echo "If problems occur you may have to rm -rf src and try again."
+ @echo ""
+ mkdir -p ${.CURDIR}/src
+ cd ${.CURDIR}/src && git init
+ cd ${.CURDIR}/src && \
+ git remote add origin git://git.dragonflybsd.org/dragonfly.git
+ cd ${.CURDIR}/src && git fetch --depth=1 origin
+ cd ${.CURDIR}/src && git branch master origin/master
+ cd ${.CURDIR}/src && git checkout master
+ cd ${.CURDIR}/src && git pull
cd ${.CURDIR}/src && git checkout master


#1 Updated by dillon over 5 years ago



#2 Updated by marino about 4 years ago

  • Status changed from New to Closed

long closed.

Also available in: Atom PDF