{"thread":{"id":"5246","subject":"[PATCH 0/2] Series short description","startedAt":"2006-08-14T16:53:07Z","lastAt":"2006-09-03T19:36:50Z","messageCount":6,"participants":["Yann Dirson","Catalin Marinas","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"25263","messageId":"20060814165307.20350.63286.stgit@gandelf.nowhere.earth","threadId":"5246","inReplyTo":null,"subject":"[PATCH 0/2] Series short description","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-08-14T16:53:07Z","receivedAt":"2006-08-14T16:53:07Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"The following series allow to pick from all over the tree, even if your tree\nis full of merge commits, and if you use grafts extensively.\n\nThe series is not really complete, it lacks a fix for a nasty bug that\ncrashes stgit when \"pick\" encounters a file-creation conflict.  But\nnevertheless, I would not have been able to do my job today without them :)\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"25265","messageId":"20060814165542.20350.34612.stgit@gandelf.nowhere.earth","threadId":"5246","inReplyTo":"20060814165307.20350.63286.stgit@gandelf.nowhere.earth","subject":"[PATCH 1/2] Add a --parent flag to \"stgit pick\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-08-14T16:55:42Z","receivedAt":"2006-08-14T16:55:42Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThis is useful to pick changes from a non-stgit branch, that were\nrecorded as a merge commit, while giving control on the parent to\nuse as \"bottom\" for the patch (for some reason stgit selects the\nfirst parent by default).\n\nIncidentally, it can be used to pick changes between arbitrary\ntrees in the revision graph.  Since that can be useful as well,\nI did not implement the is_parent check I originally meant to add.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n stgit/commands/pick.py |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/pick.py b/stgit/commands/pick.py\nindex 1aa83d0..2916b6e 100644\n--- a/stgit/commands/pick.py\n+++ b/stgit/commands/pick.py\n@@ -37,6 +37,8 @@ options = [make_option('-n', '--name',\n            make_option('-r', '--reverse',\n                        help = 'reverse the commit object before importing',\n                        action = 'store_true'),\n+           make_option('-p', '--parent',\n+                       help = 'use COMMITID as parent'),\n            make_option('--fold',\n                        help = 'fold the commit object into the current patch',\n                        action = 'store_true'),\n@@ -73,12 +75,17 @@ def func(parser, options, args):\n             if not patch:\n                 raise CmdException, 'Unknown patch name'\n \n+    if options.parent:\n+        parent = options.parent\n+    else:\n+        parent = commit.get_parent()\n+\n     if not options.reverse:\n-        bottom = commit.get_parent()\n+        bottom = parent\n         top = commit_id\n     else:\n         bottom = commit_id\n-        top = commit.get_parent()\n+        top = parent\n \n     if options.fold:\n         print 'Folding commit %s...' % commit_id,\n"},{"id":"25264","messageId":"20060814165544.20350.41590.stgit@gandelf.nowhere.earth","threadId":"5246","inReplyTo":"20060814165307.20350.63286.stgit@gandelf.nowhere.earth","subject":"[PATCH 2/2] Look for a commit's parents in the standard way.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-08-14T16:55:44Z","receivedAt":"2006-08-14T16:55:44Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThis has the direct effect of taking info/grafts into account, since\nignoring it only causes confusion.\n\nMy original implementation was pasted from the same fix applied to\ncogito some time ago.  That one is hopefully more pythonic, but it\nlooks like split() is deprecated for some reason, and I don't know\nwhat should be used instead.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n stgit/git.py |   10 ++++++----\n 1 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\nindex c8b7b8f..68b547c 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite\n \"\"\"\n \n import sys, os, popen2, re, gitmergeonefile\n+from string import split\n \n from stgit import basedir\n from stgit.utils import *\n@@ -47,12 +48,13 @@ class Commit:\n             field = line.strip().split(' ', 1)\n             if field[0] == 'tree':\n                 self.__tree = field[1]\n-            elif field[0] == 'parent':\n-                self.__parents.append(field[1])\n-            if field[0] == 'author':\n+            #elif field[0] == 'parent':\n+                #self.__parents.append(field[1])\n+            elif field[0] == 'author':\n                 self.__author = field[1]\n-            if field[0] == 'committer':\n+            elif field[0] == 'committer':\n                 self.__committer = field[1]\n+        self.__parents = split(_output_lines('git-rev-list --parents --max-count=1 %s' % id_hash)[0])[1:]\n         self.__log = ''.join(lines[i+1:])\n \n     def get_id_hash(self):\n"},{"id":"25639","messageId":"b0943d9e0608200343t517ec29dw2b6b49d9d69dbad5@mail.gmail.com","threadId":"5246","inReplyTo":"20060814165544.20350.41590.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH 2/2] Look for a commit's parents in the standard way.","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-08-20T10:43:22Z","receivedAt":"2006-08-20T10:43:22Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 14/08/06, Yann Dirson <ydirson@altern.org> wrote:\n> This has the direct effect of taking info/grafts into account, since\n> ignoring it only causes confusion.\n\nI don't know the difference but is there any between parsing the\ncommit file and using git-rev-list --parents?\n\n> +        self.__parents = split(_output_lines('git-rev-list --parents --max-count=1 %s' % id_hash)[0])[1:]\n\nInstead of using the split() method, you could call\n_output_lines('git-rev-list --parents --max-count=1 %s' %\nid_hash)[0].split()[1:]. Maybe that's why they might deprecate the\nglobal split method.\n\nSetting self.__parents by calling get-rev-list would have a\nperformance impact on the push operation. I think we could remove the\n__parents variable and only call git-rev-parse in get_parents() or\nget_parent().\n\n-- \nCatalin\n"},{"id":"25726","messageId":"7vd5ats24g.fsf@assigned-by-dhcp.cox.net","threadId":"5246","inReplyTo":"b0943d9e0608200343t517ec29dw2b6b49d9d69dbad5@mail.gmail.com","subject":"Re: [PATCH 2/2] Look for a commit's parents in the standard way.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-22T06:42:07Z","receivedAt":"2006-08-22T06:42:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n> On 14/08/06, Yann Dirson <ydirson@altern.org> wrote:\n>> This has the direct effect of taking info/grafts into account, since\n>> ignoring it only causes confusion.\n>\n> I don't know the difference but is there any between parsing the\n> commit file and using git-rev-list --parents?\n\nIf you mean parsing \"cat-file commit\" output vs \"rev-list\n--parents\" output, the former shows the true parents while the\nlatter shows a list of parents adjusted with information in the\ngrafts file.\n\nIf you are using pathspec then the latter further simplifies the\nparent list, but you know that already and you are not using\nthat form here.\n"},{"id":"26258","messageId":"20060903193650.GA4914@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"5246","inReplyTo":"b0943d9e0608200343t517ec29dw2b6b49d9d69dbad5@mail.gmail.com","subject":"Re: [PATCH 2/2] Look for a commit's parents in the standard way.","fromName":"Yann Dirson","fromEmail":"dwitch@nan92-1-81-57-214-146.fbx.proxad.net","sentAt":"2006-09-03T19:36:50Z","receivedAt":"2006-09-03T19:36:50Z","isPatch":true,"sender":{"key":"dwitch@nan92-1-81-57-214-146.fbx.proxad.net","avatar":null},"body":"On Sun, Aug 20, 2006 at 11:43:22AM +0100, Catalin Marinas wrote:\n> On 14/08/06, Yann Dirson <ydirson@altern.org> wrote:\n> >This has the direct effect of taking info/grafts into account, since\n> >ignoring it only causes confusion.\n> \n> I don't know the difference but is there any between parsing the\n> commit file and using git-rev-list --parents?\n\nYes, git-rev-list at least takes info/grafts into account.\n\n> >+        self.__parents = split(_output_lines('git-rev-list --parents \n> >--max-count=1 %s' % id_hash)[0])[1:]\n> \n> Instead of using the split() method, you could call\n> _output_lines('git-rev-list --parents --max-count=1 %s' %\n> id_hash)[0].split()[1:]. Maybe that's why they might deprecate the\n> global split method.\n\nAh, OK.\n\nBest regards,\n-- \nYann.\n\n-- \nVGER BF report: U 0.500235\n"}]}