| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With `morph edit` removed, there is no need to load all the
morphologies, check whether a chunk was `morph edited`, change the
current ref to the build ref and write back the morphologies to a
temporary branch.
That is a lot of work as code profiling demonstrated. With this patch
applied, morph execution finishes around 10 seconds sooner on my
machine. This is not a big achievement when a full build is performed
where the wall clock time is dictated by the actual build commands, but
it will provide a much quicker feedback when the build artifacts were
already cached, or the semantic validation of morphologies fail.
We add the option `--untracked-files` to _get_status() in the GitIndex
class so that uncommitted morphologies on a uncommitted directory are
considered. Previously this was being done by calling the following
call in inject_build_refs():
self._root_index.add_files_from_index_info(
self._hash_morphologies(self._root, morphs.morphologies))
This commit also removes some now unused code.
Change-Id: I14215db5c06ab06045ce901131e4e341271a039d
|
|
|
|
| |
Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
|
|
|
|
|
|
| |
This is nice because it's fast. We don't have to copy all the Git
history along with it like we do with a clone. And it doesn't touch
any files in the cached repo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We assumed that the sha1 of the tree of the commit of the ref we care
about was sufficient to cache, but `git replace` means that you need to
know the state of other branches too, since anything in refs/replace can
completely change what the tree you check-out is.
This behaviour can be disabled globally by setting
GIT_NO_REPLACE_OBJECTS, so we're going to do that.
If we need to integrate a project that uses git-replace to change the
contents of their git trees then we could support that by:
if any(refs/replace/*):
potentially_replacable_objects = [
`git rev-parse HEAD`,
`git rev-parse HEAD^{commit}`,
`git rev-parse HEAD^{tree}`]
potentially_replacable_objects.extend(
`git ls-tree -r HEAD | awk '{print $3}'`)
# NOTE: doesn't handle submodules, and you'd need to expand this
# set whenever you process a replacement
for object in refs/replace/*:
if basename(object) not in potentially_replacable_objects: continue
cache_key['replacements'][basename(object)] = `git rev-parse $object`
If we were to support this would need to traverse the tree anyway, doing
replacements, so we may as well use libgit to do the checkout anyway,
and list which replacements were used.
However, since the expected use-case of `git replace` is as a better way
to do history grafting, we're unlikely to need it, as it would only have
any effect if it replaced the commit we were using with a different one.
Rubber-stamped-by: Daniel Silverstone
|
|
|
|
|
| |
This generates a tree object from the index.
This can then be used to create a commit.
|
|
|
|
|
|
|
|
|
|
| |
This is like GitIndex.add_files_from_index_info, but uses the working
tree and a list of paths. This is more convenient when the changes exist
in the working tree.
The comment describes its relationship with
GitIndex.add_files_from_index_info, but it is faster, since it calls out
to `git add` rather than calling out to `git hash-object` for every file.
|
|
|
|
|
|
| |
This is used to add files directly to the index, without touching the
working tree. This is used in the build without commit code for creating
new morphologies pointing to different branches.
|
|
|
|
|
|
|
| |
This is used to set the state of the index to that of a previously known
commit. This is needed for the build without commit logic, so that
commits generated are that of the last commit in the repository and
anything uncommitted.
|
|
This represents the state of the index of a GitDirectory.
Methods that use the index are now used via the GitIndex class, rather
than using the default index, as previously used when the methods were
in GitDirectory.
GitIndex may be constructed with an alternative path, which can be used
to manipulate a git checkout without altering a developer's view of the
repository i.e. The working tree and default index.
This is needed for `morph build` and `morph deploy` to handle the build
without commit logic.
|