"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: separate send and fetch config blocks
To:
gameoftrees@openbsd.org
Date:
Mon, 30 Aug 2021 17:32:30 +0200

Download raw body.

Thread
  • Stefan Sperling:

    separate send and fetch config blocks

  • Stefan Sperling:
    
    > > This allows for setting fetch-specific and send-specific options in got.conf.
    > > I have added a minimal test which verifies that different repositories can
    > > be fetched from and sent to.
    > > 
    > > I have not yet updated got.conf documentation.
    > 
    > New patch which updates the documentation as well.
    
    I've read it over and it looks fine to me.
    
    I have a tiny man page tweak, and I again wonder if we can't factor
    out the repetition in the if/else branches in send_gotconfig_remotes().
    
    diff 40752887c65a5a4f70e7a070f887f1ef10d707e2 bcf16cf122539ecc20e410b0bfb1e9e7c01d313f
    blob - 7b400d18d82d02aba5e0b4d7b7dad40a43b51be5
    blob + fdf75268f1fdfc0967b0af46ec9fcf6efa3c5327
    --- got/got.conf.5
    +++ got/got.conf.5
    @@ -112,7 +112,7 @@ Specify one or more branches which
     .Cm got fetch
     and
     .Cm got send
    -should fetch and send from the remote repository by default.
    +should fetch from and send to the remote repository by default.
     The list of branches specified here can be overridden at the
     .Cm got fetch
     and
    blob - 87b6e325e90f1a5df5293fea97f21d0e0ec8ecdd
    blob + 3eb4560b62d19ac09c049067c235bc7051c1216c
    --- libexec/got-read-gotconfig/got-read-gotconfig.c
    +++ libexec/got-read-gotconfig/got-read-gotconfig.c
    @@ -255,32 +255,22 @@ send_gotconfig_remotes(struct imsgbuf *ibuf,
     		struct node_ref *ref;
     		int nfetch_branches = 0, nsend_branches = 0, nfetch_refs = 0;
     
    -		if (repo->fetch_config && repo->fetch_config->branch) {
    +		if (repo->fetch_config && repo->fetch_config->branch)
     			branch = repo->fetch_config->branch;
    -			while (branch) {
    -				branch = branch->next;
    -				nfetch_branches++;
    -			}
    -		} else {
    +		else
     			branch = repo->branch;
    -			while (branch) {
    -				branch = branch->next;
    -				nfetch_branches++;
    -			}
    +		while (branch) {
    +			branch = branch->next;
    +			nfetch_branches++;
     		}
     
    -		if (repo->send_config && repo->send_config->branch) {
    +		if (repo->send_config && repo->send_config->branch)
     			branch = repo->send_config->branch;
    -			while (branch) {
    -				branch = branch->next;
    -				nsend_branches++;
    -			}
    -		} else {
    +		else
     			branch = repo->branch;
    -			while (branch) {
    -				branch = branch->next;
    -				nsend_branches++;
    -			}
    +		while (branch) {
    +			branch = branch->next;
    +			nsend_branches++;
     		}
     
     		ref = repo->fetch_ref;
    @@ -354,44 +344,26 @@ send_gotconfig_remotes(struct imsgbuf *ibuf,
     		free(send_url);
     		send_url = NULL;
     
    -		if (repo->fetch_config && repo->fetch_config->branch) {
    +		if (repo->fetch_config && repo->fetch_config->branch)
     			branch = repo->fetch_config->branch;
    -			while (branch) {
    -				err = send_gotconfig_str(ibuf,
    -				    branch->branch_name);
    -				if (err)
    -					break;
    -				branch = branch->next;
    -			}
    -		} else {
    +		else
     			branch = repo->branch;
    -			while (branch) {
    -				err = send_gotconfig_str(ibuf,
    -				    branch->branch_name);
    -				if (err)
    -					break;
    -				branch = branch->next;
    -			}
    +		while (branch) {
    +			err = send_gotconfig_str(ibuf, branch->branch_name);
    +			if (err)
    +				break;
    +			branch = branch->next;
     		}
     
    -		if (repo->send_config && repo->send_config->branch) {
    +		if (repo->send_config && repo->send_config->branch)
     			branch = repo->send_config->branch;
    -			while (branch) {
    -				err = send_gotconfig_str(ibuf,
    -				    branch->branch_name);
    -				if (err)
    -					break;
    -				branch = branch->next;
    -			}
    -		} else {
    +		else
     			branch = repo->branch;
    -			while (branch) {
    -				err = send_gotconfig_str(ibuf,
    -				    branch->branch_name);
    -				if (err)
    -					break;
    -				branch = branch->next;
    -			}
    +		while (branch) {
    +			err = send_gotconfig_str(ibuf, branch->branch_name);
    +			if (err)
    +				break;
    +			branch = branch->next;
     		}
     
     		ref = repo->fetch_ref;
    
    -- 
    Christian "naddy" Weisgerber                          naddy@mips.inka.de
    
    
    
  • Stefan Sperling:

    separate send and fetch config blocks