git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Adapt tutorial to cygwin and add test case
Date: Tue, 11 Oct 2005 12:57:44 -0700	[thread overview]
Message-ID: <7vu0fnsu6f.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: Pine.LNX.4.63.0510111333160.27109@wbgn013.biozentrum.uni-wuerzburg.de

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> -And this is where we start using the `.git/HEAD` file. The `HEAD` file is
> +And this is where we create the `.git/refs/heads/master` file. This file is
>  supposed to contain the reference to the top-of-tree, and since that's
>  exactly what `git-commit-tree` spits out, we can do this all with a simple
>  shell pipeline:
>  
>  ------------------------------------------------
> -echo "Initial commit" | git-commit-tree $(git-write-tree) > .git/HEAD
> +echo "Initial commit" | \
> +	git-commit-tree $(git-write-tree) > .git/refs/heads/master
>  ------------------------------------------------

Hmm.  This is not wrong, but does not feel right.  The point we
are explaining here is that there is a HEAD pointer that knows
about the current branch, and after making a commit, we update
it to record the new tip of the branch.

The Kosher way would be

    tree=$(git-write-tree)
    commit=$(echo 'Initial commit' | git-commit-tree $tree)
    git-update-ref HEAD $(commit)

but looks quite intimidating as a tutorial material.  

> @@ -691,7 +695,9 @@ other point in the history than the curr
>  just telling `git checkout` what the base of the checkout would be.
>  In other words, if you have an earlier tag or branch, you'd just do
>  
> -	git checkout -b mybranch earlier-commit
> +------------
> +git checkout -b mybranch earlier-commit
> +------------

The original was both ugly and did not use boxquote.  There is
no excuse for ugliness, but not using boxquote was for a
reason.  The boxquoted "type this" examples were not to be
missed, lest the later steps we explain would either not work or
would produce results that is different from what we show.  This
particular step is "if you were doing something different, you
would do this", implying "but do not do that here if you are
following the tutorial steps because that is not what we are
doing here".  Maybe we should use boxquote but make an explicit
comment that this is a tangent here?

> @@ -699,17 +705,29 @@ and check out the state at that time.
>  
>  You can always just jump back to your original `master` branch by doing
>  
> -	git checkout master
> +------------
> +git checkout master
> +------------

Same here.

> @@ -870,8 +889,10 @@ Now, let's pretend you are the one who d
>  to the `master` branch. Let's go back to `mybranch`, and run
>  resolve to get the "upstream changes" back to your branch.
>  
> -	git checkout mybranch
> -	git resolve HEAD master "Merge upstream changes."
> +------------
> +git checkout mybranch
> +git resolve HEAD master "Merge upstream changes."
> +------------

But not here.

> diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
> new file mode 100644
> index 0000000..35db799

This is an extremely good addition, thanks.

  reply	other threads:[~2005-10-11 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 11:35 [PATCH] Adapt tutorial to cygwin and add test case Johannes Schindelin
2005-10-11 19:57 ` Junio C Hamano [this message]
2005-10-12  1:27   ` Matthias Urlichs
2005-10-12 11:04     ` Johannes Schindelin
2005-10-12 11:08   ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vu0fnsu6f.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).