All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Zager <szager@google.com>
Cc: Chris Packham <judge.packham@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Make the global packed_git variable static to sha1_file.c.
Date: Wed, 12 Feb 2014 11:28:55 -0800	[thread overview]
Message-ID: <xmqq1tz8nn9k.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAHOQ7J-2BkQOr+_BF42ja4pWaUWkt8OC-YE0ETwHAYsmrubi=A@mail.gmail.com> (Stefan Zager's message of "Wed, 12 Feb 2014 10:26:22 -0800")

Stefan Zager <szager@google.com> writes:

> If anyone has a recommendation for a less labor-intensive way to do
> this in emacs, I'd be very grateful.

This is not "do this in emacs", but here is a possible approach.

You can ask "git diff" about what you changed, and actually apply
the change while fixing whitespace errors.  I.e.

	git diff sha1_file.c | git apply --cached --whitespace=fix
	git diff
	git checkout sha1_file.c

The first step will add a cleaned-up version to your index.

The second "diff" (optional) is to see what whitespace errors are
introduced when going from that cleaned-up version to what you have
in the working tree.

With the last step you would update the working tree version to the
cleaned-up version from the index.

	[alias]
	wsadd = "!sh -c 'git diff -- \"$@\" | git apply --cached --whitespace=fix;\
		git co -- ${1-.} \"$@\"' -"

  parent reply	other threads:[~2014-02-12 19:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12  1:57 [PATCH] Make the global packed_git variable static to sha1_file.c Stefan Zager
2014-02-12  7:29 ` Chris Packham
2014-02-12 18:26   ` Stefan Zager
2014-02-12 18:53     ` David Kastrup
2014-02-12 19:28     ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-13 23:09 szager

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=xmqq1tz8nn9k.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=judge.packham@gmail.com \
    --cc=szager@google.com \
    /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.