Re: Reset by checkout?

2014-06-09 Thread Kevin Bracey
On 07/06/2014 17:52, Philip Oakley wrote: Just to say there has been a similar confusion about 'git reset' reported on the Git Users group for the case of reset with added (staged), but uncommitted changes being wiped out, which simlarly reports on the difficulty of explaining some of the

Re: Reset by checkout?

2014-06-07 Thread Philip Oakley
From: Atsushi Nakagawa at...@chejz.com Kevin Bracey ke...@bracey.fi wrote: On 01/06/2014 07:26, Atsushi Nakagawa wrote: Kevin Bracey ke...@bracey.fi wrote: The original git reset --hard used to be a pretty top-level command. It was used for aborting merges in particular. But I think it

Re: Reset by checkout?

2014-06-06 Thread Atsushi Nakagawa
Kevin Bracey ke...@bracey.fi wrote: On 01/06/2014 07:26, Atsushi Nakagawa wrote: Kevin Bracey ke...@bracey.fi wrote: The original git reset --hard used to be a pretty top-level command. It was used for aborting merges in particular. But I think it now stands out as being one of the only

Re: Reset by checkout?

2014-06-06 Thread Atsushi Nakagawa
Atsushi Nakagawa at...@chejz.com wrote: Kevin Bracey ke...@bracey.fi wrote: On 31/05/2014 08:46, Atsushi Nakagawa wrote: `git checkout -B current-branch-name tree-ish` This is such an useful notion that I can fathom why there isn't a better, first-tier, alternative.q ... I

Re: Reset by checkout?

2014-06-03 Thread Kevin Bracey
On 03/06/2014 00:54, Junio C Hamano wrote: Not that I can think of a better way to update these descriptions, and not that I am opposing to update these descriptions to make it easier for new people to learn, but I am not sure if these treat ORIG_HEAD and the changes since that commit as

Re: Reset by checkout?

2014-06-03 Thread Felipe Contreras
Kevin Bracey wrote: Maybe we just need to tighten up the EXAMPLES section? Give it easy-to-locate path/--soft/--mixed/--keep subheadings, covering all those common use cases (in clean trees...), including a before/after git status views. Then normal users could skip the top technical section

Re: Reset by checkout?

2014-06-02 Thread Junio C Hamano
Atsushi Nakagawa at...@chejz.com writes: One of the more underrepresented command I use in git use on a regular basis is this reset by checkout. It's what's currently achieved by this convoluted expression: `git checkout -B current-branch-name tree-ish` This is such an useful notion

Re: Reset by checkout?

2014-06-02 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Atsushi Nakagawa at...@chejz.com writes: One of the more underrepresented command I use in git use on a regular basis is this reset by checkout. It's what's currently achieved by this convoluted expression: `git checkout -B current-branch-name

Re: Reset by checkout?

2014-06-02 Thread Junio C Hamano
Kevin Bracey ke...@bracey.fi writes: Maybe something like this: I like the overall direction to re-organize the description by operations, but the new description seem to introduce a bit of new confusion. All modes move the current branch pointer so that HEAD now points to the specified

Re: Reset by checkout?

2014-06-01 Thread Kevin Bracey
On 01/06/2014 07:26, Atsushi Nakagawa wrote: Kevin Bracey ke...@bracey.fi wrote: The original git reset --hard used to be a pretty top-level command. It was used for aborting merges in particular. But I think it now stands out as being one of the only really dangerous porcelain commands, and I

Re: Reset by checkout?

2014-05-31 Thread Andreas Schwab
Atsushi Nakagawa at...@chejz.com writes: Ok, the typical use case is: I'm on 'master' and I make a few test commits. Afterwards, I want to discard the commits and move back to 'origin/master'. I could type 'reset --hard origin/master' and risk blowing away dirty files if I'm not careful.

RE: Reset by checkout?

2014-05-31 Thread Felipe Contreras
Atsushi Nakagawa wrote: Ok, the typical use case is: I'm on 'master' and I make a few test commits. Afterwards, I want to discard the commits and move back to 'origin/master'. I could type 'reset --hard origin/master' and risk blowing away dirty files if I'm not careful. Or, I could use

Re: Reset by checkout?

2014-05-31 Thread Kevin Bracey
On 31/05/2014 08:46, Atsushi Nakagawa wrote: `git checkout -B current-branch-name tree-ish` This is such an useful notion that I can fathom why there isn't a better, first-tier, alternative.q I'm 100% in agreement. Reset current branch to X is an extremely common operation, and I use this

RE: Reset by checkout?

2014-05-31 Thread Felipe Contreras
Felipe Contreras wrote: Atsushi Nakagawa wrote: Ok, the typical use case is: I'm on 'master' and I make a few test commits. Afterwards, I want to discard the commits and move back to 'origin/master'. I could type 'reset --hard origin/master' and risk blowing away dirty files if I'm not

Re: Reset by checkout?

2014-05-31 Thread Atsushi Nakagawa
Andreas Schwab sch...@linux-m68k.org wrote: Atsushi Nakagawa at...@chejz.com writes: Ok, the typical use case is: I'm on 'master' and I make a few test commits. Afterwards, I want to discard the commits and move back to 'origin/master'. I could type 'reset --hard origin/master' and risk

Re: Reset by checkout?

2014-05-31 Thread Atsushi Nakagawa
Kevin Bracey ke...@bracey.fi wrote: On 31/05/2014 08:46, Atsushi Nakagawa wrote: `git checkout -B current-branch-name tree-ish` This is such an useful notion that I can fathom why there isn't a better, first-tier, alternative.q ... I guess in theory using checkout allows fancier

Re: Reset by checkout?

2014-05-31 Thread Atsushi Nakagawa
Felipe Contreras felipe.contre...@gmail.com wrote: Felipe Contreras wrote: Atsushi Nakagawa wrote: Ok, the typical use case is: I'm on 'master' and I make a few test commits. Afterwards, I want to discard the commits and move back to 'origin/master'. I could type 'reset --hard