You can unstage a change using 'git reset', e.g. 'git reset utils/haddock'.
As part of an interactive rebase, my approach would be to 'edit' the commit in question, then use 'git reset HEAD^' to undo that commit but keep the changes in your working directory (but unstaged), then either stage the changes you do want to keep using 'git add', or stage everything using 'git add -A' and then unstage the haddock change with 'git reset utils/haddock', followed finally by creating a new commit and continuing the rebase.
Hope this helps.


-Nathan

On Fri, Sep 30, 2016 at 12:21 PM, Simon Peyton Jones via ghc-devs <ghc-devs@haskell.org> wrote:

Ah yes, but it had a lot of OTHER stuff that I wanted. It was only the accidental change to a submodule that I wanted to kill off.

 

From: Harendra Kumar [mailto:harendra.kumar@gmail.com]
Sent: 30 September 2016 12:20
To: Simon Peyton Jones <simonpj@microsoft.com>
Cc: Edward Z. Yang <ezyang@mit.edu>; ghc-devs <ghc-devs@haskell.org>
Subject: Re: git question

 

When you do 'git rebase -i', to exclude the commit you can just delete that commit from the list of commits.

 

-harendra

 

On 30 September 2016 at 16:40, Simon Peyton Jones via ghc-devs <ghc-devs@haskell.org> wrote:

Thanks... that worked.

Somehow it ought to be possible to un-stage the haddock change rather that carefully undo it manually.  But it worked so I'm not complaining!

Thank you

Simon


|  -----Original Message-----
|  From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of
|  Edward Z. Yang
|  Sent: 30 September 2016 11:53
|  To: ghc-devs <ghc-devs@haskell.org>
|  Subject: Re: git question
|
|  Get to the commit you want to edit, then
|
|      cd utils/haddock
|      git checkout 073d899a8f94ddec698f617a38d3420160a7fd0b
|      cd ../..
|      git commit --amend -a
|
|  Excerpts from Simon Peyton Jones via ghc-devs's message of 2016-09-30
|  10:47:24 +0000:
|  > Friends
|  > I have a batch of several commits lined up on my local machine,
|  validated, and ready to push to the master.
|  > But one seems to have accidentally got
|  >
|  > diff --git a/utils/haddock b/utils/haddock
|  >
|  > index 073d899..a3309e7 160000
|  >
|  > --- a/utils/haddock
|  >
|  > +++ b/utils/haddock
|  >
|  > @@ -1 +1 @@
|  >
|  > -Subproject commit 073d899a8f94ddec698f617a38d3420160a7fd0b
|  >
|  > +Subproject commit a3309e797c42dae9bccdeb17ce52fcababbaff8a
|  > I did not want to meddle with Haddock.
|  > Question: how can I remove this change from my commit?  I know how
|  to do git rebase –interactive, and I can aske to “edit” that commit…
|  but what then?
|  > Thanks
|  > Simon
|  _______________________________________________
|  ghc-devs mailing list
ghc-devs@haskell.org

https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-
|  devs&data=01%7C01%7Csimonpj%40microsoft.com%7C6d4ef4135a94439fb54708d3
|  e91ffd21%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=rNLWdOI3SNnfXPYj
|  PMHXC8U1l5sxI3eOwjHWaKpsBaY%3D&reserved=0

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

 


_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs