All of lore.kernel.org
 help / color / mirror / Atom feed
* undoing something
@ 2009-03-16 19:06 John Dlugosz
  2009-03-16 19:14 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: John Dlugosz @ 2009-03-16 19:06 UTC (permalink / raw)
  To: git

I made a mistake.  Big deal, now that I know that git storage is
immutable and changes just add to what's already there.  

A quick look at
	git reflog show topic
tells me that {1} is the one I want.  So, how do I rewind branch topic
to point to topic@{1} ?
I did it by making a tag, and then in gitk pointing to it and picking
"reset to here" from the context menu.  

A while back I was looking for the right/easy way to simply repoint my
branch to where I wanted.  The best answer was to use push.  But, I
wonder if gitk and other high-level commands simply call a more
primitive command that does this?  And can I call it directly?  Or is
push with a dot as the repository just doing this with no excessive
processing and trust that the side-effects are all vacuous?

--John
(please excuse the footer; it's not my choice)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.

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

* Re: undoing something
  2009-03-16 19:06 undoing something John Dlugosz
@ 2009-03-16 19:14 ` Junio C Hamano
  2009-03-16 19:48   ` John Dlugosz
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2009-03-16 19:14 UTC (permalink / raw)
  To: John Dlugosz; +Cc: git

"John Dlugosz" <JDlugosz@TradeStation.com> writes:

> I made a mistake.  Big deal, now that I know that git storage is
> immutable and changes just add to what's already there.  
>
> A quick look at
> 	git reflog show topic
> tells me that {1} is the one I want.  So, how do I rewind branch topic
> to point to topic@{1} ?
> I did it by making a tag, and then in gitk pointing to it and picking
> "reset to here" from the context menu.  
>
> A while back I was looking for the right/easy way to simply repoint my
> branch to where I wanted.  The best answer was to use push.

The answer was best only because in your previous question you wanted to
ensure fast-forwardness, i.e. "git push . origin/dev:dev" without plus in
front to cause it to fail if it is not fast-forward.

If you know you have one unwanted commit you would want to discard at the
tip of topic, you do not want fast-foward safety to kick in.

 (1) if you are on the topic branch, you can say "git reset --hard HEAD^";
     or

 (2) if you are not, you can obviously check out topic and do the above,
     or "git branch -f topic topic^".

If the garbage you have at the tip of the topic is not just a single
commit, you can replace HEAD^ and topic^ in the above with whatever commit
you would want to point the tip at.

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

* RE: undoing something
  2009-03-16 19:14 ` Junio C Hamano
@ 2009-03-16 19:48   ` John Dlugosz
  2009-03-16 20:11     ` Junio C Hamano
  2009-03-16 21:45     ` (unknown), Nanako Shiraishi
  0 siblings, 2 replies; 15+ messages in thread
From: John Dlugosz @ 2009-03-16 19:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

=== Re: ===
The answer was best only because in your previous question you wanted to
ensure fast-forwardness, i.e. "git push . origin/dev:dev" without plus
in
front to cause it to fail if it is not fast-forward.
=== end ===

No, I don't want to ensure ff.  The remote may have been changed in
other ways.  Though in that case I will avoid doing so; when it is not
the case it's even more important to see that your local copy is
different, and understand the tree, rather than blindly pulling.

=== Re: ===
If you know you have one unwanted commit you would want to discard at
the
tip of topic, you do not want fast-foward safety to kick in.

 (1) if you are on the topic branch, you can say "git reset --hard
HEAD^";
     or

=== end ===

It was a rebase, so the old value is not under the current, or even
visible on the tree.  That's why I needed the reflog to find it.
Tagging it let it appear in gitk.


=== Re: ===
 (2) if you are not, you can obviously check out topic and do the above,
     or "git branch -f topic topic^".
=== end ===

As documented, this destroys the existing branch and makes a new one.
That would, by design, blow away the reflog for that branch.  What I
want is a way to re-point it, and record that repointing =in= the
reflog.  That is, a command-line version that does what I can do with
the GUI, but isn't limited to what I can point to with the mouse.

--John
(please excuse the footer, yadda yadda)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.

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

* Re: undoing something
  2009-03-16 19:48   ` John Dlugosz
@ 2009-03-16 20:11     ` Junio C Hamano
  2009-03-16 20:51       ` Effective Posting John Dlugosz
  2009-03-16 21:45     ` (unknown), Nanako Shiraishi
  1 sibling, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2009-03-16 20:11 UTC (permalink / raw)
  To: John Dlugosz; +Cc: git

"John Dlugosz" <JDlugosz@TradeStation.com> writes:

> === Re: ===
> The answer was best only because in your previous question you wanted to
> ensure fast-forwardness, i.e. "git push . origin/dev:dev" without plus
> in
> front to cause it to fail if it is not fast-forward.
> === end ===

This is offtopic, but *PLEASE* notice that nobody else quotes like this
around here.  I find the style of quoting makes it unnecessarily harder to
skip over parts that others wrote (and I've already read---so I do not
want to waste my time on re-reading them) to get to what you are adding to
the discussion quickly, and extremely annoying.  It is the reason why I am
skipping many of your replies to other people without reading to the end,
even when I suspect you might be saying something worth reading.

> No, I don't want to ensure ff.

I was referring to the exchange that started with this message from you:

From: "John Dlugosz" <JDlugosz@TradeStation.com>
Date: Fri, 6 Mar 2009 14:04:25 -0500
Message-ID: <450196A1AAAE4B42A00A8B27A59278E70A115E0D@EXCHANGE.trad.tradestation.com>

where you asked:

> I want to advocate running
> 
>         git fetch
> 
> as being a safe thing to do at any time, just to refresh your view of
> the origin and not mess up any of your local labels.  That is, you can
> see the difference between the local dev and the origin/dev.
> 
> So, after inspecting the changes, how do you fast-forward your local dev
> to sync up with origin/dev?

and I gave you an answer (with a typo you corrected in another message
today) "git push . origin/dev:dev".  In that context, you clearly want to
encure fast-forward, and local push without + is an easy and safe way to
do so.

That is where "it is best only because" came from.  If you are not
interested in ensuring fast-forward, "local push" may not be best, and
there are other ways (I've shown you at least two, so I won't repeat
them) to choose from.

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

* Effective Posting
  2009-03-16 20:11     ` Junio C Hamano
@ 2009-03-16 20:51       ` John Dlugosz
  2009-03-16 21:29         ` René Scharfe
  2009-03-16 22:21         ` Jay Soffian
  0 siblings, 2 replies; 15+ messages in thread
From: John Dlugosz @ 2009-03-16 20:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

If you can tell me how to make Outlook insert >'s in front of a block of
text, I'm all ears.  I can't find any kind of "quote content" or "paste
as quotation" on the menus, or any option to do anything with the
original message other than to put it at the end with ---original
message--- in front of it.  This was the best I could figure out that
was useful, and gets replies threaded (mostly) properly.  While you're
at it, how do you tell Outlook to always start a message in "plain text"
(not HTML) based on the target address, like Thunderbird does?

Alternatively, tell me how to reply using the Gmane web viewer, or point
me to another web-based viewer that shows current content.

Or, the mailing list server could translate Outlook's visible
interspersed quotes (the original message is blue, new typing is black)
with a uniform quote style that is specified in each subscriber's
preference settings.

Could be worse.  Ever use Lotus Notes?

--John


-----Original Message-----
From: Junio C Hamano [mailto:gitster@pobox.com] 
Sent: Monday, March 16, 2009 3:11 PM
To: John Dlugosz
Cc: git@vger.kernel.org
Subject: Re: undoing something

"John Dlugosz" <JDlugosz@TradeStation.com> writes:

> === Re: ===
> The answer was best only because in your previous question you wanted
to
> ensure fast-forwardness, i.e. "git push . origin/dev:dev" without plus
> in
> front to cause it to fail if it is not fast-forward.
> === end ===

This is offtopic, but *PLEASE* notice that nobody else quotes like this
around here.  I find the style of quoting makes it unnecessarily harder
to
skip over parts that others wrote (and I've already read---so I do not
want to waste my time on re-reading them) to get to what you are adding
to
the discussion quickly, and extremely annoying.  It is the reason why I
am
skipping many of your replies to other people without reading to the
end,
even when I suspect you might be saying something worth reading.




TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.

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

* Re: Effective Posting
  2009-03-16 20:51       ` Effective Posting John Dlugosz
@ 2009-03-16 21:29         ` René Scharfe
  2009-03-16 21:38           ` John Dlugosz
  2009-03-16 22:21         ` Jay Soffian
  1 sibling, 1 reply; 15+ messages in thread
From: René Scharfe @ 2009-03-16 21:29 UTC (permalink / raw)
  To: John Dlugosz; +Cc: Junio C Hamano, git

John Dlugosz schrieb:
> If you can tell me how to make Outlook insert >'s in front of a block
>  of text, I'm all ears.  I can't find any kind of "quote content" or 
> "paste as quotation" on the menus, or any option to do anything with 
> the original message other than to put it at the end with ---original
>  message--- in front of it.  This was the best I could figure out 
> that was useful, and gets replies threaded (mostly) properly.

Tools -> Options -> Preferences -> E-mail Options, set "When replying to
a message" to "Prefix each line of the original message".

> While you're at it, how do you tell Outlook to always start a message
>  in "plain text" (not HTML) based on the target address, like 
> Thunderbird does?

Tools -> Options -> Mail Format, set "Compose in this message format" to
"Plain Text".

> Alternatively, tell me how to reply using the Gmane web viewer, or 
> point me to another web-based viewer that shows current content.

No idea.  But why not use a real mail user agent?

> Or, the mailing list server could translate Outlook's visible 
> interspersed quotes (the original message is blue, new typing is 
> black) with a uniform quote style that is specified in each 
> subscriber's preference settings.

Avoiding garbage is better than converting it to something useful.  If
someone wrote an Outlook mail sanitizer, I'd probably use it at work,
too, though.

> Could be worse.  Ever use Lotus Notes?

Yes, long ago, and thankfully I don't remember much about it.  There's
always a way to do worse -- that's small comfort.

René

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

* RE: Effective Posting
  2009-03-16 21:29         ` René Scharfe
@ 2009-03-16 21:38           ` John Dlugosz
  0 siblings, 0 replies; 15+ messages in thread
From: John Dlugosz @ 2009-03-16 21:38 UTC (permalink / raw)
  To: René Scharfe; +Cc: Junio C Hamano, git

> Tools -> Options -> Preferences -> E-mail Options, set "When replying
> to
> a message" to "Prefix each line of the original message".

That worked.  Thanks.


> No idea.  But why not use a real mail user agent?

Because I'm using git for work, on work time, so I'm using the work computer.  It uses "exchange" instead of a real mail server.  Perhaps there are better mailers that work with Exchange, but it might not do everything the "groupware" stuff does, and that would affect the team interaction.  Also, there is a matter of "group policy" which means I'm not in full control of my own machine.

The web is barely usable from here, too.  The censor is set up, I guess, to stop ordinary desktop users like secretaries and accountants from doing anything to their machine, so the very things I'm interested in -- Windows tools, development topics, anything under ftp: -- is blocked !

--John
(now if the list mailer could strip off that footer that's longer than some of my postings...)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.

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

* (unknown), 
  2009-03-16 19:48   ` John Dlugosz
  2009-03-16 20:11     ` Junio C Hamano
@ 2009-03-16 21:45     ` Nanako Shiraishi
  2009-03-17  7:09       ` undoing something Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: Nanako Shiraishi @ 2009-03-16 21:45 UTC (permalink / raw)
  To: John Dlugosz; +Cc: Junio C Hamano, git

Quoting John Dlugosz <JDlugosz@TradeStation.com>:

> === Re: ===
>  (2) if you are not, you can obviously check out topic and do the above,
>      or "git branch -f topic topic^".
> === end ===
>
> As documented, this destroys the existing branch and makes a new one.
> That would, by design, blow away the reflog for that branch.

Does it?  If so I think you have an incorrect documentation.

$ rm -fr /tmp/gomi && mkdir /tmp/gomi
$ cd /tmp/gomi
$ git init
$ echo hello >world
$ git add world
$ git commit -m initial
$ seq 1 100 | while read num; do echo $num >world; git commit -a -m $num; done
$ git checkout -b side master~60
$ git branch -f master master@{20}
$ git log --oneline -g master | head -n 10
0acf8c1 master@{0}: branch: Reset from master@{20}
945c3ee master@{1}: commit: 100
54fcb36 master@{2}: commit: 99
b314a1e master@{3}: commit: 98
e91d999 master@{4}: commit: 97
0d88853 master@{5}: commit: 96
0124315 master@{6}: commit: 95
5df2cc5 master@{7}: commit: 94
14bb58e master@{8}: commit: 93
0813a46 master@{9}: commit: 92

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

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

* Re: Effective Posting
  2009-03-16 20:51       ` Effective Posting John Dlugosz
  2009-03-16 21:29         ` René Scharfe
@ 2009-03-16 22:21         ` Jay Soffian
  2009-03-16 22:36           ` John Dlugosz
  1 sibling, 1 reply; 15+ messages in thread
From: Jay Soffian @ 2009-03-16 22:21 UTC (permalink / raw)
  To: John Dlugosz; +Cc: Junio C Hamano, git

On Mon, Mar 16, 2009 at 4:51 PM, John Dlugosz <JDlugosz@tradestation.com> wrote:
> Alternatively, tell me how to reply using the Gmane web viewer

Gmane accepts submissions via NNTP. Thunderbird is a capable NNTP client.

> or point me to another web-based viewer that shows current content.

Perhaps sign up for a <insert favorite webmail provider here, mine is
gmail> account?

But, this is seriously off-topic for this list, me thinks.

j.

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

* RE: Effective Posting
  2009-03-16 22:21         ` Jay Soffian
@ 2009-03-16 22:36           ` John Dlugosz
  0 siblings, 0 replies; 15+ messages in thread
From: John Dlugosz @ 2009-03-16 22:36 UTC (permalink / raw)
  To: Jay Soffian; +Cc: Junio C Hamano, git

No NNTP access, and webmail is expressly forbidden.  Actually, any URL that looks like it might be a web mail account is blocked.

I'm using NNTP when at home, on the weekend or whatever.  It makes it easier to reply in-thread.  And I'm using Thunderbird.

--John

> -----Original Message-----
> From: Jay Soffian [mailto:jaysoffian@gmail.com]
> Sent: Monday, March 16, 2009 5:21 PM
> To: John Dlugosz
> Cc: Junio C Hamano; git@vger.kernel.org
> Subject: Re: Effective Posting
> 
> On Mon, Mar 16, 2009 at 4:51 PM, John Dlugosz
> <JDlugosz@tradestation.com> wrote:
> > Alternatively, tell me how to reply using the Gmane web viewer
> 
> Gmane accepts submissions via NNTP. Thunderbird is a capable NNTP
> client.
> 
> > or point me to another web-based viewer that shows current content.
> 
> Perhaps sign up for a <insert favorite webmail provider here, mine is
> gmail> account?
> 
> But, this is seriously off-topic for this list, me thinks.
> 
> j.

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

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

* Re: undoing something
  2009-03-16 21:45     ` (unknown), Nanako Shiraishi
@ 2009-03-17  7:09       ` Junio C Hamano
  2009-03-17 14:06         ` [PATCH] git-branch.txt: document -f correctly Michael J Gruber
  2009-03-17 15:08         ` undoing something John Dlugosz
  0 siblings, 2 replies; 15+ messages in thread
From: Junio C Hamano @ 2009-03-17  7:09 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: John Dlugosz, git, Paolo Bonzini, Jay Soffian

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting John Dlugosz <JDlugosz@TradeStation.com>:
>
>> === Re: ===
>>  (2) if you are not, you can obviously check out topic and do the above,
>>      or "git branch -f topic topic^".
>> === end ===
>>
>> As documented, this destroys the existing branch and makes a new one.
>> That would, by design, blow away the reflog for that branch.
>
> Does it?  If so I think you have an incorrect documentation.
>
> $ rm -fr /tmp/gomi && mkdir /tmp/gomi
> $ cd /tmp/gomi
> $ git init
> $ echo hello >world
> $ git add world
> $ git commit -m initial
> $ seq 1 100 | while read num; do echo $num >world; git commit -a -m $num; done
> $ git checkout -b side master~60
> $ git branch -f master master@{20}
> $ git log --oneline -g master | head -n 10
> 0acf8c1 master@{0}: branch: Reset from master@{20}
> 945c3ee master@{1}: commit: 100
> 54fcb36 master@{2}: commit: 99
> b314a1e master@{3}: commit: 98
> e91d999 master@{4}: commit: 97
> 0d88853 master@{5}: commit: 96
> 0124315 master@{6}: commit: 95
> 5df2cc5 master@{7}: commit: 94
> ...
> 0813a46 master@{9}: commit: 92

I didn't even notice there was another question buried.  Thanks.

Documentation/git-branch.txt says this:

        -f::
                Force the creation of a new branch even if it means deleting
                a branch that already exists with the same name.

which does imply that it first destroys the branch altogether and
recreates as if there was no such branch.

But that is actually not what the code does to reflog, and I think the
behaviour makes a lot more sense than "destroy and create" the
documentation implies.  branch.c::create_branch() has this:

	if (forcing)
		snprintf(msg, sizeof msg, "branch: Reset from %s",
			 start_name);
	else
		snprintf(msg, sizeof msg, "branch: Created from %s",
			 start_name);

The message for your master@{0} example came from the "forcing" codepath.

The documentation is indeed wrong.  It is more like "create a new branch,
or if the named branch already exists, reset the tip of it".  If we want
to sound alarmist, we could add "even if it means making the existing
history unreachable from the new tip of the branch", but I think "reset"
already means that and it would be redundant.

The create_branch() function does another thing, though.  It sets up the
tracking information _if asked_.  Because one branch cannot track more
than one "other things" at once, it inevitably overwrites the previous
tracking information if you say "branch --track -f dev origin/dev" if dev
were tracking something else.  But if you do not let it set up tracking,
the old tracking configuration is _not_ discarded.  I am not sure if that
was intended (the branch.<name>.remote nor branch.<name>.merge variables
are not something I use myself), but it makes sort of sense.  If you do
"git branch -f dev dev~2" to rewind its tip, you do not want to lose its
tracking information, so the current behaviour makes sense in that
respect.

I am not sure about how branch.autsetupmerge does interact with this in
the current code, nor how it should interact with it in the ideal world,
though.  That's for interested parties (I suspect Jay and Paolo?) to
figure out.

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

* [PATCH] git-branch.txt: document -f correctly
  2009-03-17  7:09       ` undoing something Junio C Hamano
@ 2009-03-17 14:06         ` Michael J Gruber
  2009-03-17 16:37           ` Junio C Hamano
  2009-03-17 15:08         ` undoing something John Dlugosz
  1 sibling, 1 reply; 15+ messages in thread
From: Michael J Gruber @ 2009-03-17 14:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

'git branch -f a b' resets a to b when a exists, rather then deleting a.
Say so in the documentation.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Something like this?

BTW, I noticed that 'git-subcmd' is used everywhere in here which does
not feel right, but I followed the existing style, leaving a consistent
clean-up for a later patch. Also, typesetting is inconsistent:
We have <branch> as well as `<branch>` when the text talks about the
options. Do we have a style guide or such?

 Documentation/git-branch.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 6103d62..27b73bc 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -76,8 +76,8 @@ OPTIONS
 	based sha1 expressions such as "<branchname>@\{yesterday}".
 
 -f::
-	Force the creation of a new branch even if it means deleting
-	a branch that already exists with the same name.
+	Reset <branchname> to <startpoint> if <branchname> exists
+	already. Without `-f` 'git-branch' refuses to change an existing branch.
 
 -m::
 	Move/rename a branch and the corresponding reflog.
-- 
1.6.2.149.g6462

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

* RE: undoing something
  2009-03-17  7:09       ` undoing something Junio C Hamano
  2009-03-17 14:06         ` [PATCH] git-branch.txt: document -f correctly Michael J Gruber
@ 2009-03-17 15:08         ` John Dlugosz
  1 sibling, 0 replies; 15+ messages in thread
From: John Dlugosz @ 2009-03-17 15:08 UTC (permalink / raw)
  To: Junio C Hamano, Nanako Shiraishi; +Cc: git, Paolo Bonzini, Jay Soffian

> The documentation is indeed wrong.  It is more like "create a new
> branch,
> or if the named branch already exists, reset the tip of it".  

Awesome.  Then  git branch -f name newpos  is exactly what I need.  

I wondered why something that should be so simple, and is available from
every GUI, is not easy from the command line.

--John


TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.

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

* Re: [PATCH] git-branch.txt: document -f correctly
  2009-03-17 14:06         ` [PATCH] git-branch.txt: document -f correctly Michael J Gruber
@ 2009-03-17 16:37           ` Junio C Hamano
  2009-03-17 16:46             ` Michael J Gruber
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2009-03-17 16:37 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

Michael J Gruber <git@drmicha.warpmail.net> writes:

> 'git branch -f a b' resets a to b when a exists, rather then deleting a.
> Say so in the documentation.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> Something like this?
>
> BTW, I noticed that 'git-subcmd' is used everywhere in here which does
> not feel right, but I followed the existing style, leaving a consistent
> clean-up for a later patch. Also, typesetting is inconsistent:
> We have <branch> as well as `<branch>` when the text talks about the
> options. Do we have a style guide or such?
>
>  Documentation/git-branch.txt |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> index 6103d62..27b73bc 100644
> --- a/Documentation/git-branch.txt
> +++ b/Documentation/git-branch.txt
> @@ -76,8 +76,8 @@ OPTIONS
>  	based sha1 expressions such as "<branchname>@\{yesterday}".
>  
>  -f::
> -	Force the creation of a new branch even if it means deleting
> -	a branch that already exists with the same name.
> +	Reset <branchname> to <startpoint> if <branchname> exists
> +	already. Without `-f` 'git-branch' refuses to change an existing branch.

And what happens if the branchname does not exist?

>  
>  -m::
>  	Move/rename a branch and the corresponding reflog.
> -- 
> 1.6.2.149.g6462

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

* Re: [PATCH] git-branch.txt: document -f correctly
  2009-03-17 16:37           ` Junio C Hamano
@ 2009-03-17 16:46             ` Michael J Gruber
  0 siblings, 0 replies; 15+ messages in thread
From: Michael J Gruber @ 2009-03-17 16:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano venit, vidit, dixit 17.03.2009 17:37:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> 'git branch -f a b' resets a to b when a exists, rather then deleting a.
>> Say so in the documentation.
>>
>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>> ---
>> Something like this?
>>
>> BTW, I noticed that 'git-subcmd' is used everywhere in here which does
>> not feel right, but I followed the existing style, leaving a consistent
>> clean-up for a later patch. Also, typesetting is inconsistent:
>> We have <branch> as well as `<branch>` when the text talks about the
>> options. Do we have a style guide or such?
>>
>>  Documentation/git-branch.txt |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
>> index 6103d62..27b73bc 100644
>> --- a/Documentation/git-branch.txt
>> +++ b/Documentation/git-branch.txt
>> @@ -76,8 +76,8 @@ OPTIONS
>>  	based sha1 expressions such as "<branchname>@\{yesterday}".
>>  
>>  -f::
>> -	Force the creation of a new branch even if it means deleting
>> -	a branch that already exists with the same name.
>> +	Reset <branchname> to <startpoint> if <branchname> exists
>> +	already. Without `-f` 'git-branch' refuses to change an existing branch.
> 
> And what happens if the branchname does not exist?

Well, the standard behaviour of "git branch" is described in the
"description", the meaning of the options under "options"...
We could add

	If <branchname> does not exist it is created and '-f' has no effect.

although that seems a bit talkative.

> 
>>  
>>  -m::
>>  	Move/rename a branch and the corresponding reflog.
>> -- 
>> 1.6.2.149.g6462

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

end of thread, other threads:[~2009-03-17 16:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-16 19:06 undoing something John Dlugosz
2009-03-16 19:14 ` Junio C Hamano
2009-03-16 19:48   ` John Dlugosz
2009-03-16 20:11     ` Junio C Hamano
2009-03-16 20:51       ` Effective Posting John Dlugosz
2009-03-16 21:29         ` René Scharfe
2009-03-16 21:38           ` John Dlugosz
2009-03-16 22:21         ` Jay Soffian
2009-03-16 22:36           ` John Dlugosz
2009-03-16 21:45     ` (unknown), Nanako Shiraishi
2009-03-17  7:09       ` undoing something Junio C Hamano
2009-03-17 14:06         ` [PATCH] git-branch.txt: document -f correctly Michael J Gruber
2009-03-17 16:37           ` Junio C Hamano
2009-03-17 16:46             ` Michael J Gruber
2009-03-17 15:08         ` undoing something John Dlugosz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.