The following series allow to pick from all over the tree, even if your tree
is full of merge commits, and if you use grafts extensively.
The series is not really complete, it lacks a fix for a nasty bug that
crashes stgit when "pick" encounters a file-creation conflict. But
nevertheless, I would not have been able to do my job today without them :)
--
Yann Dirson [off-list ref] |
Debian-related: [off-list ref] | Support Debian GNU/Linux:
| Freedom, Power, Stability, Gratis
http://ydirson.free.fr/ | Check <http://www.debian.org/>
This has the direct effect of taking info/grafts into account, since
ignoring it only causes confusion.
My original implementation was pasted from the same fix applied to
cogito some time ago. That one is hopefully more pythonic, but it
looks like split() is deprecated for some reason, and I don't know
what should be used instead.
Signed-off-by: Yann Dirson <redacted>
---
stgit/git.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
This is useful to pick changes from a non-stgit branch, that were
recorded as a merge commit, while giving control on the parent to
use as "bottom" for the patch (for some reason stgit selects the
first parent by default).
Incidentally, it can be used to pick changes between arbitrary
trees in the revision graph. Since that can be useful as well,
I did not implement the is_parent check I originally meant to add.
Signed-off-by: Yann Dirson <redacted>
---
stgit/commands/pick.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
@@ -37,6 +37,8 @@ options = [make_option('-n', '--name',make_option('-r','--reverse',help='reverse the commit object before importing',action='store_true'),+make_option('-p','--parent',+help='use COMMITID as parent'),make_option('--fold',help='fold the commit object into the current patch',action='store_true'),
Instead of using the split() method, you could call
_output_lines('git-rev-list --parents --max-count=1 %s' %
id_hash)[0].split()[1:]. Maybe that's why they might deprecate the
global split method.
Setting self.__parents by calling get-rev-list would have a
performance impact on the push operation. I think we could remove the
__parents variable and only call git-rev-parse in get_parents() or
get_parent().
--
Catalin
Instead of using the split() method, you could call
_output_lines('git-rev-list --parents --max-count=1 %s' %
id_hash)[0].split()[1:]. Maybe that's why they might deprecate the
global split method.
Ah, OK.
Best regards,
--
Yann.
--
VGER BF report: U 0.500235