All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Tobin C. Harding" <me@tobin.cc>
Cc: kernelnewbies@kernelnewbies.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: git pull
Date: Tue, 14 Nov 2017 12:05:00 +0100	[thread overview]
Message-ID: <20171114110500.GA21175@kroah.com> (raw)
In-Reply-To: <20171113231155.GA26779@eros>

Adding lkml and linux-doc mailing lists...

On Tue, Nov 14, 2017 at 10:11:55AM +1100, Tobin C. Harding wrote:
> Hi Greg,
> 
> This is totally asking a favour, feel free to ignore. How do you format
> your [GIT PULL] emails to Linus? Do you create a tag and then run a git
> command to get the email?
> 
> I tried to do it manually and failed pretty hard (as you no doubt will
> notice on LKML).

Well, I think you got it right the third time, so nice job :)

Anyway, this actually came up at the kernel summit / maintainer meeting
a few weeks ago, in that "how do I make a good pull request to Linus" is
something we need to document.

Here's what I do, and it seems to work well, so maybe we should turn it
into the start of the documentation for how to do it.

-----------

To start with, put your changes on a branch, hopefully one named in a
semi-useful way (I use 'char-misc-next' for my char/misc driver patches
to be merged into linux-next).  That is the branch you wish to tag and
have Linus pull from.

Name the tag with something useful that you can understand if you run
across it in a few weeks, and something that will be "unique".
Continuing the example of my char-misc tree, for the patches to be sent
to Linus for the 4.15-rc1 merge window, I would name the tag
'char-misc-4.15-rc1':
	git tag -u KEY_ID -s char-misc-4.15-rc1 char-misc-next

that will create a signed tag called 'char-misc-4.15-rc1' based on the
last commit in the char-misc-next branch, and sign it with my gpg key
KEY_ID (replace KEY_ID with your own gpg key id.)

When you run the above command, git will drop you into an editor and ask
you to describe the tag.  In this case, you are describing a pull
request, so outline what is contained here, why it should be merged, and
what, if any, testing has happened to it.  All of this information will
end up in the tag itself, and then in the merge commit that Linus makes,
so write it up well, as it will be in the kernel tree for forever.

An example pull request of mine might look like:
	Char/Misc patches for 4.15-rc1

	Here is the big char/misc patch set for the 4.15-rc1 merge
	window.  Contained in here is the normal set of new functions
	added to all of these crazy drivers, as well as the following
	brand new subsystems:
		- time_travel_controller: Finally a set of drivers for
		  the latest time travel bus architecture that provides
		  i/o to the CPU before it asked for it, allowing
		  uninterrupted processing
		- relativity_shifters: due to the affect that the
		  time_travel_controllers have on the overall system,
		  there was a need for a new set of relativity shifter
		  drivers to accommodate the newly formed black holes
		  that would threaten to suck CPUs into them.  This
		  subsystem handles this in a way to successfully
		  neutralize the problems.  There is a Kconfig option to
		  force these to be enabled when needed, so problems
		  should not occur.

	All of these patches have been successfully tested in the latest
	linux-next releases, and the original problems that it found
	have all been resolved (apologies to anyone living near Canberra
	for the lack of the Kconfig options in the earlier versions of
	the linux-next tree creations.)

	Signed-off-by: Your-name-here <your_email@domain>


The tag message format is just like a git commit id.  One line at the
top for a "summary subject" and be sure to sign-off at the bottom.

Now that you have a local signed tag, you need to push it up to where it
can be retrieved by others:
	git push origin char-misc-4.15-rc1
pushes the char-misc-4.15-rc1 tag to where the 'origin' repo is located.

The last thing to do is create the pull request message.  Git handily
will do this for you with the 'git request-pull' command, but it needs a
bit of help determining what you want to pull, and what to base the pull
against (to show the correct changes to be pulled and the diffstat.)

I use the following command to generate a pull request:
	git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-4.15-rc1

This is asking git to compare the difference from the
'char-misc-4.15-rc1' tag location, to the head of the 'master' branch
(which in my case points to the last location in Linus's tree that I
diverged from, usually a -rc release) and to use the git:// protocol to
pull from.  If you wish to use https://, that can be used here instead
as well (but note that some people behind firewalls will have problems
with https git pulls).

If the char-misc-4.15-rc1 tag is not present in the repo that I am
asking to be pulled from, git will complain saying it is not there, a
handy way to remember to actually push it to a public location.

The output of 'git request-pull' will contain the location of the git
tree and specific tag to pull from, and the full text description of
that tag (which is why you need to provide good information in that
tag.)  It will also create a diffstat of the pull request, and a
shortlog of the individual commits that the pull request will provide.

-----------

Does all of that make sense?  Anything I can explain better?

It's just 3 commands to do to create the tag, push it out, and create a
pull request text to put in an email.  I have a simple script that I use
for this task to output to my console these 3 commands, based on what
kernel tree I am currently in, and what branch I am on.  You can find
that script at:
	https://github.com/gregkh/gregkh-linux/blob/master/work/pull_request
if you wish to laugh at my horrid perl skills :)

Hope this helps,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: kernelnewbies@lists.kernelnewbies.org
Subject: git pull
Date: Tue, 14 Nov 2017 12:05:00 +0100	[thread overview]
Message-ID: <20171114110500.GA21175@kroah.com> (raw)
In-Reply-To: <20171113231155.GA26779@eros>

Adding lkml and linux-doc mailing lists...

On Tue, Nov 14, 2017 at 10:11:55AM +1100, Tobin C. Harding wrote:
> Hi Greg,
> 
> This is totally asking a favour, feel free to ignore. How do you format
> your [GIT PULL] emails to Linus? Do you create a tag and then run a git
> command to get the email?
> 
> I tried to do it manually and failed pretty hard (as you no doubt will
> notice on LKML).

Well, I think you got it right the third time, so nice job :)

Anyway, this actually came up at the kernel summit / maintainer meeting
a few weeks ago, in that "how do I make a good pull request to Linus" is
something we need to document.

Here's what I do, and it seems to work well, so maybe we should turn it
into the start of the documentation for how to do it.

-----------

To start with, put your changes on a branch, hopefully one named in a
semi-useful way (I use 'char-misc-next' for my char/misc driver patches
to be merged into linux-next).  That is the branch you wish to tag and
have Linus pull from.

Name the tag with something useful that you can understand if you run
across it in a few weeks, and something that will be "unique".
Continuing the example of my char-misc tree, for the patches to be sent
to Linus for the 4.15-rc1 merge window, I would name the tag
'char-misc-4.15-rc1':
	git tag -u KEY_ID -s char-misc-4.15-rc1 char-misc-next

that will create a signed tag called 'char-misc-4.15-rc1' based on the
last commit in the char-misc-next branch, and sign it with my gpg key
KEY_ID (replace KEY_ID with your own gpg key id.)

When you run the above command, git will drop you into an editor and ask
you to describe the tag.  In this case, you are describing a pull
request, so outline what is contained here, why it should be merged, and
what, if any, testing has happened to it.  All of this information will
end up in the tag itself, and then in the merge commit that Linus makes,
so write it up well, as it will be in the kernel tree for forever.

An example pull request of mine might look like:
	Char/Misc patches for 4.15-rc1

	Here is the big char/misc patch set for the 4.15-rc1 merge
	window.  Contained in here is the normal set of new functions
	added to all of these crazy drivers, as well as the following
	brand new subsystems:
		- time_travel_controller: Finally a set of drivers for
		  the latest time travel bus architecture that provides
		  i/o to the CPU before it asked for it, allowing
		  uninterrupted processing
		- relativity_shifters: due to the affect that the
		  time_travel_controllers have on the overall system,
		  there was a need for a new set of relativity shifter
		  drivers to accommodate the newly formed black holes
		  that would threaten to suck CPUs into them.  This
		  subsystem handles this in a way to successfully
		  neutralize the problems.  There is a Kconfig option to
		  force these to be enabled when needed, so problems
		  should not occur.

	All of these patches have been successfully tested in the latest
	linux-next releases, and the original problems that it found
	have all been resolved (apologies to anyone living near Canberra
	for the lack of the Kconfig options in the earlier versions of
	the linux-next tree creations.)

	Signed-off-by: Your-name-here <your_email@domain>


The tag message format is just like a git commit id.  One line at the
top for a "summary subject" and be sure to sign-off at the bottom.

Now that you have a local signed tag, you need to push it up to where it
can be retrieved by others:
	git push origin char-misc-4.15-rc1
pushes the char-misc-4.15-rc1 tag to where the 'origin' repo is located.

The last thing to do is create the pull request message.  Git handily
will do this for you with the 'git request-pull' command, but it needs a
bit of help determining what you want to pull, and what to base the pull
against (to show the correct changes to be pulled and the diffstat.)

I use the following command to generate a pull request:
	git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-4.15-rc1

This is asking git to compare the difference from the
'char-misc-4.15-rc1' tag location, to the head of the 'master' branch
(which in my case points to the last location in Linus's tree that I
diverged from, usually a -rc release) and to use the git:// protocol to
pull from.  If you wish to use https://, that can be used here instead
as well (but note that some people behind firewalls will have problems
with https git pulls).

If the char-misc-4.15-rc1 tag is not present in the repo that I am
asking to be pulled from, git will complain saying it is not there, a
handy way to remember to actually push it to a public location.

The output of 'git request-pull' will contain the location of the git
tree and specific tag to pull from, and the full text description of
that tag (which is why you need to provide good information in that
tag.)  It will also create a diffstat of the pull request, and a
shortlog of the individual commits that the pull request will provide.

-----------

Does all of that make sense?  Anything I can explain better?

It's just 3 commands to do to create the tag, push it out, and create a
pull request text to put in an email.  I have a simple script that I use
for this task to output to my console these 3 commands, based on what
kernel tree I am currently in, and what branch I am on.  You can find
that script at:
	https://github.com/gregkh/gregkh-linux/blob/master/work/pull_request
if you wish to laugh at my horrid perl skills :)

Hope this helps,

greg k-h

  reply	other threads:[~2017-11-14 11:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 23:11 git pull Tobin C. Harding
2017-11-14 11:05 ` Greg Kroah-Hartman [this message]
2017-11-14 11:05   ` Greg Kroah-Hartman
2017-11-14 12:00   ` Ulf Hansson
2017-11-14 12:00     ` Ulf Hansson
2017-11-14 12:09     ` Greg Kroah-Hartman
2017-11-14 12:09       ` Greg Kroah-Hartman
2017-11-14 18:04   ` Linus Torvalds
2017-11-14 18:04     ` Linus Torvalds
2017-11-14 21:33   ` Tobin C. Harding
2017-11-14 21:33     ` Tobin C. Harding
2017-11-14 21:46     ` Linus Torvalds
2017-11-14 21:46       ` Linus Torvalds
2017-11-15 10:51       ` Michael Ellerman
2017-11-15 10:51         ` Michael Ellerman
2017-11-16 20:36       ` Linus Torvalds
2017-11-16 20:36         ` Linus Torvalds
2017-11-20  5:37         ` Junio C Hamano
2017-11-20  6:04           ` Linus Torvalds
2017-11-14 21:42   ` Tobin C. Harding
2017-11-14 21:42     ` Tobin C. Harding
  -- strict thread matches above, loose matches on Subject: below --
2012-04-12 14:47 GIT pull cvalusek
2012-04-12 15:03 ` Matthieu Moy
2012-04-12 15:07   ` Michael Witten
2012-04-12 16:58 ` Johannes Sixt
2012-04-12 17:29 ` cvalusek
2010-05-17 21:51 git pull matteo brutti
2010-05-18 16:31 ` Nicolas Sebrecht
2010-05-19 11:03 ` hasen j
2010-01-19  8:01 robin
2010-01-19  8:09 ` robin
2010-01-19 18:37   ` Paul Wilson
2010-01-23  7:22     ` Khem Raj
2010-01-19 20:13   ` Bjørn Forsman

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=20171114110500.GA21175@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@tobin.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.