Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 522738 - repos.conf: Support attributes specifying options for VCS programs
Summary: repos.conf: Support attributes specifying options for VCS programs
Status: IN_PROGRESS
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-13 16:12 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2015-02-03 09:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2014-09-13 16:12:19 UTC
repos.conf should support attributes specifying options for VCS programs.

One attribute with options for `cvs checkout`/`svn checkout`/`git clone`/`hg clone` and another attribute with options for `cvs update`/`svn update`/`git pull`/`hg pull` should suffice.

Possible names of attributes:
  sync-vcs-checkout-args
  sync-vcs-update-args

I suggest to support 2 variants of syntax:
  attribute = arg1 arg2 arg3 ...
  attribute = ["arg1", "arg2", "arg3", ...]
This will allow to embed spaces in arguments.


Example use case:
Funtoo wants to use `git clone --depth=1` for the merged tree.
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2014-09-14 22:39:32 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #0)

> 
> Possible names of attributes:
>   sync-vcs-checkout-args
>   sync-vcs-update-args

YUK!

There is no need to individualize them in the new sync code.

    checkout-args
    update-args 

Then the config check can be standardized in pym/portage/sync/config_checks.py's CheckSyncConfig base class.  Then a sync module only needs to use it or override that check with custom code if need be.

These variables would need to be defined in each repo's section, not global in nature.  Of course their absence would default to '' or None.

It should also be do-able for layman to extend it's capabilities similarly for all those repo types that are capable.  So far there is only global repo type options for those, but individualized repo options were always planned. 

 
> I suggest to support 2 variants of syntax:
>   attribute = arg1 arg2 arg3 ...
>   attribute = ["arg1", "arg2", "arg3", ...]
> This will allow to embed spaces in arguments.
> 

I don't know that the python standard configparser can handle python arrays like that.  I believe that required an add on python module to support that.

> 
> Example use case:
> Funtoo wants to use `git clone --depth=1` for the merged tree.
Comment 2 Arfrever Frehtes Taifersar Arahesis 2014-09-15 04:41:18 UTC
(In reply to Brian Dolbec from comment #1)
> (In reply to Arfrever Frehtes Taifersar Arahesis from comment #0)
> > Possible names of attributes:
> >   sync-vcs-checkout-args
> >   sync-vcs-update-args
> 
> There is no need to individualize them in the new sync code.
> 
>     checkout-args
>     update-args

I think that synchronization-related attributes should have "sync-" prefix.

> > I suggest to support 2 variants of syntax:
> >   attribute = arg1 arg2 arg3 ...
> >   attribute = ["arg1", "arg2", "arg3", ...]
> > This will allow to embed spaces in arguments.
> 
> I don't know that the python standard configparser can handle python arrays
> like that.  I believe that required an add on python module to support that.

It can be done manually in very easy way:

>>> value = '["arg1", "arg2", "arg3"]'
>>> value
'["arg1", "arg2", "arg3"]'
>>> if value.startswith("[") and value.endswith("]"):
...   value = eval(value)
... 
>>> value
['arg1', 'arg2', 'arg3']
>>>
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-09-15 07:27:11 UTC
I think we'd use some design that would allow us to keep the repository at --depth=1.

Specifically:

1. clone with --depth=N,

2. fetch normally,

3. strip history after fetching.

Not sure if the usual dedicated option for adjusting everything nonsense is the best way to achieve this.
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2015-02-03 07:55:24 UTC
How is the status here?
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2015-02-03 08:15:19 UTC
sync-depth has been added so far and will be in the 2.2.16 release.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2015-02-03 09:05:38 UTC
I was look for a way to add "-q" to git pull as some "normal" output goes to stderr which is not nice if you run sync processes via cron and only like to get real errors by mail.