nd/shallow-deepen updates
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest27 patches 0 repliesNew
- v127 patches 8 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/27 | remote-curl.c: convert fetch_git() to use argv_arrayremote-curl.c | +18 | 0 replies | |
| 2/27 | transport-helper.c: refactor set_helper_option()transport-helper.c | +23 | 0 replies | |
| 3/27 | upload-pack: move shallow deepen code out of receive_needs()upload-pack.c | +52 | 0 replies | |
| 4/27 | upload-pack: move "shallow" sending code out of deepen()upload-pack.c | +15 | 0 replies | |
| 5/27 | upload-pack: remove unused variable "backup"upload-pack.c | +4 | 0 replies | |
| 6/27 | upload-pack: move "unshallow" sending code out of deepen()upload-pack.c | +30 | 0 replies | |
| 7/27 | upload-pack: use skip_prefix() instead of starts_with()upload-pack.c | +18 | 0 replies | |
| 8/27 | upload-pack: tighten number parsing at "deepen" linesupload-pack.c | +2 | 0 replies | |
| 9/27 | upload-pack: make check_non_tip() clean things up on errorupload-pack.c | +16 | 0 replies | |
| 10/27 | upload-pack: move rev-list code out of check_non_tip()upload-pack.c | +23 | 0 replies | |
| 11/27 | fetch-pack: use skip_prefix() instead of starts_with()builtin/ | +6 | 0 replies | |
| 12/27 | fetch-pack: use a common function for verbose printingfetch-pack.c | +42 | 0 replies | |
| 13/27 | fetch-pack.c: mark strings for translatingfetch-pack.c | +37 | 0 replies | |
| 14/27 | fetch-pack: use a separate flag for fetch in deepening modefetch-pack.c fetch-pack.h | +9 | 0 replies | |
| 15/27 | shallow.c: implement a generic shallow boundary finder based on rev-listcommit.h shallow.c | +80 | 0 replies | |
| 16/27 | upload-pack: add deepen-since to cut shallow repos based on timeDocumentation/ Documentation/ upload-pack.c | +54 | 0 replies | |
| 17/27 | fetch: define shallow boundary with --shallow-sinceDocumentation/ Documentation/ Documentation/ +7 more | +67 | 0 replies | |
| 18/27 | clone: define shallow clone boundary based on time with --shallow-sinceDocumentation/ builtin/ | +16 | 0 replies | |
| 19/27 | t5500, t5539: tests for shallow depth since a specific datet/ t/ | +49 | 0 replies | |
| 20/27 | refs: add expand_ref()refs.c refs.h | +8 | 0 replies | |
| 21/27 | upload-pack: support define shallow boundary by excluding revisionsDocumentation/ Documentation/ upload-pack.c | +32 | 0 replies | |
| 22/27 | fetch: define shallow boundary with --shallow-excludeDocumentation/ Documentation/ Documentation/ +8 more | +89 | 0 replies | |
| 23/27 | clone: define shallow clone boundary with --shallow-excludeDocumentation/ builtin/ | +14 | 0 replies | |
| 24/27 | t5500, t5539: tests for shallow depth excluding a reft/ t/ | +43 | 0 replies | |
| 25/27 | upload-pack: split check_unreachable() in two, prep for get_reachable_list()upload-pack.c | +38 | 0 replies | |
| 26/27 | upload-pack: add get_reachable_list()object.h upload-pack.c | +50 | 0 replies | |
| 27/27 | fetch, upload-pack: --deepen=N extends shallow boundary by N commitsDocumentation/ Documentation/ Documentation/ +12 more | +132 | 0 replies |
Reviews trailers per patch
None of the 27 patches has a Reviewed-by or Acked-by.
| Patch | Duy Nguyen | Eric Sunshine | Junio C Hamano |
|---|---|---|---|
| 1/27 | |||
| 2/27 | |||
| 3/27 | |||
| 4/27 | |||
| 5/27 | |||
| 6/27 | |||
| 7/27 | |||
| 8/27 | |||
| 9/27 | |||
| 10/27 | |||
| 11/27 | |||
| 12/27 | |||
| 13/27 | |||
| 14/27 | |||
| 15/27 | |||
| 16/27 | |||
| 17/27 | |||
| 18/27 | |||
| 19/27 | |||
| 20/27 | |||
| 21/27 | |||
| 22/27 | |||
| 23/27 | |||
| 24/27 | |||
| 25/27 | |||
| 26/27 | |||
| 27/27 | Helped-by | Helped-by | Helped-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 00/27] nd/shallow-deepen updates
Second update to address Junio comments. Interdiff
upload-pack.c +36 -28
@@ -453,6 +453,9 @@ static int is_our_ref(struct object *o)return o->flags & ((allow_hidden_ref ?HIDDEN_REF :0 ) |OUR_REF ); } +/* +* on successful case, it's up to the caller to close cmd->out +*/ static int do_reachable_revlist (struct child_process *cmd,struct object_array *src,struct object_array *reachable)
@@ -470,16 +473,16 @@ static int do_reachable_revlist(struct child_process *cmd, cmd->in =-1 ; cmd->out =-1 ; -if (start_command (cmd)) - goto error; -/* -* If rev-list --stdin encounters an unknown commit, it -* terminates, which will cause SIGPIPE in the write loop +* If the next rev-list --stdin encounters an unknown commit, +* it terminates, which will cause SIGPIPE in the write loop * below. */ sigchain_push (SIGPIPE ,SIG_IGN ); +if (start_command (cmd)) + goto error; + namebuf[0 ] ='^' ; namebuf[41 ] ='\n' ;for (i =get_max_object_index ();0 < i; ) {
@@ -491,10 +494,8 @@ static int do_reachable_revlist(struct child_process *cmd,if (!is_our_ref (o))continue ;memcpy (namebuf +1 ,oid_to_hex (&o->oid),GIT_SHA1_HEXSZ ); -if (write_in_full (cmd->in, namebuf,42 ) <0 ) { -sigchain_pop (SIGPIPE ); +if (write_in_full (cmd->in, namebuf,42 ) <0 ) goto error; - } } namebuf[40 ] ='\n' ;for (i =0 ; i < src->nr; i++) {
@@ -507,18 +508,18 @@ static int do_reachable_revlist(struct child_process *cmd,if (reachable && o->type ==OBJ_COMMIT ) o->flags |=TMP_MARK ;memcpy (namebuf,oid_to_hex (&o->oid),GIT_SHA1_HEXSZ ); -if (write_in_full (cmd->in, namebuf,41 ) <0 ) { -sigchain_pop (SIGPIPE ); +if (write_in_full (cmd->in, namebuf,41 ) <0 ) goto error; - } }close (cmd->in); cmd->in =-1 ; -sigchain_pop (SIGPIPE ); +return 0 ; error: +sigchain_pop (SIGPIPE ); +if (cmd->in >=0 )close (cmd->in);if (cmd->out >=0 )
@@ -530,11 +531,11 @@ static int get_reachable_list(struct object_array *src, struct object_array *reachable) {struct child_process cmd =CHILD_PROCESS_INIT ; -int i, ret =do_reachable_revlist (&cmd, src, reachable); +int i;struct object *o;char namebuf[42 ];/* ^ + SHA-1 + LF */ -if (ret <0 ) +if (do_reachable_revlist (&cmd, src, reachable) <0 )return -1 ;while ((i =read_in_full (cmd.out, namebuf,41 )) ==41 ) {
@@ -564,14 +565,14 @@ static int get_reachable_list(struct object_array *src,return 0 ; } -static int check_unreachable (struct object_array *src) +static int has_unreachable (struct object_array *src) {struct child_process cmd =CHILD_PROCESS_INIT ;char buf[1 ];int i;if (do_reachable_revlist (&cmd, src,NULL ) <0 ) -return 0 ; +return 1 ;/* * The commits out of the rev-list are not ancestors of
@@ -592,14 +593,13 @@ static int check_unreachable(struct object_array *src) goto error;/* All the non-tip ones are ancestors of what we advertised */ -return 1 ; +return 0 ; error: -if (cmd.in >=0 ) -close (cmd.in); +sigchain_pop (SIGPIPE );if (cmd.out >=0 )close (cmd.out); -return 0 ; +return 1 ; }static void check_non_tip (void )
@@ -613,7 +613,7 @@ static void check_non_tip(void)*/ if (!stateless_rpc && !(allow_unadvertised_object_request &ALLOW_REACHABLE_SHA1 )) goto error; -if (check_unreachable (&want_obj)) +if (!has_unreachable (&want_obj))/* All the non-tip ones are ancestors of what we advertised */ return ;
@@ -678,25 +678,33 @@ static void send_unshallow(const struct object_array *shallows)static void deepen (int depth,int deepen_relative,struct object_array *shallows) { -struct commit_list *result =NULL ; -int i; -if (depth ==INFINITE_DEPTH && !is_repository_shallow ()) +if (depth ==INFINITE_DEPTH && !is_repository_shallow ()) { +int i; +for (i =0 ; i < shallows->nr; i++) {struct object *object = shallows->objects[i].item; object->flags |=NOT_SHALLOW ; } -else if (deepen_relative) { + }else if (deepen_relative) {struct object_array reachable_shallows =OBJECT_ARRAY_INIT ; +struct commit_list *result; +get_reachable_list (shallows, &reachable_shallows); result =get_shallow_commits (&reachable_shallows, depth +1 ,SHALLOW ,NOT_SHALLOW ); +send_shallow (result); +free_commit_list (result);object_array_clear (&reachable_shallows); - }else + }else { +struct commit_list *result; + result =get_shallow_commits (&want_obj, depth,SHALLOW ,NOT_SHALLOW ); -send_shallow (result); -free_commit_list (result); +send_shallow (result); +free_commit_list (result); + } +send_unshallow (shallows);packet_flush (1 ); }
Signature · 1 line
2.8.2.524.g6ff3d78