On Thu, 28 Jan 2016 09:53:43 -0700
Jerry Snitselaar <[email protected]> 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).
> 

It appears you're right... I get the same with git 2.5.0.

Just ignore my comment then :)

> >  
> >>          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