mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Dave Airlie <airlied@gmail.com>, Dave Airlie <airlied@linux.ie>,
	dri-devel@lists.sf.net,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [git pull] drm-fixes
Date: Mon, 26 Jan 2009 14:19:50 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0901261411310.3465@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.00.0901261356150.3465@localhost.localdomain>



On Mon, 26 Jan 2009, Linus Torvalds wrote:
> > 
> > There must be easier ways to do so I think.
> 
> Um. Yes. Something like
> 
> 	git am -s -C1
> 
> which ends up requiring just a single line of context for the patch to 
> apply, exactly like the GNU 'patch' program.
> 
> The difference being that GNU patch does that incredibly broken thing by 
> default, and makes it easy to apply a patch that was already applied quite 
> by mistake, because it still works. Git will require you to say explicitly 
> that it's ok to have just a single line of context.

Btw, I _really_ don't want people using -C1 by default. It really is a 
broken default, and there is a reason why I dislike GNU patch for applying 
almost any patch that makes any sense what-so-ever.

So please work with the stricter git defaults. You can still get patches 
that silently apply even if they don't work (there's nothing magical about 
three lines of context - a patch may still apply in the wrong place), but 
it's a lot harder to get those silent screw-ups.

Then, when the strict model doesn't work, take a look by hand, and try to 
figure out why it didn't work. If you decide that you really do want to 
apply the patch, and the changes near-by that causes it to not apply any 
more were really not relevant and don't affect the behaviour of the patch, 
_that_ is when you can use -C1 and --whitespace=fix etc to make it apply 
despite not being a 100% match.

So don't use -C1 and whitespace-fixup blindly. That way lies madness. It 
may _seem_ to be much easier, and yes, 95% of the time it will do the 
right thing, but when it doesn't, it silently does bad things. Please only 
use those flags when you've literally spent a few seconds of a real human 
brain to look at why they are needed.

			Linus

  reply	other threads:[~2009-01-26 22:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  4:46 Dave Airlie
2009-01-26 18:23 ` Linus Torvalds
2009-01-26 21:44   ` Dave Airlie
2009-01-26 21:52     ` Sam Ravnborg
2009-01-26 22:08       ` Linus Torvalds
2009-01-26 22:19         ` Linus Torvalds [this message]
2009-01-26 22:38       ` Johannes Weiner
2009-02-23  0:15 Dave Airlie
2009-02-25  4:56 Dave Airlie
2009-08-04  3:45 Dave Airlie
2009-08-05  2:11 Dave Airlie
2009-10-28  1:32 Dave Airlie
2010-09-02  1:37 Dave Airlie
2011-01-24 23:19 Dave Airlie
2011-06-17  0:38 Dave Airlie
2011-12-24 17:43 Dave Airlie
2012-06-17  7:42 Dave Airlie
2012-06-17 19:46 ` Daniel Vetter

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=alpine.LFD.2.00.0901261411310.3465@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sf.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®