* [PATCH] Add hints to revert documentation about other ways to undo changes
[not found] <1219165591-19969-1-git-send-email-tarmigan+git@gmail.com>
@ 2008-08-19 17:06 ` Tarmigan
2008-08-19 18:56 ` Junio C Hamano
1 sibling, 0 replies; 6+ messages in thread
From: Tarmigan @ 2008-08-19 17:06 UTC (permalink / raw)
To: Git Mailing List
[Resending to git list. Original was rejected by vger with
Message headers can not have 8-bit non-ASCII characters in it; Use
MIME encodings if such are needed!
so trying to mail list directly for discussion. This copy is probably
mangled in the forward.]
From: Tarmigan Casebolt <tarmigan+git@gmail.com>
Date: Tue, Aug 19, 2008 at 10:06 AM
Subject: [PATCH] Add hints to revert documentation about other ways to
undo changes
To: gitster@pobox.com
Based on its name, people may read the 'git revert' documentation when
they want to undo local changes, especially people who have used other
SCM's. 'git revert' may not be what they had in mind, but git
provides several other ways to undo changes to files. We can help
them by pointing them towards the git commands that do what they might
want to do.
Cc: Daniel Barkalow <barkalow@iabervon.org>
Cc: "Peter Valdemar Mørch (Lists)" <4ux6as402@sneakemail.com>
Cc: Lea Wiemann <lewiemann@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
I put this in a Note: in the DESCRIPTION section. If there is
consensus about moving it somewhere else, I can send another patch.
Documentation/git-revert.txt | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 98cfa3c..d46f090 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -15,6 +15,15 @@ Given one existing commit, revert the change the
patch introduces, and record a
new commit that records it. This requires your working tree to be clean (no
modifications from the HEAD commit).
+Note: Despite its name, 'git revert' may not undo changes in the way
+that you expect. If you want to throw away all uncommitted changes in
+your working directory, you should see linkgit:git-reset[1],
+particulary the '--hard' option. If you want to extract specific
+files as they were in another commit, you should see
+linkgit:git-checkout[1], specifically the 'git checkout <commit> --
+<filename>' syntax. Take care with these alternatives as both will
+discard uncommitted changes in your working directory.
+
OPTIONS
-------
<commit>::
--
1.6.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Add hints to revert documentation about other ways to undo changes
[not found] <1219165591-19969-1-git-send-email-tarmigan+git@gmail.com>
2008-08-19 17:06 ` [PATCH] Add hints to revert documentation about other ways to undo changes Tarmigan
@ 2008-08-19 18:56 ` Junio C Hamano
2008-08-19 19:50 ` Tarmigan Casebolt
1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2008-08-19 18:56 UTC (permalink / raw)
To: Tarmigan Casebolt
Cc: git, Daniel Barkalow, Peter Valdemar Mørch (Lists),
Lea Wiemann
Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
> I put this in a Note: in the DESCRIPTION section. If there is
> consensus about moving it somewhere else, I can send another patch.
I think a note in the description would be fine.
> +Note: Despite its name, 'git revert' may not undo changes in the way
> +that you expect. If you want to throw away all uncommitted changes in
> +your working directory, you should see linkgit:git-reset[1],
> +particulary the '--hard' option. If you want to extract specific
> +files as they were in another commit, you should see
> +linkgit:git-checkout[1], specifically the 'git checkout <commit> --
> +<filename>' syntax. Take care with these alternatives as both will
> +discard uncommitted changes in your working directory.
> +
The last sentence makes the paragraph incoherent, doesn't it?
By starting this paragraph with "Despite its name", you are stating your
expectation that the people who find "git revert" nonintuitive are the
majority. And you explain how to perform the operation that majority
would expect, which is to throw away uncommitted changes to go back to the
clean slate. If that is what the target audience of this paragraph
expects to happen anyway, why do you need to caution against it in the
last sentence?
If the answer is "because it is not cut-and-dried which expectation is the
majority, and we try to be careful not to lose local modifications of
users", then the tone of the paragraph needs to become more neutral.
I'd suggest either dropping the first sentence altogether and starting the
paragraph with "If you want to throw away...", or replacing the first
sentence with "'git revert' is used to record a new commit to reverse the
effect of an earlier commit (often a faulty one)."
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] Add hints to revert documentation about other ways to undo changes
2008-08-19 18:56 ` Junio C Hamano
@ 2008-08-19 19:50 ` Tarmigan Casebolt
2008-08-20 23:06 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Tarmigan Casebolt @ 2008-08-19 19:50 UTC (permalink / raw)
To: gitster; +Cc: git, Tarmigan Casebolt, Daniel Barkalow, Lea Wiemann
Based on its name, people may read the 'git revert' documentation when
they want to undo local changes, especially people who have used other
SCM's. 'git revert' may not be what they had in mind, but git
provides several other ways to undo changes to files. We can help
them by pointing them towards the git commands that do what they might
want to do.
Cc: Daniel Barkalow <barkalow@iabervon.org>
Cc: Lea Wiemann <lewiemann@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
On Tue, Aug 19, 2008 at 11:56 AM, Junio C Hamano <gitster@pobox.com> wrote:
> The last sentence makes the paragraph incoherent, doesn't it?
Yeah. My thinking was that the people who would appreciate this note
would be newbies, and it might be nice to warn them not to just try
'git reset --hard' without thinking.
> By starting this paragraph with "Despite its name", you are stating your
> expectation that the people who find "git revert" nonintuitive are the
> majority.
>
> And you explain how to perform the operation that majority
> would expect, which is to throw away uncommitted changes to go back to the
> clean slate. If that is what the target audience of this paragraph
> expects to happen anyway, why do you need to caution against it in the
> last sentence?
I envision this note as useful for a majority of newbies who don't yet
have a sense of everything 'git reset' and 'git checkout' can do.
> If the answer is "because it is not cut-and-dried which expectation is the
> majority, and we try to be careful not to lose local modifications of
> users", then the tone of the paragraph needs to become more neutral.
>
> I'd suggest either dropping the first sentence altogether and starting the
> paragraph with "If you want to throw away...", or replacing the first
> sentence with "'git revert' is used to record a new commit to reverse the
> effect of an earlier commit (often a faulty one)."
Good idea. I like the later option.
Thanks,
Tarmigan
Documentation/git-revert.txt | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 98cfa3c..e578edf 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -15,7 +15,15 @@ Given one existing commit, revert the change the patch introduces, and record a
new commit that records it. This requires your working tree to be clean (no
modifications from the HEAD commit).
+Note: 'git revert' is used to record a new commit to reverse the
+effect of an earlier commit (often a faulty one). If you want to
+throw away all uncommitted changes in your working directory, you
+should see linkgit:git-reset[1], particularly the '--hard' option. If
+you want to extract specific files as they were in another commit, you
+should see linkgit:git-checkout[1], specifically the 'git checkout
+<commit> -- <filename>' syntax. Take care with these alternatives as
+both will discard uncommitted changes in your working directory.
+
OPTIONS
-------
<commit>::
--
1.6.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Add hints to revert documentation about other ways to undo changes
2008-08-19 19:50 ` Tarmigan Casebolt
@ 2008-08-20 23:06 ` Junio C Hamano
2008-08-20 23:36 ` Tarmigan
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2008-08-20 23:06 UTC (permalink / raw)
To: Tarmigan Casebolt; +Cc: gitster, git, Daniel Barkalow, Lea Wiemann
Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
> Based on its name, people may read the 'git revert' documentation when
> ...
> Documentation/git-revert.txt | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
> index 98cfa3c..e578edf 100644
> --- a/Documentation/git-revert.txt
> +++ b/Documentation/git-revert.txt
> @@ -15,7 +15,15 @@ Given one existing commit, revert the change the patch introduces, and record a
Why do you say you have 7 preimage lines and 15 postimage lines, when the
diffstat claims you have 9 insertions?
Did you hand edit the diff?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add hints to revert documentation about other ways to undo changes
2008-08-20 23:06 ` Junio C Hamano
@ 2008-08-20 23:36 ` Tarmigan
2008-08-20 23:52 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Tarmigan @ 2008-08-20 23:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Daniel Barkalow, Lea Wiemann
On Wed, Aug 20, 2008 at 4:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Tarmigan Casebolt <tarmigan+git@gmail.com> writes:
>
>> Based on its name, people may read the 'git revert' documentation when
>> ...
>> Documentation/git-revert.txt | 9 +++++++++
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
>> index 98cfa3c..e578edf 100644
>> --- a/Documentation/git-revert.txt
>> +++ b/Documentation/git-revert.txt
>> @@ -15,7 +15,15 @@ Given one existing commit, revert the change the patch introduces, and record a
>
> Why do you say you have 7 preimage lines and 15 postimage lines, when the
> diffstat claims you have 9 insertions?
>
> Did you hand edit the diff?
>
Oops, sorry about that. I did hand edit the diff because at the last
second I saw a typo (particulary --> particularly), but I had already
written the email so I didn't want to do `format-patch` again. I did
not rewrap, nor did I manually change the 6 to a 7. I did use emacs
though, which, when I tried to recreate it right now, seems to change
the 6 to a 7 when I touch any of the changed lines.
Sorry about that. I will turn off emacs diff mode and try to be more
careful next time. Please let me know if you want me to resend.
Thanks,
Tarmigan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add hints to revert documentation about other ways to undo changes
2008-08-20 23:36 ` Tarmigan
@ 2008-08-20 23:52 ` Junio C Hamano
0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2008-08-20 23:52 UTC (permalink / raw)
To: Tarmigan; +Cc: git, Daniel Barkalow, Lea Wiemann
Tarmigan <tarmigan+git@gmail.com> writes:
> On Wed, Aug 20, 2008 at 4:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ..
>> Did you hand edit the diff?
>>
> ... I did use emacs
> though, which, when I tried to recreate it right now, seems to change
> the 6 to a 7 when I touch any of the changed lines.
Ok, I was not complaining, just being curious.
Recounting by Emacs's diff mode is sort of broken (it is not quite broken,
but it could do better). My primary interest in the question was to to
see if you are using some other broken diff editing environment.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-08-20 23:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1219165591-19969-1-git-send-email-tarmigan+git@gmail.com>
2008-08-19 17:06 ` [PATCH] Add hints to revert documentation about other ways to undo changes Tarmigan
2008-08-19 18:56 ` Junio C Hamano
2008-08-19 19:50 ` Tarmigan Casebolt
2008-08-20 23:06 ` Junio C Hamano
2008-08-20 23:36 ` Tarmigan
2008-08-20 23:52 ` Junio C Hamano
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).