git/list[1] front-page[2] threads[3] people[4] search[5] about
 

"git revert" (Re: pci_update_resource() getting called on sparc64)

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 8, 2005, 19:57 UTC
Message-ID
<Pine.LNX.4.58.0508081257190.3258@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0508081249110.3258@g5.osdl.org>
Comments?
		Linus
On Mon, 8 Aug 2005, Linus Torvalds wrote:
Show 27 quoted lines
> 
> 
> On Mon, 8 Aug 2005, Greg KH wrote:
> > 
> > Hm, how do you revert a git patch?
> 
> Something like this?
> 
> 	#!/bin/sh
> 	. git-sh-setup-script || die "Not a git archive"
> 	rev=$(git-rev-parse --verify --revs-only "$@") || exit
> 	git-diff-tree -R -p $rev | git-apply --index &&
> 		echo "Revert $rev" | git commit
> 
> Just name it "git-revert-script" and it might do what you want to do.
> 
> It may not have the nicest error messages: if you try to revert a merge
> (which won't have a diff), git-apply will say something like
> 
> 	fatal: No changes
> 
> which isn't exactly being helpful. And the revert message could be made 
> more interesting (like putting the first line of the description of what 
> we reverted into the message instead of just the revision number).
> 
> 		Linus
> 
Next: Junio C Hamano
Message 1 of 12 in “"git revert" (Re: pci_update_resource() getting called on sparc64)”
  1. Linus TorvaldsAug 8, 2005
  2. Junio C HamanoAug 8, 2005
  3. Linus TorvaldsAug 8, 2005
  4. Junio C HamanoAug 8, 2005
  5. git-commit-script, was Re: "git revert" (Re: pci_update_resource() getting called on sparc64)Johannes Schindelin, Aug 8, 2005
  6. Junio C HamanoAug 8, 2005
  7. Linus TorvaldsAug 8, 2005
  8. Junio C HamanoAug 8, 2005
  9. Linus TorvaldsAug 8, 2005
  10. Junio C HamanoAug 8, 2005
  11. Johannes SchindelinAug 9, 2005
  12. Johannes SchindelinAug 9, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.