git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: git@vger.kernel.org, "Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH 7/9] Reinstate the --annotate option for refresh
Date: Tue, 28 Apr 2009 16:10:14 +0100	[thread overview]
Message-ID: <20090428151014.27261.18502.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20090428150742.27261.19620.stgit@pc1117.cambridge.arm.com>

It is sometimes useful to add some notes to the log entry when a patch
was refreshed. This option was dropped when the command was updated to
the new infrastructure as there was no logging support at that time.

The note will be visible with 'stg log {-g,-f}'

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
 stgit/commands/refresh.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py
index 5a5f979..c5a0aeb 100644
--- a/stgit/commands/refresh.py
+++ b/stgit/commands/refresh.py
@@ -61,6 +61,8 @@ options = [
         short = 'Refresh (applied) PATCH instead of the top patch'),
     opt('-e', '--edit', action = 'store_true',
         short = 'Invoke an editor for the patch description'),
+    opt('-a', '--annotate', metavar = 'NOTE',
+        short = 'Annotate the patch log entry')
     ] + (argparse.message_options(save_template = False) +
          argparse.sign_options() + argparse.author_options())
 
@@ -200,9 +202,13 @@ def absorb_unapplied(trans, iw, patch_name, temp_name, edit_fun):
         # leave the temp patch for the user.
         return False
 
-def absorb(stack, patch_name, temp_name, edit_fun):
+def absorb(stack, patch_name, temp_name, edit_fun, annotate = None):
     """Absorb the temp patch into the target patch."""
-    trans = transaction.StackTransaction(stack, 'refresh')
+    if annotate:
+        log_msg = 'refresh\n\n' + annotate
+    else:
+        log_msg = 'refresh'
+    trans = transaction.StackTransaction(stack, log_msg)
     iw = stack.repository.default_iw
     f = { True: absorb_applied, False: absorb_unapplied
           }[patch_name in trans.applied]
@@ -252,4 +258,5 @@ def func(parser, options, args):
                 diff_flags = [], replacement_diff = None)
             assert not failed_diff
         return cd
-    return absorb(stack, patch_name, temp_name, edit_fun)
+    return absorb(stack, patch_name, temp_name, edit_fun,
+                  annotate = options.annotate)

  parent reply	other threads:[~2009-04-28 15:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 15:09 [StGit PATCH 0/9] Various StGit updates Catalin Marinas
2009-04-28 15:09 ` [StGit PATCH 1/9] Show "Pushing <patch>...done" when pushing a patch Catalin Marinas
2009-04-29  6:04   ` Karl Hasselström
2009-04-28 15:09 ` [StGit PATCH 2/9] Show some progress information when checking for upstream merges Catalin Marinas
2009-04-29  6:07   ` Karl Hasselström
2009-04-28 15:09 ` [StGit PATCH 3/9] Do not sleep after the last patch sent by e-mail Catalin Marinas
2009-04-29  6:13   ` Karl Hasselström
2009-04-28 15:09 ` [StGit PATCH 4/9] Convert 'clone' to the use stgit.lib Catalin Marinas
2009-04-29  6:21   ` Karl Hasselström
2009-05-13 16:10     ` Catalin Marinas
2009-04-28 15:10 ` [StGit PATCH 5/9] Convert 'hide' to the lib infrastructure Catalin Marinas
2009-04-29  6:27   ` Karl Hasselström
2009-05-13 16:08     ` Catalin Marinas
2009-04-28 15:10 ` [StGit PATCH 6/9] Convert 'unhide' " Catalin Marinas
2009-04-29  6:29   ` Karl Hasselström
2009-04-28 15:10 ` Catalin Marinas [this message]
2009-04-29  6:33   ` [StGit PATCH 7/9] Reinstate the --annotate option for refresh Karl Hasselström
2009-04-28 15:10 ` [StGit PATCH 8/9] Add the log --clear option Catalin Marinas
2009-04-29  6:35   ` Karl Hasselström
2009-04-28 15:10 ` [StGit PATCH 9/9] Use the default git colouring scheme rather than specific scripts Catalin Marinas
2009-04-29  6:43   ` Karl Hasselström
2009-04-29 11:48     ` Samuel Tardieu
2009-04-29 11:56       ` Samuel Tardieu
2009-04-29 14:25       ` Karl Hasselström
2009-05-04 12:48   ` Shinya Kuribayashi
2009-05-29 12:22     ` Catalin Marinas
2009-05-30  0:36       ` Shinya Kuribayashi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090428151014.27261.18502.stgit@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).