Re: Query on git commit amend

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: Query on git commit amend

From: Vijay Lakshminarayanan <hidden>
Date: 2016-06-15 22:52:34

Viresh Kumar [off-list ref] writes:
Hello,

Suppose i want to add few new changes to my last commit (HEAD).
The way i do it is
$ git add all_changed_files
$ git commit --amend

OR
$ git commit --amend -a

With both these ways, i get a screen to edit the message too.

I want to know if there is a way to skip this screen.

i.e.
$ git commit --amend -a -some_other_option

which simply adds new changes to existing commit, without asking to change
message.

If there is no such way, then can we add a patch for this, if it looks a valid
case.
I've found 

$ GIT_EDITOR=cat git commit --amend

useful.

The benefit of this technique is that it even works for git-rebase -i.

In my typical git usage, I do a lot of git-commit --fixup's.  After
reaching a level of stability, I change the history with:

GIT_EDITOR=cat git rebase -i --autosquash

and my history is adjusted without requiring manual intervention.

-- 
Cheers
~vijay

Gnus should be more complicated.

Re: Query on git commit amend

From: Jeff King <hidden>
Date: 2016-06-15 22:52:34

On Tue, Dec 06, 2011 at 09:16:18PM +0530, Vijay Lakshminarayanan wrote:
I've found 

$ GIT_EDITOR=cat git commit --amend

useful.

The benefit of this technique is that it even works for git-rebase -i.
I sometimes do a similar thing, but I don't use "cat". That will dump
all of the log message (including the generated template) to stdout
(i.e., the terminal), which is quite noisy. Instead, I use:

  GIT_EDITOR=true git commit --amend

which silently leaves the file untouched.

-Peff

Re: Query on git commit amend

From: Viresh Kumar <hidden>
Date: 2016-06-15 22:52:35

On 12/6/2011 9:16 PM, Vijay Lakshminarayanan wrote:
I've found 

$ GIT_EDITOR=cat git commit --amend

useful.

The benefit of this technique is that it even works for git-rebase -i.

In my typical git usage, I do a lot of git-commit --fixup's.  After
reaching a level of stability, I change the history with:

GIT_EDITOR=cat git rebase -i --autosquash

and my history is adjusted without requiring manual intervention.
Hi Junio,

After going through autosquash option for rebase, i was wondering
if there is a way to create a new commit easily for autosquash.

For autosquash to work, we need to keep the same commit log/title,
prefixed with squash! or Fixup! etc. What about adding another option
in commit amend which adds squash! or Fixup! automatically. So, manual
intervention at all. :)

I don't know if it already exist.

-- 
viresh

Re: Query on git commit amend

From: Viresh Kumar <hidden>
Date: 2016-06-15 22:52:35

On 12/8/2011 10:56 AM, Viresh Kumar wrote:
For autosquash to work, we need to keep the same commit log/title,
prefixed with squash! or Fixup! etc. What about adding another option
in commit amend which adds squash! or Fixup! automatically. So, manual
intervention at all. :)
Done. It is already there in git commit.

-- 
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help