bender snapshot: preserve original source URL
Pitfall
When using bender clone, the local copy of a dependency is created under working_dir. In the Bender.lock, the dependency source is typically stored using the original HTTPS URL, for example:
source = "https://github.com/owner/repo.git"
However, during local development, it is common to manually change the Git remote of the cloned dependency from HTTPS to SSH:
git remote set-url origin git@github.com:owner/repo.git
After finishing the implementation, I usually go back to the parent project and run:
This correctly updates the locked revision in Bender.lock to the latest commit of the local dependency. However, it also updates the dependency source URL from HTTPS to SSH, for example:
source = "git@github.com:owner/repo.git"
This can later break bender checkout.
Expected behavior
It would be useful if bender snapshot updated only the locked revision, while preserving the original source URL from the existing Bender.lock or Bender.yml.
Motivation
This would make the local development workflow smoother:
bender clone dependencies.
- Change the local dependency remote to SSH to push development changes.
- Implement and push changes.
- Run
bender snapshot in the parent project.
- Commit the updated
Bender.lock.
At the moment, step 4 also changes the source URL, which can accidentally make the lock file less portable and break checkout for other users or CI.
bender snapshot: preserve original source URLPitfall
When using
bender clone, the local copy of a dependency is created underworking_dir. In theBender.lock, the dependency source is typically stored using the original HTTPS URL, for example:However, during local development, it is common to manually change the Git remote of the cloned dependency from HTTPS to SSH:
After finishing the implementation, I usually go back to the parent project and run:
This correctly updates the locked revision in
Bender.lockto the latest commit of the local dependency. However, it also updates the dependency source URL from HTTPS to SSH, for example:This can later break
bender checkout.Expected behavior
It would be useful if
bender snapshotupdated only the locked revision, while preserving the original source URL from the existingBender.lockorBender.yml.Motivation
This would make the local development workflow smoother:
bender clonedependencies.bender snapshotin the parent project.Bender.lock.At the moment, step 4 also changes the source URL, which can accidentally make the lock file less portable and break checkout for other users or CI.