|
8529ac9b
|
2018-04-17T23:38:46
|
|
Merge pull request #4524 from pks-t/pks/worktree-refs
worktree: add ability to create worktree with pre-existing branch
|
|
12356076
|
2018-03-02T12:41:04
|
|
worktree: lock reason should be const
|
|
a22f19e6
|
2018-02-09T10:38:11
|
|
worktree: add ability to create worktree with pre-existing branch
Currently, we always create a new branch after the new worktree's name
when creating a worktree. In some workflows, though, the caller may want
to check out an already existing reference instead of creating a new
one, which is impossible to do right now.
Add a new option `ref` to the options structure for adding worktrees. In
case it is set, a branch and not already checked out by another
worktree, we will re-use this reference instead of creating a new one.
|
|
f0848dd7
|
2017-06-04T22:44:30
|
|
worktree: upgrade lock to an int
|
|
883eeb5f
|
2017-05-02T12:35:59
|
|
worktree: switch over worktree pruning to an opts structure
The current signature of `git_worktree_prune` accepts a flags field to
alter its behavior. This is not as flexible as we'd like it to be when
we want to enable passing additional options in the future. As the
function has not been part of any release yet, we are still free to
alter its current signature. This commit does so by using our usual
pattern of an options structure, which is easily extendable without
breaking the API.
|
|
8264a30f
|
2017-05-02T10:11:28
|
|
worktree: support creating locked worktrees
When creating a new worktree, we do have a potential race with us
creating the worktree and another process trying to delete the same
worktree as it is being created. As such, the upstream git project has
introduced a flag `git worktree add --locked`, which will cause the
newly created worktree to be locked immediately after its creation. This
mitigates the race condition.
We want to be able to mirror the same behavior. As such, a new flag
`locked` is added to the options structure of `git_worktree_add` which
allows the user to enable this behavior.
|
|
a7aa73a5
|
2017-05-02T10:02:36
|
|
worktree: introduce git_worktree_add options
The `git_worktree_add` function currently accepts only a path and name
for the new work tree. As we may want to expand these parameters in
future versions without adding additional parameters to the function for
every option, this commit introduces our typical pattern of an options
struct. Right now, this structure is still empty, which will change with
the next commit.
|
|
3017ba94
|
2017-03-15T14:24:25
|
|
worktree: implement `git_worktree_open_from_repository`
While we already provide functionality to look up a worktree from a
repository, we cannot do so the other way round. That is given a
repository, we want to look up its worktree if it actually exists.
Getting the worktree of a repository is useful when we want to get
certain meta information like the parent's location, getting the locked
status, etc.
|
|
1ba242c9
|
2017-02-03T13:52:23
|
|
worktree: extract git_worktree_is_prunable
|
|
04fb12ab
|
2015-10-27T12:37:51
|
|
worktree: implement functions reading HEAD
Implement `git_repository_head_for_worktree` and
`git_repository_head_detached_for_worktree` for directly accessing a
worktree's HEAD without opening it as a `git_repository` first.
|
|
f0cfc341
|
2015-10-21T13:53:18
|
|
worktree: implement `git_worktree_prune`
Implement the `git_worktree_prune` function. This function can be
used to delete working trees from a repository. According to the
flags passed to it, it can either delete the working tree's
gitdir only or both gitdir and the working directory.
|
|
2a503485
|
2015-10-21T16:03:04
|
|
worktree: implement locking mechanisms
Working trees support locking by creating a file `locked` inside
the tree's gitdir with an optional reason inside. Support this
feature by adding functions to get and set the locking status.
|
|
dea7488e
|
2015-10-23T14:11:44
|
|
worktree: implement `git_worktree_add`
Implement the `git_worktree_add` function which can be used to create
new working trees for a given repository.
|
|
372dc9ff
|
2015-10-21T13:49:55
|
|
worktree: implement `git_worktree_validate`
Add a new function that checks wether a given `struct
git_worktree` is valid. The validation includes checking if the
gitdir, parent directory and common directory are present.
|
|
d3bc09e8
|
2015-10-21T12:02:31
|
|
worktree: introduce `struct git_worktree`
Introduce a new `struct git_worktree`, which holds information
about a possible working tree connected to a repository.
Introduce functions to allow opening working trees for a
repository.
|
|
45f2b7a4
|
2015-10-21T11:48:02
|
|
worktree: implement `git_worktree_list`
Add new module for working trees with the `git_worktree_list`
function. The function lists names for all working trees of a
certain repository.
|