Re: [RFH] GSoC 2015 application

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFH] GSoC 2015 application

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:59

Stefan Beller [off-list ref] writes:
I cannot remember the usual option off hand to describe the revision
instead of a date.
Because "log --since=<date of v1.0> master" and "log v1.0..master"
mean two completely different things, we need some way to specify
which one of these two the user wants to "git clone" so that the
user can say at what point the user wants the shallow history to
begin.

I think it is a good idea to use --since for date-based cut-off, in
addition to the existing --depth that is depth-based cut-off, and we
probably would want another one that gives the topology-based
cut-off, so that we can express the range in a similar way to "log
v1.0..master".

But when we talk about the topology-based cut-off locally, we always
use the set syntax A..B, ^A B, etc. and never a command line option
with an argument to specify "the bottom of the history".  It is not
surprising that you don't remember any usual option for that,
because there isn't one.

The closest thing I can think of that looks somewhat like a command
line option is "--not", as in

    git log A B --not C D E

that is equivalent to "A B ^C ^D ^E", but that is not an option that
takes an argument.  I do not know if it is particularly a good idea
to say:

    git clone --not v2.0 $URL

to specify topology-based cut-off.

But we would need some way to say a set-based cut-off; I do not
think using --since for that purpose is a good idea, though, because
that is already taken for date-based cut-off, and mixing them
together will introduce confusion.

Re: [RFH] GSoC 2015 application

From: Duy Nguyen <hidden>
Date: 2016-06-15 23:04:00

On Wed, Mar 04, 2015 at 10:19:16PM -0800, Junio C Hamano wrote:
But we would need some way to say a set-based cut-off; I do not
think using --since for that purpose is a good idea, though, because
that is already taken for date-based cut-off, and mixing them
together will introduce confusion.
I agree. Although I look at this from the implementation perspective:
mixing the two would make it really hard to detect which is which.
Speaking of implementation..

On Thu, Mar 5, 2015 at 5:28 PM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
I do have plenty of topics to finish up. But I wanted to see how this
feature would look like. I needed to write some code for that and for
straightening my thoughts. Totally untested, but I think it looks cool :)

I think this feature is feasible. The protocol and UI are still up in
the air. Plenty of work for any student who wants to pick this up.
I think students are losing the chance to have this fun now. A rough
implementation is available at

    https://github.com/pclouds/git/tree/shallow-since

if anybody wants to try out. I don't post it here yet because while it
seems to be working in my limited tests, there could be some corner
cases to sort out, bugs and style violations. Also tests to be added.

Documentation changes below. --not and --since can be mixed. Neither
of them can be used with --depth though, but I'd consider it a
temporary limitation.
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index b09a783..ec68374 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -13,6 +13,15 @@
 	to the specified number of commits from the tip of each remote
 	branch history. Tags for the deepened commits are not fetched.
 
+--since=<date>::
+	Deepen or shorten the history of a 'shallow' repository to
+	include all reachable commits that are after <date>.
+
+--not=<revision>::
+	Deepen or shorten the history of a 'shallow' repository to
+	exclude commits reachable from a specified remote branch or tag.
+	This option can be specified multiple times.
+
 --unshallow::
 	If the source repository is complete, convert a shallow
 	repository to a complete one, removing all the limitations
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index f1f2a3f..fc094c6 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -187,6 +187,14 @@ objects from the source repository into a pack in the cloned repository.
 	Create a 'shallow' clone with a history truncated to the
 	specified number of revisions.
 
+--since=<date>::
+	Create a 'shallow' clone with a history after the specified time.
+
+--not=<revision>::
+	Create a 'shallow' clone with a history, excluding commits
+	reachable from a specified remote branch or tag.  This option
+	can be specified multiple times.
+
 --[no-]single-branch::
 	Clone only the history leading to the tip of a single branch,
 	either specified by the `--branch` option or the primary
diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt
index 4f8a7bf..3649301 100644
--- a/Documentation/technical/protocol-capabilities.txt
+++ b/Documentation/technical/protocol-capabilities.txt
@@ -179,6 +179,24 @@ This capability adds "deepen", "shallow" and "unshallow" commands to
 the  fetch-pack/upload-pack protocol so clients can request shallow
 clones.
 
+deepen-since
+------------
+
+This capability adds "deepen-since" command to fetch-pack/upload-pack
+protocol so the client can request shallow clones that are cut at a
+specific time, instead of depth. Internally it's equivalent of doing
+"rev-list --since=<time>" on the server side. "deepen-since" cannot be
+used with "deepen".
+
+deepen-not
+----------
+
+This capability adds "deepen-not" command to fetch-pack/upload-pack
+protocol so the client can request shallow clones that are cut at a
+specific revision, instead of depth. Internally it's equivalent of
+doing "rev-list --not <rev>" on the server side. "deepen-not"
+cannot be used with "deepen", but can be used with "deepen-since".
+
 no-progress
 -----------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help