This repository was archived by the owner on Jan 22, 2025. It is now read-only.
forked from src-d/go-git
-
Notifications
You must be signed in to change notification settings - Fork 5
Adapted non-force fetching with locking #1
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
86e75a5
Update README.md
bzz bb3217c
Merge pull request #585 from src-d/doc/upd-linl
mcuadros 841b62a
plumbing: the commit walker can skip externally-seen commits
strib 52c1f98
config: support a configurable, and turn-off-able, pack.window
strib 032ec28
Merge pull request #587 from keybase/strib/skip-compression-gh-master
mcuadros 8cb0215
Merge pull request #586 from keybase/strib/commit-preorder-seen-gh-ma…
mcuadros 5bb64f6
revlist: do not revisit ancestors as long as all branches are visited
erizocosmico 7d1595f
Merge pull request #588 from erizocosmico/perf/revlist-norevisit-ance…
mcuadros 9e2a811
Add a Force flag to Fetch and Clone, mimicking the command-line client
b3363d3
Use optionally locking when updating refs
taruti 481ece0
Document Lock+Close usage
taruti 7da91ff
Fetch - honor per refspec force flag
taruti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ func (s *ConfigSuite) TestUnmarshall(c *C) { | |
input := []byte(`[core] | ||
bare = true | ||
worktree = foo | ||
[pack] | ||
window = 20 | ||
[remote "origin"] | ||
url = [email protected]:mcuadros/go-git.git | ||
fetch = +refs/heads/*:refs/remotes/origin/* | ||
|
@@ -33,6 +35,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) { | |
|
||
c.Assert(cfg.Core.IsBare, Equals, true) | ||
c.Assert(cfg.Core.Worktree, Equals, "foo") | ||
c.Assert(cfg.Pack.Window, Equals, uint(20)) | ||
c.Assert(cfg.Remotes, HasLen, 2) | ||
c.Assert(cfg.Remotes["origin"].Name, Equals, "origin") | ||
c.Assert(cfg.Remotes["origin"].URLs, DeepEquals, []string{"[email protected]:mcuadros/go-git.git"}) | ||
|
@@ -51,6 +54,8 @@ func (s *ConfigSuite) TestMarshall(c *C) { | |
output := []byte(`[core] | ||
bare = true | ||
worktree = bar | ||
[pack] | ||
window = 20 | ||
[remote "alt"] | ||
url = [email protected]:mcuadros/go-git.git | ||
url = [email protected]:src-d/go-git.git | ||
|
@@ -65,6 +70,7 @@ func (s *ConfigSuite) TestMarshall(c *C) { | |
cfg := NewConfig() | ||
cfg.Core.IsBare = true | ||
cfg.Core.Worktree = "bar" | ||
cfg.Pack.Window = 20 | ||
cfg.Remotes["origin"] = &RemoteConfig{ | ||
Name: "origin", | ||
URLs: []string{"[email protected]:mcuadros/go-git.git"}, | ||
|
@@ -92,6 +98,8 @@ func (s *ConfigSuite) TestUnmarshallMarshall(c *C) { | |
bare = true | ||
worktree = foo | ||
custom = ignored | ||
[pack] | ||
window = 20 | ||
[remote "origin"] | ||
url = [email protected]:mcuadros/go-git.git | ||
fetch = +refs/heads/*:refs/remotes/origin/* | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is from someone else's PR, but I don't think this is strictly needed because the
RefSpecs
above already have anIsForce()
method that says whether that particular ref should be forced or not. (ForPullOptions
, the defaultRefSpec
is defined in theRemoteConfig
.) Could you please update it to use theIsForce
method instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now when actually doing this, are you sure we want this? CheckoutOptions and PullOptions have the Force bool in addition to FetchOptions. Removing it from one but not the others would feel inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep the
Force
bool if you want, but in that case please also add support for theIsForce()
method. The git remote protocol supports both force and non-force fetches in the same batch, so we'll need to be able to specify the force on individual refs.