On Thu, 28 Jan 2016 10:07:20 -0700
Jerry Snitselaar <[email protected]> wrote:

> On Thu Jan 28 16, Jerry Snitselaar wrote:
> >On Thu Jan 28 16, Greg Kurz wrote:  
> >>On Wed, 27 Jan 2016 20:25:25 -0700
> >>Jerry Snitselaar <[email protected]> wrote:
> >>  
> >>>Currently if you pick a commit using the expose option it
> >>>appends the imported from commit line immediately after
> >>>what it gets for the log without inserting a new line.
> >>>This can result in the imported from commit line being
> >>>tagged on to the end of a Signed-off-by: line or something
> >>>else. I ran into this while doing some backporting of
> >>>kernel commits at work.
> >>>
> >>>Insert a new line before the imported from commit
> >>>data.
> >>>
> >>>Signed-off-by: Jerry Snitselaar <[email protected]>
> >>>---
> >>> stgit/commands/pick.py | 2 +-
> >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>>diff --git a/stgit/commands/pick.py b/stgit/commands/pick.py
> >>>index df9d798..e3a4ef3 100644
> >>>--- a/stgit/commands/pick.py
> >>>+++ b/stgit/commands/pick.py
> >>>@@ -117,7 +117,7 @@ def __pick_commit(commit_id, patchname, options):
> >>>             message = 'Revert "%s"\n\nThis reverts commit %s.\n\n%s\n' \
> >>>                     % (subject, commit.get_id_hash(), body)
> >>>         elif options.expose:
> >>>-            message += '(imported from commit %s)\n' % 
> >>>commit.get_id_hash()
> >>>+            message += '\n(imported from commit %s)\n' % 
> >>>commit.get_id_hash()  
> >>
> >>Just a thought: maybe you can add \n only if not message.endswith('\n') ?  
> >
> >I can switch it to something like:
> >
> >             if not message.endswith('\n'):
> >                     message += '\n'
> >             message += '(imported from ....
> >
> >Playing around right now it looks like a feature of git that the commit
> >log is always going to have this condition (using git 2.7.0 here).
> >  
> 
> or the code pulling the log message from git
> 

Your previous patch is very simple and does the job.

Reviewed-by: Greg Kurz <[email protected]>

I had lazily switched to doing 'git cherry-pick -x' followed by
'stg repair' because of that... now I'll go back to 'stg pick' :)

Thanks !

> >>  
> >>>         author_name, author_email, author_date = \
> >>>                      name_email_date(commit.get_author())
> >>>         if options.revert:  
> >>  
> 


_______________________________________________
stgit-users mailing list
[email protected]
https://mail.gna.org/listinfo/stgit-users

Reply via email to