Git development
 help / color / mirror / Atom feed
* [PATCH] git-reset: make the output as the fetch output
@ 2007-01-17 12:56 Santi Béjar
  2007-01-17 13:27 ` Santi Béjar
  2007-01-17 13:43 ` Johannes Schindelin
  0 siblings, 2 replies; 6+ messages in thread
From: Santi Béjar @ 2007-01-17 12:56 UTC (permalink / raw)
  To: Git Mailing List


... and only when HEAD is changed.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-reset.sh |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/git-reset.sh b/git-reset.sh
index bf2a058..acefddc 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -24,6 +24,7 @@ do
 		usage
 		;;
 	*)
+		commit="$1"
 		rev=$(git-rev-parse --verify "$1") || exit
 		shift
 		break
@@ -84,14 +85,20 @@ fi
 git-update-ref -m "$GIT_REFLOG_ACTION" HEAD "$rev"
 update_ref_status=$?
 
+if test $update_ref_status = 0 && test "$orig" != "$rev"
+then
+    revshort=$(git-rev-parse --short $rev)
+    echo "* HEAD: reset to $commit"
+    if test "$orig" ; then
+	echo "  old..new: $(git-rev-parse --short $orig)..$revshort"
+    else
+	echo "  commit: $revshort"
+    fi
+fi
+
 case "$reset_type" in
 --hard )
-	test $update_ref_status = 0 && {
-		printf "HEAD is now at "
-		GIT_PAGER= git log --max-count=1 --pretty=oneline \
-			--abbrev-commit HEAD
-	}
-	;;
+	;; # Nothing else to do
 --soft )
 	;; # Nothing else to do
 --mixed )
-- 
1.5.0.rc1.g0dee5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-reset: make the output as the fetch output
  2007-01-17 12:56 [PATCH] git-reset: make the output as the fetch output Santi Béjar
@ 2007-01-17 13:27 ` Santi Béjar
  2007-01-17 13:38   ` YOSHIFUJI Hideaki / 吉藤英明
  2007-01-17 13:41   ` Andy Parkins
  2007-01-17 13:43 ` Johannes Schindelin
  1 sibling, 2 replies; 6+ messages in thread
From: Santi Béjar @ 2007-01-17 13:27 UTC (permalink / raw)
  To: Git Mailing List

Hi *,

> @@ -84,14 +85,20 @@ fi
[...]
> +    echo "* HEAD: reset to $commit"
[...]

perhaps?
echo "* HEAD: resetted to $commit"

Santi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-reset: make the output as the fetch output
  2007-01-17 13:27 ` Santi Béjar
@ 2007-01-17 13:38   ` YOSHIFUJI Hideaki / 吉藤英明
  2007-01-17 13:41   ` Andy Parkins
  1 sibling, 0 replies; 6+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-01-17 13:38 UTC (permalink / raw)
  To: sbejar; +Cc: git, yoshfuji

In article <8aa486160701170527p69c59510i2daf99e7e805ec5a@mail.gmail.com> (at Wed, 17 Jan 2007 14:27:15 +0100), "Santi Béjar" <sbejar@gmail.com> says:

> > @@ -84,14 +85,20 @@ fi
> [...]
> > +    echo "* HEAD: reset to $commit"
> [...]
> 
> perhaps?
> echo "* HEAD: resetted to $commit"

Of course, not.  Past (and past participle) of "reset" is "reset".

--yoshfuji

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-reset: make the output as the fetch output
  2007-01-17 13:27 ` Santi Béjar
  2007-01-17 13:38   ` YOSHIFUJI Hideaki / 吉藤英明
@ 2007-01-17 13:41   ` Andy Parkins
  1 sibling, 0 replies; 6+ messages in thread
From: Andy Parkins @ 2007-01-17 13:41 UTC (permalink / raw)
  To: git; +Cc: Santi Béjar

On Wednesday 2007 January 17 13:27, Santi Béjar wrote:

> > +    echo "* HEAD: reset to $commit"
>
> [...]
>
> perhaps?
> echo "* HEAD: resetted to $commit"

You were right the first time; "reset" is the correct past-tense form.  If 
anything, I'd lose the colon...

 HEAD reset to $commit

is a perfectly acceptable sentence.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-reset: make the output as the fetch output
  2007-01-17 12:56 [PATCH] git-reset: make the output as the fetch output Santi Béjar
  2007-01-17 13:27 ` Santi Béjar
@ 2007-01-17 13:43 ` Johannes Schindelin
       [not found]   ` <8aa486160701170723j5767f0d3jd3eb4b8817413195@mail.gmail.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2007-01-17 13:43 UTC (permalink / raw)
  To: Santi Béjar; +Cc: Git Mailing List

Hi,

IMHO your version is less helpful than the current behaviour: now it 
shows the oneline (which your version doesn't), and in most cases you 
reset from a dirty state (at least I _exclusively_ use reset in such 
situations), where "from..to" does not make any sense.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-reset: make the output as the fetch output
       [not found]   ` <8aa486160701170723j5767f0d3jd3eb4b8817413195@mail.gmail.com>
@ 2007-01-17 15:35     ` Johannes Schindelin
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2007-01-17 15:35 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 815 bytes --]

Hi,

[reCc'ing list]

On Wed, 17 Jan 2007, Santi Béjar wrote:

> On 1/17/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> > 
> > IMHO your version is less helpful than the current behaviour: now it
> > shows the oneline (which your version doesn't), and in most cases you
> > reset from a dirty state (at least I _exclusively_ use reset in such
> > situations), where "from..to" does not make any sense.
> 
> My motivation is to have a coherent output. I recognize that the ..
> notation in fetch (fastforwarding) does not generally make sense in
> reset. Could be better
> 
> * HEAD: reset to ...
>  old: $hash
>  new: $hash
> 
> If I want to see the commit title I do a "git branch -v".

The whole point of tags/v1.5.0-rc0~44 was to _avoid_ "git branch -v", or 
"git show HEAD".

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-17 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-17 12:56 [PATCH] git-reset: make the output as the fetch output Santi Béjar
2007-01-17 13:27 ` Santi Béjar
2007-01-17 13:38   ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-17 13:41   ` Andy Parkins
2007-01-17 13:43 ` Johannes Schindelin
     [not found]   ` <8aa486160701170723j5767f0d3jd3eb4b8817413195@mail.gmail.com>
2007-01-17 15:35     ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox