Skip to contentSkip to conversation

Rebase/line wrap question

DISCUSSION Elizabeth Ferdman 3 participants 5 messages Sep 28, 2016 – Sep 29, 2016

lore
Share & tools
lore
#0 lore raw

Hey Alison,

I received some feedback from Greg that I want
to fix and I have a bunch of questions. The plus side is that maybe some of the answers could go into the tutorial.

First he said "please wrap your changelog comments at 72 columns."

Is this something I add to my .vimrc? I've been using "git commit -m". Is that causing the issue? I thought git commit messages were supposed to be less than 50 chars anyway. I'm confused.

The other issue was that my commit didn't apply to his tree. He says please rebase and resend. I think I need to do:

$ git fetch origin
$ git rebase origin/staging-testing
Then reformat the patch?
$ git format-patch -o ~/mypatches/ HEAD^
$ mutt -H <file>

So I don't need to uncommit/recommit?

Thanks,
Liz

#1 lore raw
Quoted 11 lines · Elizabeth Ferdman

Hey Alison,

I received some feedback from Greg that I want
to fix and I have a bunch of questions. The plus side is that maybe some of the answers could go into the tutorial.

First he said "please wrap your changelog comments at 72 columns."

Is this something I add to my .vimrc? I've been using "git commit -m". Is that causing the issue? I thought git commit messages were supposed to be less than 50 chars anyway. I'm confused.

"commit message" is that one line message in your Subject line and it needs to fit in 80chars. The tutorial tells you about using git with git log --pretty=oneline --abbrev-commit' to see style used for that particular file/subsystem.

"changelog" is the next section in the body of the patch. I saw Greg's message yesterday, and I went off and looked at that a bit. I think I always dodge that just by luck and the way I visually like to line things up. I googled a bit and see lots of little widgets for
linewrapping text to a certain column size. Don't know how to
integrate any of those with git commit editing. Maybe someone else here does.

w.r.t. using "git commit -m" - just curious why you are not doing "git commint -s -v" per the tutorial?

Quoted 4 lines

The other issue was that my commit didn't apply to his tree. He says please rebase and resend. I think I need to do:

assuming you are in your staging tree

Quoted 2 lines
$ git fetch origin
$ git rebase origin/staging-testing

When this happens git will try to place any commits it finds in your tree on top of all the stuff it grabbed from greg. If it doesn't apply nicely, it will give you message to repair.

Quoted 1 line

Then reformat the patch?

Caveat - if the rebase failed and you had to tweak your patch, then you may end up needing to git commit --amend -v to update your changelog.

Quoted 4 lines
$ git format-patch -o ~/mypatches/ HEAD^
$ mutt -H <file>

So I don't need to uncommit/recommit?

No, that git rebase does that for you.

Another aside: Whenever Greg sends out a message that he's caught up on patches, that's certainly a time to rebase. Also, it could be part of your daily routine, to make sure you on "top" each day before you start working on your patches.

Hope that gets you further along,
alisons

Quoted 4 lines

Thanks,
Liz

#2 lore raw
Quoted 26 lines · Alison Schofield
Quoted 11 lines · Elizabeth Ferdman

Hey Alison,

I received some feedback from Greg that I want
to fix and I have a bunch of questions. The plus side is that maybe some of the answers could go into the tutorial.

First he said "please wrap your changelog comments at 72 columns."

Is this something I add to my .vimrc? I've been using "git commit -m". Is that causing the issue? I thought git commit messages were supposed to be less than 50 chars anyway. I'm confused.

"commit message" is that one line message in your Subject line and it needs to fit in 80chars. The tutorial tells you about using git with git log --pretty=oneline --abbrev-commit' to see style used for that particular file/subsystem.

"changelog" is the next section in the body of the patch. I saw Greg's message yesterday, and I went off and looked at that a bit. I think I always dodge that just by luck and the way I visually like to line things up. I googled a bit and see lots of little widgets for
linewrapping text to a certain column size. Don't know how to
integrate any of those with git commit editing. Maybe someone else here does.

Quoted 2 lines

w.r.t. using "git commit -m" - just curious why you are not doing "git commint -s -v" per the tutorial?

I meant to say that I have been doing "git commit -s -v -m <msg>" But I just realized that was pointless and just causing me more work.

Quoted 12 lines
Quoted 4 lines

The other issue was that my commit didn't apply to his tree. He says please rebase and resend. I think I need to do:

assuming you are in your staging tree

Quoted 2 lines
$ git fetch origin
$ git rebase origin/staging-testing

When this happens git will try to place any commits it finds in your tree on top of all the stuff it grabbed from greg. If it doesn't apply nicely, it will give you message to repair.

Quoted 6 lines
Quoted 1 line

Then reformat the patch?

Caveat - if the rebase failed and you had to tweak your patch, then you may end up needing to git commit --amend -v to update your changelog.

got it, thanks!

Quoted 11 lines
Quoted 4 lines
$ git format-patch -o ~/mypatches/ HEAD^
$ mutt -H <file>

So I don't need to uncommit/recommit?

No, that git rebase does that for you.

Another aside: Whenever Greg sends out a message that he's caught up on patches, that's certainly a time to rebase. Also, it could be part of your daily routine, to make sure you on "top" each day before you start working on your patches.

yes, I had a feeling I should've been rebasing more often but the tutorial didn't explicitly say that. When we say "rebase" should you always assume that we're doing both of these commands?

$ git fetch origin 
$ git rebase origin/staging-testing

And would it also be a good idea to actually do those 2 before sending the patch...?

Quoted 3 lines

Hope that gets you further along,
alisons

Thanks so much for all your help.
Liz

Quoted 4 lines
Quoted 4 lines

Thanks,
Liz

#3 lore raw
Quoted 62 lines · Elizabeth Ferdman
Quoted 26 lines · Alison Schofield
Quoted 11 lines · Elizabeth Ferdman

Hey Alison,

I received some feedback from Greg that I want
to fix and I have a bunch of questions. The plus side is that maybe some of the answers could go into the tutorial.

First he said "please wrap your changelog comments at 72 columns."

Is this something I add to my .vimrc? I've been using "git commit -m". Is that causing the issue? I thought git commit messages were supposed to be less than 50 chars anyway. I'm confused.

"commit message" is that one line message in your Subject line and it needs to fit in 80chars. The tutorial tells you about using git with git log --pretty=oneline --abbrev-commit' to see style used for that particular file/subsystem.

"changelog" is the next section in the body of the patch. I saw Greg's message yesterday, and I went off and looked at that a bit. I think I always dodge that just by luck and the way I visually like to line things up. I googled a bit and see lots of little widgets for
linewrapping text to a certain column size. Don't know how to
integrate any of those with git commit editing. Maybe someone else here does.

Quoted 2 lines

w.r.t. using "git commit -m" - just curious why you are not doing "git commint -s -v" per the tutorial?

I meant to say that I have been doing "git commit -s -v -m <msg>" But I just realized that was pointless and just causing me more work.

Quoted 12 lines
Quoted 4 lines

The other issue was that my commit didn't apply to his tree. He says please rebase and resend. I think I need to do:

assuming you are in your staging tree

Quoted 2 lines
$ git fetch origin
$ git rebase origin/staging-testing

When this happens git will try to place any commits it finds in your tree on top of all the stuff it grabbed from greg. If it doesn't apply nicely, it will give you message to repair.

Quoted 6 lines
Quoted 1 line

Then reformat the patch?

Caveat - if the rebase failed and you had to tweak your patch, then you may end up needing to git commit --amend -v to update your changelog.

got it, thanks!

Quoted 11 lines
Quoted 4 lines
$ git format-patch -o ~/mypatches/ HEAD^
$ mutt -H <file>

So I don't need to uncommit/recommit?

No, that git rebase does that for you.

Another aside: Whenever Greg sends out a message that he's caught up on patches, that's certainly a time to rebase. Also, it could be part of your daily routine, to make sure you on "top" each day before you start working on your patches.

Quoted 5 lines

yes, I had a feeling I should've been rebasing more often but the tutorial didn't explicitly say that. When we say "rebase" should you always assume that we're doing both of these commands?

$ git fetch origin 
$ git rebase origin/staging-testing

That a Yes, from me, because I still follow the routines I learned in that first patch tutorial. I've seen other methods, but I keep doing this simple method that works for me.

Quoted 3 lines

And would it also be a good idea to actually do those 2 before sending the patch...?

Yes.

Quoted 10 lines
Quoted 4 lines

Hope that gets you further along,
alisons

Thanks so much for all your help.
Liz

Quoted 4 lines
Quoted 4 lines

Thanks,
Liz

#4 lore raw
In reply to Elizabeth Ferdman
Quoted 12 lines · Elizabeth Ferdman

Hey Alison,

I received some feedback from Greg that I want
to fix and I have a bunch of questions. The plus side is that maybe some of the answers could go into the tutorial.

First he said "please wrap your changelog comments at 72 columns."

Is this something I add to my .vimrc? I've been using "git commit -m". Is that causing the issue? I thought git commit messages were supposed to be less than 50 chars anyway. I'm confused.

Quoted 6 lines

The other issue was that my commit didn't apply to his tree. He says please rebase and resend. I think I need to do:

$ git fetch origin
$ git rebase origin/staging-testing
Then reformat the patch?

If you use 'git rebase -i origin/staging-testing' you will get the option to reformat/rewrite the commit message for the patch (it will be one of the options for the list of commits, see the git rebase documentation for details).

That's what I use when I have to rebase and edit things up, saves you a step or two.

hope this helps,

greg k-h