From 3d3a24b22d340c62fafc0e75a349c0ffe34d99d7 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 11:07:04 +0200 Subject: Added repo.index property including simple test, and additional ideas in the TODO list --- TODO | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index 5ec71dc3..f283b244 100644 --- a/TODO +++ b/TODO @@ -50,32 +50,44 @@ Overhaul docs - check examples, check looks, improve existing docs Index ----- -* write_tree should write a tree directly, which would require ability to create +* [advanced] + write_tree should write a tree directly, which would require ability to create objects in the first place. Should be rather simple as it is "tree" bytes datablock | sha1sum and zipped. Currently we use some file swapping and the git command to do it which probably is much slower. The thing is that properly writing a tree from an index involves creating several tree objects, so in the end it might be slower. Hmm, probably its okay to use the command unless we go c(++) +* Proper merge handling with index and working copy +* Checkout individual blobs using the index and git-checkout. Blobs can already + be written using their stream_data method. Refs ----- -* If the HEAD is detached as it points to a specific commit, its not technically - a symbolic reference anymore. Currently, we cannot handle this that well - as we do not check for this case. This should be added though as it is - valid to have a detached head in some cases. - +* When adjusting the reference of a symbolic reference, the ref log might need + adjustments as well. This is not critical, but would make things totally 'right' +* Reference Objects should be able to set the commit they are pointing to, making + the commit property read-write. Tags are a special case of this and would need + to be handled as well ! +* Ability to create new heads and tags in the Repository ( but using the respective + Reference Type ), i.e. Head.create(repo, name, commit = 'HEAD') or + TagReference.create(repo, name +* Ability to rename references and tags +* Ability to remove references and tags + Remote ------ * 'push' method needs a test, a true test repository is required though, a fork of a fork would do :)! +* Fetch should return heads that where updated, pull as well. Repo ---- * Blame: Read the blame format making assumptions about its structure, currently regex are used a lot although we can deduct what will be next. - Read data from a stream directly from git command - +* Figure out how to implement a proper merge API + Submodules ---------- * add submodule support -- cgit v1.2.3 From a7a4388eeaa4b6b94192dce67257a34c4a6cbd26 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 12:14:22 +0200 Subject: Added frame for IndexFile add/remove/commit methods and respective test markers --- TODO | 3 +++ 1 file changed, 3 insertions(+) (limited to 'TODO') diff --git a/TODO b/TODO index f283b244..7771cedf 100644 --- a/TODO +++ b/TODO @@ -58,6 +58,7 @@ Index is much slower. The thing is that properly writing a tree from an index involves creating several tree objects, so in the end it might be slower. Hmm, probably its okay to use the command unless we go c(++) +* Implement diff so that temporary indices can be used as well ( using file swapping ) * Proper merge handling with index and working copy * Checkout individual blobs using the index and git-checkout. Blobs can already be written using their stream_data method. @@ -74,6 +75,8 @@ Refs TagReference.create(repo, name * Ability to rename references and tags * Ability to remove references and tags +* Ability to checkout a reference - +* Check whether we are the active reference HEAD.commit == self.commit Remote ------ -- cgit v1.2.3 From ddc5496506f0484e4f1331261aa8782c7e606bf2 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 15:22:07 +0200 Subject: Implemented head methods: create, delete, rename, including tests --- TODO | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'TODO') diff --git a/TODO b/TODO index 7771cedf..6d548a15 100644 --- a/TODO +++ b/TODO @@ -73,7 +73,7 @@ Refs * Ability to create new heads and tags in the Repository ( but using the respective Reference Type ), i.e. Head.create(repo, name, commit = 'HEAD') or TagReference.create(repo, name -* Ability to rename references and tags +* Ability to rename references and tagsre * Ability to remove references and tags * Ability to checkout a reference - * Check whether we are the active reference HEAD.commit == self.commit @@ -83,6 +83,8 @@ Remote * 'push' method needs a test, a true test repository is required though, a fork of a fork would do :)! * Fetch should return heads that where updated, pull as well. +* Creation and deletion methods for references should be part of the interface, allowing + repo.create_head(...) instaed of Head.create(repo, ...). Its a convenience thing, clearly Repo ---- -- cgit v1.2.3 From 9b9776e88f7abb59cebac8733c04cccf6eee1c60 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 16:07:45 +0200 Subject: Refs can now set the reference they are pointing to in a controlled fashion by writing their ref file directly --- TODO | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index 6d548a15..c2cc804b 100644 --- a/TODO +++ b/TODO @@ -67,15 +67,7 @@ Refs ----- * When adjusting the reference of a symbolic reference, the ref log might need adjustments as well. This is not critical, but would make things totally 'right' -* Reference Objects should be able to set the commit they are pointing to, making - the commit property read-write. Tags are a special case of this and would need - to be handled as well ! -* Ability to create new heads and tags in the Repository ( but using the respective - Reference Type ), i.e. Head.create(repo, name, commit = 'HEAD') or - TagReference.create(repo, name -* Ability to rename references and tagsre -* Ability to remove references and tags -* Ability to checkout a reference - + - same with adjusting references directly * Check whether we are the active reference HEAD.commit == self.commit Remote -- cgit v1.2.3 From 44a601a068f4f543f73fd9c49e264c931b1e1652 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 16:51:59 +0200 Subject: Added notes about git-update-ref --- TODO | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'TODO') diff --git a/TODO b/TODO index c2cc804b..d44842f6 100644 --- a/TODO +++ b/TODO @@ -68,7 +68,12 @@ Refs * When adjusting the reference of a symbolic reference, the ref log might need adjustments as well. This is not critical, but would make things totally 'right' - same with adjusting references directly -* Check whether we are the active reference HEAD.commit == self.commit + !! - Could simply rewrite it using git-update-ref which works nicely for symbolic + and for normal refs !! +* Check whether we are the active reference HEAD.reference == this_ref + - NO: The reference dosnt need to know - in fact it does not know about the + main HEAD, so it may not use it. This is to be done in client code only. + Remove me Remote ------ -- cgit v1.2.3 From 0cd09bd306486028f5442c56ef2e947355a06282 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Oct 2009 21:49:13 +0200 Subject: index.remove implemented including throrough test --- TODO | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'TODO') diff --git a/TODO b/TODO index 7771cedf..9e217484 100644 --- a/TODO +++ b/TODO @@ -62,6 +62,15 @@ Index * Proper merge handling with index and working copy * Checkout individual blobs using the index and git-checkout. Blobs can already be written using their stream_data method. +* index.add: could be implemented in python together with hash-object, allowing + to keep the internal entry cache and write once everything is done. Problem + would be that all other git commands are unaware of the changes unless the index + gets written. Its worth an evaluation at least. +* index.remove: On windows, there can be a command line length overflow + as we pass the paths directly as argv. This is as we use git-rm to be able + to remove whole directories easily. This could be implemented using + git-update-index if this becomes an issue, but then we had to do all the globbing + and directory removal ourselves Refs ----- -- cgit v1.2.3 From f9cec00938d9059882bb8eabdaf2f775943e00e5 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 24 Oct 2009 00:08:33 +0200 Subject: index.commit: implemented initial version, but in fact some more changes are required to have a nice API. Tests are not yet fully done either --- TODO | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'TODO') diff --git a/TODO b/TODO index 9e217484..17c6480a 100644 --- a/TODO +++ b/TODO @@ -31,6 +31,12 @@ Object it should be renamed to 'sha'. There was a time when references where allowed as well, but now objects will be 'baked' to the actual sha to assure comparisons work. +Commit +------ +* message is stipped during parsing, which is wrong unless we parse from + rev-list output. In fact we don't know that, and can't really tell either. + Currently we strip away white space that might actually belong to the message + Config ------ * Expand .get* methods of GitConfigParser to support default value. If it is not None, @@ -71,6 +77,11 @@ Index to remove whole directories easily. This could be implemented using git-update-index if this becomes an issue, but then we had to do all the globbing and directory removal ourselves +* commit: advance head = False - tree object should get the base commit wrapping + that index uses after writing itself as tree. Perhaps it would even be better + to have a Commit.create method from a tree or from an index. Allowing the + latter would be quite flexible and would fit into the system as refs have + create methods as well Refs ----- -- cgit v1.2.3 From 0ef1f89abe5b2334705ee8f1a6da231b0b6c9a50 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 26 Oct 2009 22:37:48 +0100 Subject: index.add: Finished implemenation including through tests index.checkout: added simple method allowing to checkout files from the index, including simple test --- TODO | 2 ++ 1 file changed, 2 insertions(+) (limited to 'TODO') diff --git a/TODO b/TODO index 69fbc307..d841f774 100644 --- a/TODO +++ b/TODO @@ -72,6 +72,8 @@ Index to keep the internal entry cache and write once everything is done. Problem would be that all other git commands are unaware of the changes unless the index gets written. Its worth an evaluation at least. + A problem going with it is that there might be shell-related limitations on non-unix + where the commandline grows too large. * index.remove: On windows, there can be a command line length overflow as we pass the paths directly as argv. This is as we use git-rm to be able to remove whole directories easily. This could be implemented using -- cgit v1.2.3