git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How do I apply a single "change"
@ 2006-01-08  0:31 Luben Tuikov
  2006-01-08  0:38 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Luben Tuikov @ 2006-01-08  0:31 UTC (permalink / raw)
  To: git

Forgive me for the _incredibly stupid questions_,
but how do I apply a single "change", identified
by its SHA?  Either from one branch to the other or
remote?

I.e. I want to "integrate" only that change?

Alternatively, how do I apply the absolute output of
"git-format-patch".  I tried but whatever I tried with
complained that it couldn't find any email addressess.
(roll eyes here)

Thanks for the help,
   Luben

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I apply a single "change"
  2006-01-08  0:31 How do I apply a single "change" Luben Tuikov
@ 2006-01-08  0:38 ` Junio C Hamano
  2006-01-08  0:51   ` Luben Tuikov
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2006-01-08  0:38 UTC (permalink / raw)
  To: ltuikov; +Cc: git

Luben Tuikov <ltuikov@yahoo.com> writes:

> ... how do I apply a single "change", identified
> by its SHA?  Either from one branch to the other or
> remote?
>
> I.e. I want to "integrate" only that change?

$ git-cherry-pick $object_name

> Alternatively, how do I apply the absolute output of
> "git-format-patch".  I tried but whatever I tried with
> complained that it couldn't find any email addressess.
> (roll eyes here)

It is unclear what you mean by absolute output, but here is what
I regularly do:

$ git-format-patch -k -m --stdout from to | git am -3 -k

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I apply a single "change"
  2006-01-08  0:38 ` Junio C Hamano
@ 2006-01-08  0:51   ` Luben Tuikov
  2006-01-08  1:19     ` Andreas Ericsson
  0 siblings, 1 reply; 5+ messages in thread
From: Luben Tuikov @ 2006-01-08  0:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

--- Junio C Hamano <junkio@cox.net> wrote:

> Luben Tuikov <ltuikov@yahoo.com> writes:
> 
> > ... how do I apply a single "change", identified
> > by its SHA?  Either from one branch to the other or
> > remote?
> >
> > I.e. I want to "integrate" only that change?
> 
> $ git-cherry-pick $object_name

Ok, so git searches the db (other branches, etc) and
does the job.  This worked for me.

How will I do this same thing but if the "change" is
on a remote repository?

> > Alternatively, how do I apply the absolute output of
> > "git-format-patch".  I tried but whatever I tried with
> > complained that it couldn't find any email addressess.
> > (roll eyes here)
> 
> It is unclear what you mean by absolute output, but here is what
> I regularly do:
> 
> $ git-format-patch -k -m --stdout from to | git am -3 -k

I did 
$ git-format-patch commit^ commit

and the usual 0001-blah-blah file got created.  Then
I tried to apply it, but whatever I tried it complained.
Will "git-am -3 -k" work without complaining there is
no "email field" or something?  (I cannot try it as
git-cherry-pick worked for me already.)

Thanks,
   Lunen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I apply a single "change"
  2006-01-08  0:51   ` Luben Tuikov
@ 2006-01-08  1:19     ` Andreas Ericsson
  2006-01-08  2:24       ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Ericsson @ 2006-01-08  1:19 UTC (permalink / raw)
  To: ltuikov; +Cc: Junio C Hamano, git

Luben Tuikov wrote:
> --- Junio C Hamano <junkio@cox.net> wrote:
>>
>>$ git-cherry-pick $object_name
> 
> 
> Ok, so git searches the db (other branches, etc) and
> does the job.  This worked for me.
> 
> How will I do this same thing but if the "change" is
> on a remote repository?
> 

You can't. cherry-pick doesn't work on remote repos, so you need to pull 
that branch to a local one first.

> 
>>>Alternatively, how do I apply the absolute output of
>>>"git-format-patch".  I tried but whatever I tried with
>>>complained that it couldn't find any email addressess.
>>>(roll eyes here)
>>
>>It is unclear what you mean by absolute output, but here is what
>>I regularly do:
>>
>>$ git-format-patch -k -m --stdout from to | git am -3 -k
> 
> 
> I did 
> $ git-format-patch commit^ commit
> 
> and the usual 0001-blah-blah file got created.  Then
> I tried to apply it, but whatever I tried it complained.
> Will "git-am -3 -k" work without complaining there is
> no "email field" or something?  (I cannot try it as
> git-cherry-pick worked for me already.)
> 

You need to specify the '--mbox' (or '-m') for git-format-patch, 
otherwise it can't find author-info in the generated patch and it won't 
know who committed what.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I apply a single "change"
  2006-01-08  1:19     ` Andreas Ericsson
@ 2006-01-08  2:24       ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2006-01-08  2:24 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: ltuikov, Junio C Hamano, git



On Sun, 8 Jan 2006, Andreas Ericsson wrote:
> 
> You can't. cherry-pick doesn't work on remote repos, so you need to pull that
> branch to a local one first.

"fetch", not "pull".

It's easy enough to get confused anyway, so we should be careful.

		Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-01-08  2:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-08  0:31 How do I apply a single "change" Luben Tuikov
2006-01-08  0:38 ` Junio C Hamano
2006-01-08  0:51   ` Luben Tuikov
2006-01-08  1:19     ` Andreas Ericsson
2006-01-08  2:24       ` Linus Torvalds

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