Bug 578633 - Improve lfs default remote handling
Summary: Improve lfs default remote handling
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-08 04:37 EST by Matthias Fromme CLA
Modified: 2022-02-08 04:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Fromme CLA 2022-02-08 04:37:35 EST
Currently the default remote is always assumed to be "origin". As stated in [1] the default remote should be configurable using git config files.
The ".lfsconfig" is not specified to provide a default remote name.

The remote name is used to find the LFS API in case the url is not explicitly specified using "lfs.url" or "lfs.pushurl".

The behavior for pull should be if url is not explicitely set in :
1. "branch.<branchname>.remote"
2. "remote.lfsdefault"
3. If only one remote exists, use that
4. Fall back to "origin"

The behavior for push should be if url is not explicitely set in "lfs.url" or "lfs.pushurl":
1. "branch.<branchname>.remote"
2. "remote.lfspushdefault"
3. use same as in pull case

Note: "lfs.pushurl" is not mentioned in documentation of "remote.lfspushdefault",
but it makes sense to use it in the same way as "lfs.url" for pull.

[1] https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-config.5.ronn