Age | Commit message (Collapse) | Author |
|
|
|
The introduction of non-upwards symlinks as first-class objects
should have updated the handling of known git tree artifacts
containing symlinks. In particular, one should consider trees in
their entirety when uploading (irrespective of the ignore_special
flag), and git trees should only be reported as known only if
the ignore_special flag is set to false.
|
|
The command 'git add .' does not include paths found in .gitignore
files in the directory tree where the command is issued. This is
not the desired behaviour, as we expect for a tree with a given
commit id to contain all of the entries, irrespective of their
meaning to Git.
This commit addresses the issue as described.
For the just-mr.py script we modified the staging command to
'git add -f .'.
For the compiled just-mr, simply adding the force flag to
'git_index_add_all' did not work as intended for files found in
ignored subdirectories. This is a known libgit2 issue which has
been fixed in v1.6.3. Until we can upgrade our libgit2 version,
a workaround was implemented: we recursively read the directory
entries ourselves and add each of them iteratively using
'git_index_add_bypath', making sure to ignore the root '.git'
subtree (which cannot be staged).
At the moment the handling of Git submodules remains an open issue,
as Git does not allow '.git' subtrees to be forcefully added to the
index, and thus such directory entries will currently not be
considered as part of a git tree. This however is consistent
behavior between Git and libgit2.
|
|
...as early as possible. This ensures that callers always receive
only the tree entries for the supported object types.
For the symlinks non-upwardness check we pass a lambda capturing
the real backend of the tree entries, such that the symlinks can
be read.
Updates git_tree tests accordingly.
|
|
...but make sure it is still considered a special type.
The only non-special entry types remain file, executable, and tree.
|
|
This feature has been introduced with C++20.
|
|
|
|
...caused by incorrectly setting and resetting the library internal
state and the misuse of pthreads in libgit2.
Normally, git_libgit2_init and git_libgit2_shutdown should span the
life of a worker thread in order to be safely used. However, due to
an incorrect implementation of libgit2's threadstate with pthreads,
on unix systems there is a race condition.
Until the use of pthread_key_t is corrected in libgit2, we need to
apply a workaround by always ensuring that the main thread is the
first thread reaching the GitContext constructor.
|
|
... with two minor code base changes compared to previous
use of gsl-lite:
- dag.hpp: ActionNode::Ptr and ArtifactNode::Ptr are not
wrapped in gsl::not_null<> anymore, due to lack of support
for wrapping std::unique_ptr<>. More specifically, the
move constructor is missing, rendering it impossible to
use std::vector<>::emplace_back().
- utils/cpp/gsl.hpp: New header file added to implement the
macros ExpectsAudit() and EnsureAudit(), asserts running
only in debug builds, which were available in gsl-lite but
are missing in MS GSL.
|
|
In the current libgit2 implementation, a fake repository wrapped
around an existing odb is being registered as owner the same way
as a normal repository object. Therefore, one has to guard both
the creation and destruction of the fake repository against all
other git operations that might access the internal cache during
this transfer of ownership.
|
|
Use a similar logic as for repository initialisation: first check
if tag has not already been created in another process, and only
then try creation; make more tries with more wait in between; only
retry if failure was due to internal locking.
|
|
|
|
As the initialisation of Git repositories is something that only
takes place once, we should check early and cheaply whether the
repository is already there before trying to initialize it.
If we do need to initilize a repo, we can afford more attempts and
longer wait times between tries to initalize if the failure to
initialize happens due to the internal Git locking mechanism.
|
|
|
|
Opening a repo should not check parent directories, only try to
open at given path.
|
|
|
|
|
|
|
|
|
|
|
|
commit update
Uses the SSL certification utility method to correctly set the
certification check options for the remote URL libgit2 calls.
Due to the fact that remote operations are done via a temporary
repository to allow concurrent work, the correct repository
configuration needs to be interrogated. Thankfully, libgit2
provides a thread safe config snapshot object to be used in
such scenarios.
Also updates the existing GitRepoRemote tests accordingly.
|
|
...in order to not include unwanted dependencies in just proper.
The new class extends the GitRepo class used for just's Git tree
operations and gets used in all of just-mr's async maps.
|
|
|
|
While compilers are allowed to drop unused functions in anonymous
name spaces, and in this way also the open linker symbols referenced
there, they are not obliged to do so. Not optimizing away such
unused functions when compiled with -DBOOTSTRAP_BUILD_TOOL causes
the linking fail in the initial phase of the boostrap process where
libgit2 is not yet available (nor really needed). Therefore, ensure
that those dead functions are absent in the initial bootstrap phase
using appropriate preprocessor directives.
Signed-off-by: Klaus T. Aehlig <aehlig@linta.de>
|
|
As now all remote Git operations in GitRepo require at most just
the branch name, there is no more need to inquire the repository
about branch refspecs.
|
|
The libgit2 library does not satisfy the http.sslVerify gitconfig
field or the GIT_SSL_NO_VERIFY environment variable, so we have to
perform these checks ourselves and supply the correct return value
from the certificate_check git_fetch_options callback.
The callbacks used for fixing the remote fetch SSL certificate
verification are reused here.
|
|
The libgit2 library does not satisfy the http.sslVerify gitconfig
field or the GIT_SSL_NO_VERIFY environment variable, so we have to
perform these checks ourselves and supply the correct return value
from the certificate_check git_fetch_options callback.
|
|
...and use instead the branch name. A valid direct refspec (as those
retrieved by a remote_ls call) will always end in the branch name,
so checking the last path component ('/'-delimited substring) of a
retrieved refspec is enough.
|
|
|
|
from remote
|
|
This also removes the need to call the GET_BRANCH_REFNAME critical
operation.
|
|
Passing the logger by reference would require the caller to be
kept alive. Also, being a shared_ptr, the logger can be passed
by value at almost no cost.
|
|
|
|
|
|
|
|
|
|
|
|
|