chiark / gitweb /
Add the '--expose' option to 'pick'
authorCatalin Marinas <catalin.marinas@gmail.com>
Mon, 16 Jul 2007 22:48:31 +0000 (23:48 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 16 Jul 2007 22:48:31 +0000 (23:48 +0100)
This option is similar to the '-x' one of the git-cherry-pick
command (maybe the naming is not really obvious). It appends the
imported commit id to the patch log.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/pick.py

index 20ecd02ae719d1f559c4517a9b7bc7bff454f2b5..27fdf9cd516858b64746bcd31e5451a9f17d96d6 100644 (file)
@@ -40,6 +40,9 @@ options = [make_option('-n', '--name',
                        action = 'store_true'),
            make_option('-p', '--parent', metavar = 'COMMITID',
                        help = 'use COMMITID as parent'),
+           make_option('-x', '--expose',
+                       help = 'append the imported commit id to the patch log',
+                       action = 'store_true'),
            make_option('--fold',
                        help = 'fold the commit object into the current patch',
                        action = 'store_true'),
@@ -111,6 +114,8 @@ def func(parser, options, args):
         out.done()
     else:
         message = commit.get_log()
+        if options.expose:
+            message += '(imported from commit %s)\n' % commit.get_id_hash()
         author_name, author_email, author_date = \
                      name_email_date(commit.get_author())