git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems with branches
@ 2007-01-26 23:51 John Rigby
  2007-01-27  0:03 ` Johannes Schindelin
  2007-01-27  0:03 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: John Rigby @ 2007-01-26 23:51 UTC (permalink / raw)
  To: git

I'm having trouble doing something so simple that it is in the
tutorial but for some reason it does not work for me.
The following script does basically the same thing that is
outlined in the "Managing branches" section of the tutorial.

mkdir foodir
cd foodir/
git-init-db
echo bar > bar
git-add bar
git-commit -m "Initial bar"
git-branch mybranch
git-branch
git-checkout mybranch
echo bar2 >> bar
git-commit -a -m "Added line bar2 to bar in mybranch"
git-checkout master
cat bar
echo bar3 >> bar
git-commit -a -m "Added line bar3 to bar in master"
git-commit -a
git-diff master mybranch
git-merge mybranch

Here is the output, everything seems fine until the git-merge
which complains "fatal: Needed a single revision":

+ mkdir foodir
+ cd foodir/
+ git-init-db
defaulting to local storage area
+ echo bar
+ git-add bar
+ git-commit -m 'Initial bar'
Committing initial tree ee314a31b622b027c10981acaed7903a3607dbd4
+ git-branch mybranch
+ git-branch
* master
  mybranch
+ git-checkout mybranch
+ echo bar2
+ git-commit -a -m 'Added line bar2 to bar in mybranch'
+ git-checkout master
+ cat bar
bar
+ echo bar3
+ git-commit -a -m 'Added line bar3 to bar in master'
+ git-commit -a
nothing to commit
+ git-diff master mybranch
diff --git a/bar b/bar
index 77914eb..46ffc55 100644
--- a/bar
+++ b/bar
@@ -1,2 +1,2 @@
 bar
-bar3
+bar2
+ git-merge mybranch
fatal: Needed a single revision
Usage: /home/jrigby/bin/git-merge [-n] [--no-commit] [--squash] [-s
<strategy>]... <merge-message> <head> <remote>+

Could some kind soul help me pull my head out?

Thanks
John

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

* Re: Problems with branches
  2007-01-26 23:51 Problems with branches John Rigby
@ 2007-01-27  0:03 ` Johannes Schindelin
  2007-01-27  0:03 ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2007-01-27  0:03 UTC (permalink / raw)
  To: John Rigby; +Cc: git

Hi,

On Fri, 26 Jan 2007, John Rigby wrote:

> I'm having trouble doing something so simple that it is in the
> tutorial but for some reason it does not work for me.
> The following script does basically the same thing that is
> outlined in the "Managing branches" section of the tutorial.
> 
> mkdir foodir
> cd foodir/
> git-init-db
> echo bar > bar
> git-add bar
> git-commit -m "Initial bar"
> git-branch mybranch
> git-branch
> git-checkout mybranch
> echo bar2 >> bar
> git-commit -a -m "Added line bar2 to bar in mybranch"
> git-checkout master
> cat bar
> echo bar3 >> bar
> git-commit -a -m "Added line bar3 to bar in master"
> git-commit -a
> git-diff master mybranch
> git-merge mybranch

What version do you run? I get this running your script:

$ mkdir foodir
$ cd foodir/
$ git-init-db
Initialized empty Git repository in .git/
$ echo bar > bar
$ git-add bar
$ git-commit -m "Initial bar"
Created initial commit bca2eed2306297ec17abb5a9a9fd916f18bdd7f8
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 bar
$ git-branch mybranch
$ git-branch
* master
  mybranch
$ git-checkout mybranch
$ echo bar2 >> bar
$ git-commit -a -m "Added line bar2 to bar in mybranch"
Created commit 48c9ce01b39faabc778bcc2ca52f44db54670809
 1 files changed, 1 insertions(+), 0 deletions(-)
$ git-checkout master
$ cat bar
bar
$ echo bar3 >> bar
$ git-commit -a -m "Added line bar3 to bar in master"
Created commit 496e810b70c3dba56d002ad9bec61028af7de821
 1 files changed, 1 insertions(+), 0 deletions(-)
$ git-commit -a
# On branch master
nothing to commit (working directory clean)
$ git-diff master mybranch
diff --git a/bar b/bar
index 77914eb..46ffc55 100644
--- a/bar
+++ b/bar
@@ -1,2 +1,2 @@
 bar
-bar3
+bar2
$ git-merge mybranch
Auto-merged bar
CONFLICT (content): Merge conflict in bar
Automatic merge failed; fix conflicts and then commit the result.

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

* Re: Problems with branches
  2007-01-26 23:51 Problems with branches John Rigby
  2007-01-27  0:03 ` Johannes Schindelin
@ 2007-01-27  0:03 ` Junio C Hamano
  2007-01-27  0:08   ` John Rigby
  2007-01-27 13:13   ` Jeff King
  1 sibling, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-01-27  0:03 UTC (permalink / raw)
  To: John Rigby; +Cc: git

"John Rigby" <jcrigby@gmail.com> writes:

> + git-merge mybranch
> fatal: Needed a single revision
> Usage: /home/jrigby/bin/git-merge [-n] [--no-commit] [--squash] [-s
> <strategy>]... <merge-message> <head> <remote>+
>
> Could some kind soul help me pull my head out?

Probably you are using v1.4.4.X.

The change to make git-merge accessible as the first level UI
happened during the preparation for the upcoming v1.5.0, and is
available only in v1.5.0-rc0 and newer versions (the latest is
at v1.5.0-rc2).

If you replace "git-merge mybranch" with "git-pull . mybranch"
you should be Ok.

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

* Re: Problems with branches
  2007-01-27  0:03 ` Junio C Hamano
@ 2007-01-27  0:08   ` John Rigby
  2007-01-27 13:13   ` Jeff King
  1 sibling, 0 replies; 6+ messages in thread
From: John Rigby @ 2007-01-27  0:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Doh!  Thanks, I didn't realize that this was a 1.5 thing.

On 1/26/07, Junio C Hamano <junkio@cox.net> wrote:
> "John Rigby" <jcrigby@gmail.com> writes:
>
> > + git-merge mybranch
> > fatal: Needed a single revision
> > Usage: /home/jrigby/bin/git-merge [-n] [--no-commit] [--squash] [-s
> > <strategy>]... <merge-message> <head> <remote>+
> >
> > Could some kind soul help me pull my head out?
>
> Probably you are using v1.4.4.X.
>
> The change to make git-merge accessible as the first level UI
> happened during the preparation for the upcoming v1.5.0, and is
> available only in v1.5.0-rc0 and newer versions (the latest is
> at v1.5.0-rc2).
>
> If you replace "git-merge mybranch" with "git-pull . mybranch"
> you should be Ok.
>
>

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

* Re: Problems with branches
  2007-01-27  0:03 ` Junio C Hamano
  2007-01-27  0:08   ` John Rigby
@ 2007-01-27 13:13   ` Jeff King
  2007-01-27 22:00     ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff King @ 2007-01-27 13:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: John Rigby, git

On Fri, Jan 26, 2007 at 04:03:27PM -0800, Junio C Hamano wrote:

> Probably you are using v1.4.4.X.
> 
> The change to make git-merge accessible as the first level UI
> happened during the preparation for the upcoming v1.5.0, and is
> available only in v1.5.0-rc0 and newer versions (the latest is
> at v1.5.0-rc2).

This highlights a problem with the current web pages. The documentation
at http://www.kernel.org/pub/software/scm/git/docs/ is for the current
master (which is presumably where this user got the tutorial mentioning
'git merge' as porcelain). But I suspect a lot of people will be using
the latest released version (either from the tarball, or a binary
package). We could:
  1. Only re-publish the web doc at time of release
  2. Build the published web doc from 'maint' instead of master
  3. Publish (and clearly mark) both last-released and master doc
  4. Disregard it; this particular release made a lot of UI changes, but
     we're not likely run into this for most releases.

-Peff

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

* Re: Problems with branches
  2007-01-27 13:13   ` Jeff King
@ 2007-01-27 22:00     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2007-01-27 22:00 UTC (permalink / raw)
  To: Jeff King; +Cc: John Rigby, git

Jeff King <peff@peff.net> writes:

> On Fri, Jan 26, 2007 at 04:03:27PM -0800, Junio C Hamano wrote:
>
>> Probably you are using v1.4.4.X.
>> 
>> The change to make git-merge accessible as the first level UI
>> happened during the preparation for the upcoming v1.5.0, and is
>> available only in v1.5.0-rc0 and newer versions (the latest is
>> at v1.5.0-rc2).

You are right -- as you and other people noticed, this is
primarily my fault.

> This highlights a problem with the current web pages. The documentation
> at http://www.kernel.org/pub/software/scm/git/docs/ is for the current
> master (which is presumably where this user got the tutorial mentioning
> 'git merge' as porcelain). But I suspect a lot of people will be using
> the latest released version (either from the tarball, or a binary
> package). We could:
>   1. Only re-publish the web doc at time of release
>   2. Build the published web doc from 'maint' instead of master
>   3. Publish (and clearly mark) both last-released and master doc
>   4. Disregard it; this particular release made a lot of UI changes, but
>      we're not likely run into this for most releases.

The ideal solution would be 3 but it would require some juggling
to arrange git.txt -> index.html generation that happens every
time I push to kernel.org machine, so give me a bit of time and
I'll come up with something.

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

end of thread, other threads:[~2007-01-27 22:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-26 23:51 Problems with branches John Rigby
2007-01-27  0:03 ` Johannes Schindelin
2007-01-27  0:03 ` Junio C Hamano
2007-01-27  0:08   ` John Rigby
2007-01-27 13:13   ` Jeff King
2007-01-27 22:00     ` 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).