[DragonFlyBSD - Bug #2006] (Closed) Add shallow src/pkgsrc option to /usr/Makefile

John Marino via Redmine bugtracker-admin at leaf.dragonflybsd.org
Sat Sep 1 06:15:55 PDT 2012


Issue #2006 has been updated by John Marino.

Status changed from New to Closed

long closed.
----------------------------------------
Bug #2006: Add shallow src/pkgsrc option to /usr/Makefile
http://bugs.dragonflybsd.org/issues/2006

Author: John Marino
Status: Closed
Priority: Low
Assignee: Samuel J. Greear
Category: 
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 
well.

My proposed patch follows.

Regards,
John



--- Makefile.orig    2010-09-29 12:53:57 +0200
+++ Makefile    2010-09-29 13:41:02 +0200
@@ -29,6 +29,7 @@
 .endif
 .else
     @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"
 .endif
     @echo ""
@@ -75,6 +76,18 @@
     cd ${.CURDIR}/src && git checkout master
     cd ${.CURDIR}/src && git pull

+src-create-shallow:
+    @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
+
 src-checkout:
     cd ${.CURDIR}/src && git checkout master


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account





More information about the Bugs mailing list