Re: [PATCH] Make the global packed_git variable static to sha1_file.c.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Zager <szager@xxxxxxxxxx> 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-.} \"$@\"' -"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]