Comments (7)
Yeah. I can take a stab at it. Probably next week.
I haven't looked at the codebase much yet, so I'm not sure if this makes sense.
But rather than changing all the backends, I could have the command line parser split the --exact-with-tags
convenience option into two separate options on the command object: the existing .exact
and a .with_tags
. All the other backends would ignore the with_tags
flag and maintain the same behavior.
from vcstool.
I think when the --exact parameter is specified, it is preferable to provide the commit hash.
The behavior to return tags when available is intentional (see #98). Since tags are intended to be immutable and significantly more readable they are being used by --exact
if the current hash has exactly one tag pointing to it.
from vcstool.
I don't know about all vcs tools, but tags frequently aren't all that immutable. For instance, they are frequently used to mark the latest_stable
version or some such thing, with the tag being moved as someone or CI decides that a new version is now passing the tests.
I'm pretty sure they can be moved in Git, so, for right or wrong, if somebody moves the tag, the --exact option is not so exact anymore.
Having the tag is a nice feature most of the time, but, it disagrees with the docs for the --exact parameter.
"export" command parameters:
--exact Export exact commit hash instead of branch names
If you want to keep this behavior, maybe another option, something like --hash-only
could be used to disable the tag lookup feature?
from vcstool.
I'm pretty sure they can be moved in Git, so, for right or wrong, if somebody moves the tag, the --exact option is not so exact anymore.
Sure, you can also rewrite history in git - still something to consider not doing ;-)
Having the tag is a nice feature most of the time, but, it disagrees with the docs for the --exact parameter.
Agreed, clarifying the help text would certainly be good 👍
If you want to keep this behavior, maybe another option, something like --hash-only could be used to disable the tag lookup feature?
Adding another option to toggle the behavior to always return hashes vs. potentially tags if they are unique would be good. Since the change has only landed recently I am not too concerned about changing the behavior (if we think that makes more sense). I am just not sure what the right names for the two options would be --exact
and ? --hash-only
seems very git specific...
from vcstool.
After thinking about it I think it is more natural if --exact
always outputs hashes and a new option --exact-with-tags
(naming up for discussion) for the current behavior (unique tags when available, fallback to hashes).
The new option could either be standalone or require also to pass --exact
. The former seems more user friendly but will require all existing backends to check for the new option and at least do the same as for the existing option.
@crdelsey Would you be willing to contribute a pull request for this new option?
from vcstool.
@crdelsey Friendly ping.
from vcstool.
Resolved by #115.
from vcstool.
Related Issues (20)
- Invocation of command 'import' on client 'hg' failed HOT 2
- submodules usage w/o .gitmodules file HOT 1
- "vcs pull" gets stuck indefinitely
- [feature] option to use hash attached to the relative path instead of the version field
- [feature] self checkout from a branch
- Could not checkout ref '...': fatal: invalid reference HOT 1
- startup time is very long HOT 1
- bad non-descriptive error message 'NoneType' object is not subscriptable HOT 1
- git: vcs import by hash does not work for hashes not in local history HOT 1
- Input data is not valid yaml format: mapping values are not allowed here HOT 5
- [Feature Request] version by author or commit date-time HOT 5
- Import non git tars
- VCS Tool is occasionally causing ssh key errors on enterprise git server HOT 4
- vcs export exits with error if there are local branches that don't track remote branches
- Ignore self signed cert for a specific repository HOT 4
- DeprecationWarning: pkg_resources is deprecated as an API HOT 1
- [feature] Ability to only show errors
- validate fails with commit hash HOT 3
- vcs export --exact-with-tags output fails pre-commit linting rules
- BUG: VCS status does not indicate problems if a tag was force-pushed 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 vcstool.