Comments (4)
Hi, sorry I couldn't reply earlier directly to the original PR (#78)
There is one simplification/refactor that is possible with the code I contributed:
The git cat-file
command accepts a parameter like --batch-check='%(objecttype) %(objectname)'
that will then expect references to be fed on the stdin and outputs the type and hash in a single line.
With this we could rewrite get_local_hash_for_ref()
to use this invocation of git cat-file
and then rewrite self.has_commit(ref)
as:
return self.get_local_hash_for_ref(ref) is not None
Regarding refactoring, tags and remote queries: using the git show-ref
, is the "local" equivalent of git ls-remote
, and could be parsed identically to know if a reference is a locally known tag or branch. This would allow us to skip doing a remote query for tags in the absence of a, say, force-refresh
or force-tag-refresh
parameter.
However while looking into this, it would be nice if anybox.recipe.odoo
would skip doing a remote query if the reference is a branch and buidout:newest = false
(i.e. if buildout is invoked with the -N
parameter).
So, I would suggest the following logic for checking out a reference:
- Check reference against
git show-ref
. - Immediately checkout without a remote query and then stop if:
- The ref is a locally known
tag
and theforce...
parameter is not set - The ref is a locally known
branch
andbuildout:newest == "false"
- The ref is a locally known
- Use
git cat-file
to know if ref is a locally known hash (i.e. what PR #78 did):- if yes, checkout without a remote query and stop
- Proceed like it's currently done now (i.e. with
git ls-remote
).
I would also suggest, for the next major version, that when a hash is used directly as ref, then the branch
option must be used. It could contain the value of a tag instead of a branch, but it must be provided so that a naked git fetch
is not necessary and we could check that the requested hash is actually inside the log of the reference branch/tag.
from anybox.recipe.odoo.
Hi, thanks for the tips, I certainly agree with the expected behaviour.
One reason to call for refactors is that in my mind (even after I refreshed my memory of the code base while reviewing your changes), not querying on locally known SHAs was already supposed to work, and that's the job of has_commit()
: query_remote_ref
shouldn't even be called.
About -N,
yes it's interesting, and if that's what most buildout users would expect, let's go for it.
By the way, freeze/extract should force its use, their are some rare yet known corner cases where a surprise can happen with python libraries.
PS: I suppose you can't comment on #78 because merging closed it.
from anybox.recipe.odoo.
PS: I suppose you can't comment on #78 because merging closed it.
Actually, it looks like I can still comment there. I just meant that I didn't get around to replying to you before you closed it, so it felt more appropriate to continue the discussion here instead of there.
from anybox.recipe.odoo.
@leorochael you're right, it's better to discuss this in an open issue.
PS: don't be surprised, I'll be mostly inactive till mid-september after b1 release.
from anybox.recipe.odoo.
Related Issues (20)
- anybox.recipe.odoo must ensure develop-eggs directory is well created before calling develop method
- pychart down HOT 2
- Couldn't find a distribution for 'pychart' HOT 9
- Error with Pillow dependency
- StefanRijnhart As Maintainer of anybox.recipe.odoo HOT 3
- ImportError: No module named openerp.tools.config
- UnboundLocalError: local variable 'exc' referenced before assignment HOT 2
- ModuleNotFoundError: No module named 'werkzeug.contrib' HOT 4
- ModuleNotFoundError: No module named 'zope.event' while running bin/start_odoo HOT 1
- python_odoo is failing with "DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless." on Odoo 15.0 HOT 1
- Continued development has moved to https://github.com/OCA/oca.recipe.odoo
- Wheels mistaken for developed distributions
- Merge SHA issue with Git 1.7.10
- [REF] openerp: move `openerp` to `odoo` HOT 5
- [BUG] empty log file HOT 3
- Can't merge remote branch at specific revision HOT 2
- One folder per Odoo version? HOT 1
- start_odoo: Port already in use HOT 1
- Odoo v10 --dev=all broken restart HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anybox.recipe.odoo.