* UI nitpick
@ 2006-12-20 22:55 Han-Wen Nienhuys
2006-12-21 14:26 ` [PATCH] git-reset --hard: tell the user what the HEAD was reset to Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-20 22:55 UTC (permalink / raw)
To: git
Hi,
git-reset is really neat when you messed something up, but it
spews messages.
[lilydev@haring lilypond]$ git-reset HEAD
lily/accidental-engraver.cc: needs update
lily/lyric-combine-music-iterator.cc: needs update
this makes me think that the reset was unsuccesful.
After a few more experiments with
git-reset <stuff> HEAD^
I started noticing that the list grew longer and longer.
It would be nice if git-reset printed
HEAD is now <sha1> - <excerpt of commit message>
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] git-reset --hard: tell the user what the HEAD was reset to
2006-12-20 22:55 UI nitpick Han-Wen Nienhuys
@ 2006-12-21 14:26 ` Johannes Schindelin
2007-01-03 13:17 ` Andy Whitcroft
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2006-12-21 14:26 UTC (permalink / raw)
To: Han-Wen Nienhuys; +Cc: git
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
On Wed, 20 Dec 2006, Han-Wen Nienhuys wrote:
> It would be nice if git-reset printed
>
> HEAD is now <sha1> - <excerpt of commit message>
This patch does that, but only for --reset.
Without reset, HEAD is _not_ changed, just the contents of the
working directory and/or the index.
git-reset.sh | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/git-reset.sh b/git-reset.sh
index 8d95e37..2379db0 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -86,7 +86,12 @@ update_ref_status=$?
case "$reset_type" in
--hard )
- ;; # Nothing else to do
+ test $update_ref_status = 0 && {
+ echo -n "HEAD is now at "
+ GIT_PAGER= git log --max-count=1 --pretty=oneline \
+ --abbrev-commit HEAD
+ }
+ ;;
--soft )
;; # Nothing else to do
--mixed )
--
1.4.4.3.gdb8fb-dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] git-reset --hard: tell the user what the HEAD was reset to
2006-12-21 14:26 ` [PATCH] git-reset --hard: tell the user what the HEAD was reset to Johannes Schindelin
@ 2007-01-03 13:17 ` Andy Whitcroft
2007-01-04 12:59 ` Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Andy Whitcroft @ 2007-01-03 13:17 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Han-Wen Nienhuys, git
Johannes Schindelin wrote:
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> ---
>
> On Wed, 20 Dec 2006, Han-Wen Nienhuys wrote:
>
> > It would be nice if git-reset printed
> >
> > HEAD is now <sha1> - <excerpt of commit message>
>
> This patch does that, but only for --reset.
>
> Without reset, HEAD is _not_ changed, just the contents of the
> working directory and/or the index.
>
> git-reset.sh | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/git-reset.sh b/git-reset.sh
> index 8d95e37..2379db0 100755
> --- a/git-reset.sh
> +++ b/git-reset.sh
> @@ -86,7 +86,12 @@ update_ref_status=$?
>
> case "$reset_type" in
> --hard )
> - ;; # Nothing else to do
> + test $update_ref_status = 0 && {
> + echo -n "HEAD is now at "
> + GIT_PAGER= git log --max-count=1 --pretty=oneline \
> + --abbrev-commit HEAD
> + }
> + ;;
> --soft )
> ;; # Nothing else to do
> --mixed )
Ok, this sounds like a good change in principle, but the output format
it introduces seems likely to cause confusion. For sure the first
couple of times I saw it I though there was a bug and I was seeing an
error from the plumbing. See below for an example where you would swear
something bad had occured.
apw@pinky$ git checkout -b bar master
apw@pinky$ git reset --hard ac9c1108d8915f0937795e354ad72c4ae6890a3f
HEAD is now at ac9c110... git-fetch: remove .keep file at the end.
Huh, fetch? Remove what .keep file? Did I do a fetch? What?
I think we need to delimit the name better, probabally we need to quote
it. Perhaps something like:
HEAD is now at ac9c110: "git-fetch: remove .keep file at the end".
-apw
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] git-reset --hard: tell the user what the HEAD was reset to
2007-01-03 13:17 ` Andy Whitcroft
@ 2007-01-04 12:59 ` Johannes Schindelin
2007-01-04 15:59 ` Andy Whitcroft
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2007-01-04 12:59 UTC (permalink / raw)
To: Andy Whitcroft; +Cc: Han-Wen Nienhuys, git
Hi,
On Wed, 3 Jan 2007, Andy Whitcroft wrote:
> I think we need to delimit the name better, probabally we need to quote
> it. Perhaps something like:
>
> HEAD is now at ac9c110: "git-fetch: remove .keep file at the end".
Fine. But this is "git log --pretty=oneline --abbrev-commit". I don't know
how many things break if you change _that_.
Alternatively, you could pipe that into a sed command adding the colon and
the quotes.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] git-reset --hard: tell the user what the HEAD was reset to
2007-01-04 12:59 ` Johannes Schindelin
@ 2007-01-04 15:59 ` Andy Whitcroft
0 siblings, 0 replies; 5+ messages in thread
From: Andy Whitcroft @ 2007-01-04 15:59 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Han-Wen Nienhuys, git
Johannes Schindelin wrote:
> Hi,
>
> On Wed, 3 Jan 2007, Andy Whitcroft wrote:
>
>> I think we need to delimit the name better, probabally we need to quote
>> it. Perhaps something like:
>>
>> HEAD is now at ac9c110: "git-fetch: remove .keep file at the end".
>
> Fine. But this is "git log --pretty=oneline --abbrev-commit". I don't know
> how many things break if you change _that_.
>
> Alternatively, you could pipe that into a sed command adding the colon and
> the quotes.
Quack, so it is.
apw@pinky$ git log --pretty=oneline --abbrev-commit | head -1
f4bf218... Update clone/fetch documentation with --depth (shallow clone)
option
Perhaps we could do something like:
Head is now at "f4bf218... Update clone/fetch documentation with --depth
(shallow clone) option"
Hmmm ... oh well I guess I'll just get used to it.
-apw
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-04 16:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-20 22:55 UI nitpick Han-Wen Nienhuys
2006-12-21 14:26 ` [PATCH] git-reset --hard: tell the user what the HEAD was reset to Johannes Schindelin
2007-01-03 13:17 ` Andy Whitcroft
2007-01-04 12:59 ` Johannes Schindelin
2007-01-04 15:59 ` Andy Whitcroft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).