Comments (1)
On top-level I can run
braid update projectA
(which is of course working), but I would also like to run it for only a nested vendor repository, e.g.braid update projectA/frameworkA
orbraid update projectB/frameworkB/base
.
I assume the effect of braid update projectA/frameworkA
is to update your main project's nested projectA/frameworkA
mirror to be based on a different revision of frameworkA
than the upstream of projectA
is? IIUC, this would be equivalent to running braid update frameworkA
in the projectA
directory as if that were the project root for Braid's purposes, but committing to the enclosing Git repository in which the worktree root is actually some ancestor directory. That shouldn't be too hard to implement: we'd just need to find all the places where Braid is depending on worktree-absolute paths and generalize them to handle a path prefix.
The harder part would be nailing down the command-line usage. If we implement #63 first, it probably wouldn't be hard to generalize it to "find the nearest ancestor .braids.json of the working directory and treat that as the project root". But if we want to support braid update projectA/frameworkA
as you originally proposed or have a braid update
of "all mirrors" work recursively, etc., we'll have to think harder about how to ensure all of this isn't confusing to users and potentially even consider security implications if a user accidentally operates on an untrusted .braids.json file. There's a potential alternative interpretation of braid COMMAND projectA/frameworkA
, namely: "I want to have a mirror under projectA
that the upstream projectA
doesn't have, but I want to manage it via my root .braids.json file". I don't know if there's demand for this conceivable enhancement (we don't have an issue for it so far), but I'd be careful about foreclosing it.
I have way too long a backlog of other projects to do much more than provide friendly issue responses right now. But I think we would accept a contribution if you can convince us that the value justifies the added maintenance costs. Can you describe a complete example scenario (with specific projects and revisions) in which you'd want to use the feature?
A side note: If the following sequence of steps occurs:
projectA
contains a mirror based on commit X offrameworkA
, and the main project contains a mirror ofprojectA
.- The main project does
braid update --revision=Y projectA/frameworkA
and makes some manual edits toprojectA/frameworkA
. - Upstream
projectA
doesbraid update --revision=Y frameworkA
and makes different manual edits toframeworkA
. - The main project does
braid update projectA
.
then the last step has a high risk of producing messy conflicts or even silently producing an unintended result. This is because braid update
just does a three-way merge of the content of projectA
and sees similar but not identical changes to frameworkA
on both sides (the update from X to Y plus manual edits), so at each difference, it does not know which side has the manual edit that should be kept. (I gave a detailed example of a similar problem involving squash merges here.) I suspect this would be impractical to ever fix in Braid; the only idea I have right now for users concerned about this scenario is to use Git submodules instead. For that matter, the same problem can occur with a plain git merge
of two branches of projectA
, each of which has done braid update --revision=Y frameworkA
and then made different manual edits to frameworkA
.
In a next step also the
braid update
command should support the following call:add
braid update --url <url> [--branch <branch> | --tag <tag> | --revision <revision>]
e.g.braid update --url http://...base.git --branch master
This command should lead to an update of all
base
repositories (found recursive within all.braids.json
file via given url). As a result eachbase
repository is updated with given branch/tag/revision (in this casemaster
branch) and also the correct.braids.json
file (in whichbase
is specified) is updated.
I'm flattered that you're interested in making such sophisticated use of Braid! But for this case, I think you're probably better off finding a real package manager with the features you need (here, coordinating versions of indirect dependencies) and then checking in the files and managing diffs on top of that. It might be possible to design a reasonable enhancement to Braid that would do the second part. If we just added the specific feature you described, I'm afraid you would just run into another missing package-manager feature that you need.
from braid.
Related Issues (20)
- Line breaking at char #80? HOT 3
- doc: clarify version control use HOT 1
- Braid: Shell error: fatal: 'master/braid/.any-dot-file' is not a valid remote name HOT 1
- Support for default branch names other than `master` HOT 3
- Spaces in command arguments break things HOT 5
- Move to `braid help COMMAND` and `braid COMMAND --help`
- "git clone" error message is useless HOT 2
- ssh running under Braid fails to prompt for passphrase on Windows HOT 5
- `braid add` should fail if the destination already exists
- JSON schema for .braids.json HOT 3
- Git 2.36.0 breaks push HOT 5
- `index file open failed` messages when running tests under `bundle exec` in a linked worktree
- Support path with Spaces HOT 1
- Improve documentation for "braiding" a single file HOT 4
- Ability to specify a commit message for a non-interactive `braid push` HOT 3
- Cannot run braid add in a repo with only one commit HOT 1
- https://cristibalan.github.io/braid/ no longer has a direct link to the repository HOT 1
- Filtering/removing some files or subdirectories HOT 4
- Shell error when trying to update one of the braids HOT 2
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 braid.