git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Host refs to push are chosen (documentation error)?
@ 2010-02-17 13:27 Andrey Borzenkov
  2010-02-17 13:39 ` Tay Ray Chuan
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Borzenkov @ 2010-02-17 13:27 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: Text/Plain, Size: 677 bytes --]

I have a feeling that documentation is not up to date.

{pts/1}% git --version
git version 1.6.6.2

Reading man git-push:

       --all
           Instead of naming each ref to push, specifies that all refs 
under
           $GIT_DIR/refs/heads/ be pushed.

OK, so

{pts/1}% git push -n --all
To ssh://git.mandriva.com/projects/networkmanager.git
 * [new branch]      local-mdv -> local-mdv
 * [new branch]      local-mdv.stgit -> local-mdv.stgit
 * [new branch]      tmp -> tmp
 * [new branch]      tmp.stgit -> tmp.stgit

so far so good, but

{pts/1}% l .git/refs/heads
local-mdv  local-mdv.stgit

Apparently $GIT/refs/heads is not the only place?

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-17 13:27 Host refs to push are chosen (documentation error)? Andrey Borzenkov
@ 2010-02-17 13:39 ` Tay Ray Chuan
  2010-02-17 17:39   ` Avery Pennarun
  0 siblings, 1 reply; 12+ messages in thread
From: Tay Ray Chuan @ 2010-02-17 13:39 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: git

Hi,

On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> {pts/1}% l .git/refs/heads
> local-mdv  local-mdv.stgit

have you tried

 $ cat .git/packed-refs

?

-- 
Cheers,
Ray Chuan

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-17 13:39 ` Tay Ray Chuan
@ 2010-02-17 17:39   ` Avery Pennarun
  2010-02-18  1:16     ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Avery Pennarun @ 2010-02-17 17:39 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:
> On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
>> {pts/1}% l .git/refs/heads
>> local-mdv  local-mdv.stgit
>
> have you tried
>
>  $ cat .git/packed-refs
>
> ?

The documentation is still lying though :)

Avery

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-17 17:39   ` Avery Pennarun
@ 2010-02-18  1:16     ` Jeff King
  2010-02-18  1:51       ` Avery Pennarun
  2010-02-18  7:19       ` Andrey Borzenkov
  0 siblings, 2 replies; 12+ messages in thread
From: Jeff King @ 2010-02-18  1:16 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: Tay Ray Chuan, Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 12:39:23PM -0500, Avery Pennarun wrote:

> On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:
> > On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> >> {pts/1}% l .git/refs/heads
> >> local-mdv  local-mdv.stgit
> >
> > have you tried
> >
> >  $ cat .git/packed-refs
> >
> > ?
> 
> The documentation is still lying though :)

Agreed. It's a minor point, but one that can mislead users who don't
know about packed refs. Maybe something like this?

-- >8 --
Subject: [PATCH] docs: don't talk about $GIT_DIR/refs/ everywhere

It is somewhat misleading to say that we pull refs just from
$GIT_DIR/refs/*, because we may also consult the packed refs
mechanism. These days we tend to treat the "refs hierarchy"
as more of an abstract namespace that happens to be
represented as $GIT_DIR/refs. At best, this is a minor
inaccuracy, but at worst it can confuse users who then look
in $GIT_DIR/refs and find that it is missing some of the
refs they expected to see.

This patch drops most uses of "$GIT_DIR/refs/*", changing
them into just "refs/*", under the assumption that users can
handle the concept of an abstract refs namespace. There are
a few things to note:

  - most cases just dropped the $GIT_DIR/ portion. But for
    cases where that left _just_ the word "refs", I changed
    it to "refs/" to help indicate that it was a hierarchy.
    I didn't do the same for longer paths (e.g.,
    "refs/heads" remained, instead of becoming
    "refs/heads/").

  - in some cases, no change was made, as the text was
    explicitly about unpacked refs (e.g., the discussion in
    git-pack-refs).

  - In some cases it made sense instead to note the
    existence of packed refs (e.g., in check-ref-format and
    rev-parse).

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/git-check-ref-format.txt |    5 +++--
 Documentation/git-clone.txt            |    2 +-
 Documentation/git-fetch-pack.txt       |    2 +-
 Documentation/git-pack-objects.txt     |    2 +-
 Documentation/git-prune.txt            |    2 +-
 Documentation/git-push.txt             |    6 +++---
 Documentation/git-rev-parse.txt        |   14 +++++++++-----
 Documentation/git-show-branch.txt      |   10 +++++-----
 Documentation/git-stash.txt            |    2 +-
 Documentation/rev-list-options.txt     |   22 +++++++++++-----------
 10 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt
index e1c4320..379eee6 100644
--- a/Documentation/git-check-ref-format.txt
+++ b/Documentation/git-check-ref-format.txt
@@ -19,8 +19,9 @@ status if it is not.
 
 A reference is used in git to specify branches and tags.  A
 branch head is stored under the `$GIT_DIR/refs/heads` directory, and
-a tag is stored under the `$GIT_DIR/refs/tags` directory.  git
-imposes the following rules on how references are named:
+a tag is stored under the `$GIT_DIR/refs/tags` directory (or, if refs
+are packed by `git gc`, as entries in the `$GIT_DIR/packed-refs` file).
+git imposes the following rules on how references are named:
 
 . They can include slash `/` for hierarchical (directory)
   grouping, but no slash-separated component can begin with a
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index f43c8b2..88ea624 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -29,7 +29,7 @@ arguments will in addition merge the remote master branch into the
 current master branch, if any.
 
 This default configuration is achieved by creating references to
-the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
+the remote branch heads under `refs/remotes/origin` and
 by initializing `remote.origin.url` and `remote.origin.fetch`
 configuration variables.
 
diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
index e9952e8..97ea797 100644
--- a/Documentation/git-fetch-pack.txt
+++ b/Documentation/git-fetch-pack.txt
@@ -18,7 +18,7 @@ higher level wrapper of this command, instead.
 Invokes 'git-upload-pack' on a possibly remote repository
 and asks it to send objects missing from this repository, to
 update the named heads.  The list of commits available locally
-is found out by scanning local $GIT_DIR/refs/ and sent to
+is found out by scanning the local refs/ hierarchy and sent to
 'git-upload-pack' running on the other end.
 
 This command degenerates to download everything to complete the
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index ffd5025..61fd7d0 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -73,7 +73,7 @@ base-name::
 --all::
 	This implies `--revs`.  In addition to the list of
 	revision arguments read from the standard input, pretend
-	as if all refs under `$GIT_DIR/refs` are specified to be
+	as if all refs under `refs/` are specified to be
 	included.
 
 --include-tag::
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 3bb7304..15cfb7a 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -17,7 +17,7 @@ NOTE: In most cases, users should run 'git gc', which calls
 'git prune'. See the section "NOTES", below.
 
 This runs 'git fsck --unreachable' using all the refs
-available in `$GIT_DIR/refs`, optionally with additional set of
+available in `refs/`, optionally with additional set of
 objects specified on the command line, and prunes all unpacked
 objects unreachable from any of these head objects from the object database.
 In addition, it
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index bd79119..3f103cc 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -69,11 +69,11 @@ nor in any Push line of the corresponding remotes file---see below).
 
 --all::
 	Instead of naming each ref to push, specifies that all
-	refs under `$GIT_DIR/refs/heads/` be pushed.
+	refs under `refs/heads/` be pushed.
 
 --mirror::
 	Instead of naming each ref to push, specifies that all
-	refs under `$GIT_DIR/refs/` (which includes but is not
+	refs under `refs/` (which includes but is not
 	limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
 	be mirrored to the remote repository.  Newly created local
 	refs will be pushed to the remote end, locally updated refs
@@ -96,7 +96,7 @@ nor in any Push line of the corresponding remotes file---see below).
 	the same as prefixing all refs with a colon.
 
 --tags::
-	All refs under `$GIT_DIR/refs/tags` are pushed, in
+	All refs under `refs/tags` are pushed, in
 	addition to refspecs explicitly listed on the command
 	line.
 
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index d677c72..9ee006b 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -101,15 +101,14 @@ OPTIONS
 	abbreviation mode.
 
 --all::
-	Show all refs found in `$GIT_DIR/refs`.
+	Show all refs found in `refs/`.
 
 --branches[=pattern]::
 --tags[=pattern]::
 --remotes[=pattern]::
 	Show all branches, tags, or remote-tracking branches,
-	respectively (i.e., refs found in `$GIT_DIR/refs/heads`,
-	`$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`,
-	respectively).
+	respectively (i.e., refs found in `refs/heads`,
+	`refs/tags`, or `refs/remotes`, respectively).
 +
 If a `pattern` is given, only refs matching the given shell glob are
 shown.  If the pattern does not contain a globbing character (`?`,
@@ -189,7 +188,7 @@ blobs contained in a commit.
   `g`, and an abbreviated object name.
 
 * A symbolic ref name.  E.g. 'master' typically means the commit
-  object referenced by $GIT_DIR/refs/heads/master.  If you
+  object referenced by refs/heads/master.  If you
   happen to have both heads/master and tags/master, you can
   explicitly say 'heads/master' to tell git which one you mean.
   When ambiguous, a `<name>` is disambiguated by taking the
@@ -217,6 +216,11 @@ you can change the tip of the branch back to the state before you ran
 them easily.
 MERGE_HEAD records the commit(s) you are merging into your branch
 when you run 'git merge'.
++
+For any of the `$GIT_DIR/refs` cases above, packed refs from
+`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
+`refs/heads/master` in the packed-refs file would have the same
+precedence as the file `$GIT_DIR/refs/heads/master`).
 
 * A ref followed by the suffix '@' with a date specification
   enclosed in a brace
diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index 7343361..b9c4154 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -20,8 +20,8 @@ DESCRIPTION
 -----------
 
 Shows the commit ancestry graph starting from the commits named
-with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
-and/or $GIT_DIR/refs/tags) semi-visually.
+with <rev>s or <globs>s (or all refs under refs/heads
+and/or refs/tags) semi-visually.
 
 It cannot show more than 29 branches and commits at a time.
 
@@ -37,8 +37,8 @@ OPTIONS
 
 <glob>::
 	A glob pattern that matches branch or tag names under
-	$GIT_DIR/refs.  For example, if you have many topic
-	branches under $GIT_DIR/refs/heads/topic, giving
+	refs/.  For example, if you have many topic
+	branches under refs/heads/topic, giving
 	`topic/*` would show all of them.
 
 -r::
@@ -176,7 +176,7 @@ EXAMPLE
 -------
 
 If you keep your primary branches immediately under
-`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
+`refs/heads`, and topic branches in subdirectories of
 it, having the following in the configuration file may help:
 
 ------------
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 84e555d..473889a 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -33,7 +33,7 @@ A stash is by default listed as "WIP on 'branchname' ...", but
 you can give a more descriptive message on the command line when
 you create one.
 
-The latest stash you created is stored in `$GIT_DIR/refs/stash`; older
+The latest stash you created is stored in `refs/stash`; older
 stashes are found in the reflog of this reference and can be named using
 the usual reflog syntax (e.g. `stash@\{0}` is the most recently
 created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}`
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 6e9baf8..81c0e6f 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -225,26 +225,26 @@ endif::git-rev-list[]
 
 --all::
 
-	Pretend as if all the refs in `$GIT_DIR/refs/` are listed on the
+	Pretend as if all the refs in `refs/` are listed on the
 	command line as '<commit>'.
 
 --branches[=pattern]::
 
-	Pretend as if all the refs in `$GIT_DIR/refs/heads` are listed
+	Pretend as if all the refs in `refs/heads` are listed
 	on the command line as '<commit>'. If `pattern` is given, limit
 	branches to ones matching given shell glob. If pattern lacks '?',
 	'*', or '[', '/*' at the end is implied.
 
 --tags[=pattern]::
 
-	Pretend as if all the refs in `$GIT_DIR/refs/tags` are listed
+	Pretend as if all the refs in `refs/tags` are listed
 	on the command line as '<commit>'. If `pattern` is given, limit
 	tags to ones matching given shell glob. If pattern lacks '?', '*',
 	or '[', '/*' at the end is implied.
 
 --remotes[=pattern]::
 
-	Pretend as if all the refs in `$GIT_DIR/refs/remotes` are listed
+	Pretend as if all the refs in `refs/remotes` are listed
 	on the command line as '<commit>'. If `pattern`is given, limit
 	remote tracking branches to ones matching given shell glob.
 	If pattern lacks '?', '*', or '[', '/*' at the end is implied.
@@ -259,9 +259,9 @@ endif::git-rev-list[]
 ifndef::git-rev-list[]
 --bisect::
 
-	Pretend as if the bad bisection ref `$GIT_DIR/refs/bisect/bad`
+	Pretend as if the bad bisection ref `refs/bisect/bad`
 	was listed and as if it was followed by `--not` and the good
-	bisection refs `$GIT_DIR/refs/bisect/good-*` on the command
+	bisection refs `refs/bisect/good-*` on the command
 	line.
 endif::git-rev-list[]
 
@@ -561,10 +561,10 @@ Bisection Helpers
 
 Limit output to the one commit object which is roughly halfway between
 included and excluded commits. Note that the bad bisection ref
-`$GIT_DIR/refs/bisect/bad` is added to the included commits (if it
-exists) and the good bisection refs `$GIT_DIR/refs/bisect/good-*` are
+`refs/bisect/bad` is added to the included commits (if it
+exists) and the good bisection refs `refs/bisect/good-*` are
 added to the excluded commits (if they exist). Thus, supposing there
-are no refs in `$GIT_DIR/refs/bisect/`, if
+are no refs in `refs/bisect/`, if
 
 -----------------------------------------------------------------------
 	$ git rev-list --bisect foo ^bar ^baz
@@ -585,7 +585,7 @@ one.
 --bisect-vars::
 
 This calculates the same as `--bisect`, except that refs in
-`$GIT_DIR/refs/bisect/` are not used, and except that this outputs
+`refs/bisect/` are not used, and except that this outputs
 text ready to be eval'ed by the shell. These lines will assign the
 name of the midpoint revision to the variable `bisect_rev`, and the
 expected number of commits to be tested after `bisect_rev` is tested
@@ -599,7 +599,7 @@ number of commits to be tested if `bisect_rev` turns out to be bad to
 
 This outputs all the commit objects between the included and excluded
 commits, ordered by their distance to the included and excluded
-commits. Refs in `$GIT_DIR/refs/bisect/` are not used. The farthest
+commits. Refs in `refs/bisect/` are not used. The farthest
 from them is displayed first. (This is the only one displayed by
 `--bisect`.)
 +
-- 
1.7.0.25.g1cf14

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  1:16     ` Jeff King
@ 2010-02-18  1:51       ` Avery Pennarun
  2010-02-18  2:04         ` Junio C Hamano
  2010-02-18  2:04         ` Jeff King
  2010-02-18  7:19       ` Andrey Borzenkov
  1 sibling, 2 replies; 12+ messages in thread
From: Avery Pennarun @ 2010-02-18  1:51 UTC (permalink / raw)
  To: Jeff King; +Cc: Tay Ray Chuan, Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 8:16 PM, Jeff King <peff@peff.net> wrote:
> Agreed. It's a minor point, but one that can mislead users who don't
> know about packed refs. Maybe something like this?

Wow, you really go all out.  Looks pretty good to me, except maybe this:

> ++
> +For any of the `$GIT_DIR/refs` cases above, packed refs from
> +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
> +`refs/heads/master` in the packed-refs file would have the same
> +precedence as the file `$GIT_DIR/refs/heads/master`).

Are they really equal precedence?  How does git decide, when there's
one of each?  I'd guess packed-refs might actually be strictly higher
precedence, but I'm not sure.

Avery

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  1:51       ` Avery Pennarun
@ 2010-02-18  2:04         ` Junio C Hamano
  2010-02-18  2:10           ` Jeff King
  2010-02-18  2:04         ` Jeff King
  1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2010-02-18  2:04 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: Jeff King, Tay Ray Chuan, Andrey Borzenkov, git

Avery Pennarun <apenwarr@gmail.com> writes:

>> ++
>> +For any of the `$GIT_DIR/refs` cases above, packed refs from
>> +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
>> +`refs/heads/master` in the packed-refs file would have the same
>> +precedence as the file `$GIT_DIR/refs/heads/master`).
>
> Are they really equal precedence?  How does git decide, when there's
> one of each?  I'd guess packed-refs might actually be strictly higher
> precedence, but I'm not sure.

This is not about "I have packed refs/heads/master and then a loose
refs/heads/master also exists" case.  After packing, update ref simply
creates a new loose ref, and we read loose ones and give precedence to it
over packed one.  This is so that you once gc and most of the unchanging
refs will stay in packed file, but some active branches can be quickly
flipped without having to rewrite the whole packed refs file (or removing
the ref from that file).

But the statement is not about that.  The statement is about this:

    "refs/tags/master" gets higher precedence over "refs/heads/master",
    and this order is indifferent to where these two refs come from,
    either packed refs or loose in the filesystem.

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  1:51       ` Avery Pennarun
  2010-02-18  2:04         ` Junio C Hamano
@ 2010-02-18  2:04         ` Jeff King
  1 sibling, 0 replies; 12+ messages in thread
From: Jeff King @ 2010-02-18  2:04 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: Tay Ray Chuan, Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 08:51:27PM -0500, Avery Pennarun wrote:

> On Wed, Feb 17, 2010 at 8:16 PM, Jeff King <peff@peff.net> wrote:
> > Agreed. It's a minor point, but one that can mislead users who don't
> > know about packed refs. Maybe something like this?
> 
> Wow, you really go all out.  Looks pretty good to me, except maybe this:

Well, if we're going to spend the mental energy to change one spot, we
may as well grep and change them all. :)

> > ++
> > +For any of the `$GIT_DIR/refs` cases above, packed refs from
> > +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
> > +`refs/heads/master` in the packed-refs file would have the same
> > +precedence as the file `$GIT_DIR/refs/heads/master`).
> 
> Are they really equal precedence?  How does git decide, when there's
> one of each?  I'd guess packed-refs might actually be strictly higher
> precedence, but I'm not sure.

No, packed refs are just below actual ref files in precedence, because
any writes since the pack will be in the actual ref file. What I meant
by "same precedence" was that a packed ref behaves in the lookup
precedence "as if" its ref file existed.

Perhaps it should read:

  (e.g., a line with `refs/heads/master` in the packed-refs file would
  have precedence just below `$GIT_DIR/refs/heads/master` but above
  `$GIT_DIR/refs/remotes/master`)

but that is really conflating two types of precedence (packed refs
versus ref files, and fully-qualifying ref names). They do form a strict
ordering when combined, but that does not necessarily mean that is the
best way for users to understand what is happening.

Maybe that section should also just lose the $GIT_DIR/ from all of the
refs examples, and then we should note later that they may come from
$GIT_DIR or from packed-refs.

-Peff

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  2:04         ` Junio C Hamano
@ 2010-02-18  2:10           ` Jeff King
  2010-02-18  4:06             ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2010-02-18  2:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Avery Pennarun, Tay Ray Chuan, Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 06:04:00PM -0800, Junio C Hamano wrote:

> This is not about "I have packed refs/heads/master and then a loose
> refs/heads/master also exists" case.  After packing, update ref simply
> creates a new loose ref, and we read loose ones and give precedence to it
> over packed one.  This is so that you once gc and most of the unchanging
> refs will stay in packed file, but some active branches can be quickly
> flipped without having to rewrite the whole packed refs file (or removing
> the ref from that file).
> 
> But the statement is not about that.  The statement is about this:
> 
>     "refs/tags/master" gets higher precedence over "refs/heads/master",
>     and this order is indifferent to where these two refs come from,
>     either packed refs or loose in the filesystem.

Exactly what I meant, but if somebody as clueful as Avery gets confused,
then probably I need to be a bit more clear in my note.

Maybe just this squashed into my previous patch?

---
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 9ee006b..1a613aa 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -197,15 +197,15 @@ blobs contained in a commit.
   . if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
     useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
 
-  . otherwise, `$GIT_DIR/refs/<name>` if exists;
+  . otherwise, `refs/<name>` if exists;
 
-  . otherwise, `$GIT_DIR/refs/tags/<name>` if exists;
+  . otherwise, `refs/tags/<name>` if exists;
 
-  . otherwise, `$GIT_DIR/refs/heads/<name>` if exists;
+  . otherwise, `refs/heads/<name>` if exists;
 
-  . otherwise, `$GIT_DIR/refs/remotes/<name>` if exists;
+  . otherwise, `refs/remotes/<name>` if exists;
 
-  . otherwise, `$GIT_DIR/refs/remotes/<name>/HEAD` if exists.
+  . otherwise, `refs/remotes/<name>/HEAD` if exists.
 +
 HEAD names the commit your changes in the working tree is based on.
 FETCH_HEAD records the branch you fetched from a remote repository
@@ -217,10 +217,8 @@ them easily.
 MERGE_HEAD records the commit(s) you are merging into your branch
 when you run 'git merge'.
 +
-For any of the `$GIT_DIR/refs` cases above, packed refs from
-`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
-`refs/heads/master` in the packed-refs file would have the same
-precedence as the file `$GIT_DIR/refs/heads/master`).
+Note that any of the `refs/*` cases above may come either from
+the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
 
 * A ref followed by the suffix '@' with a date specification
   enclosed in a brace

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  2:10           ` Jeff King
@ 2010-02-18  4:06             ` Junio C Hamano
  2010-02-18  4:43               ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2010-02-18  4:06 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Avery Pennarun, Tay Ray Chuan, Andrey Borzenkov, git

Jeff King <peff@peff.net> writes:

> @@ -217,10 +217,8 @@ them easily.
>  MERGE_HEAD records the commit(s) you are merging into your branch
>  when you run 'git merge'.
>  +
> -For any of the `$GIT_DIR/refs` cases above, packed refs from
> -`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
> -`refs/heads/master` in the packed-refs file would have the same
> -precedence as the file `$GIT_DIR/refs/heads/master`).
> +Note that any of the `refs/*` cases above may come either from
> +the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.

This makes it much more clear.  Thanks.

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  4:06             ` Junio C Hamano
@ 2010-02-18  4:43               ` Jeff King
  2010-02-18  5:13                 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2010-02-18  4:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Avery Pennarun, Tay Ray Chuan, Andrey Borzenkov, git

On Wed, Feb 17, 2010 at 08:06:41PM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > @@ -217,10 +217,8 @@ them easily.
> >  MERGE_HEAD records the commit(s) you are merging into your branch
> >  when you run 'git merge'.
> >  +
> > -For any of the `$GIT_DIR/refs` cases above, packed refs from
> > -`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
> > -`refs/heads/master` in the packed-refs file would have the same
> > -precedence as the file `$GIT_DIR/refs/heads/master`).
> > +Note that any of the `refs/*` cases above may come either from
> > +the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
> 
> This makes it much more clear.  Thanks.

Do you want a repost with the squashed text?

-Peff

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  4:43               ` Jeff King
@ 2010-02-18  5:13                 ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2010-02-18  5:13 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Avery Pennarun, Tay Ray Chuan, Andrey Borzenkov, git

Jeff King <peff@peff.net> writes:

>> This makes it much more clear.  Thanks.
>
> Do you want a repost with the squashed text?

I think I have both; thanks for the offer, though.

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

* Re: Host refs to push are chosen (documentation error)?
  2010-02-18  1:16     ` Jeff King
  2010-02-18  1:51       ` Avery Pennarun
@ 2010-02-18  7:19       ` Andrey Borzenkov
  1 sibling, 0 replies; 12+ messages in thread
From: Andrey Borzenkov @ 2010-02-18  7:19 UTC (permalink / raw)
  To: Jeff King; +Cc: Avery Pennarun, Tay Ray Chuan, git

[-- Attachment #1: Type: Text/Plain, Size: 701 bytes --]

On Thursday 18 of February 2010 04:16:20 Jeff King wrote:
> On Wed, Feb 17, 2010 at 12:39:23PM -0500, Avery Pennarun wrote:
> > On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> 
wrote:
> > > On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov 
<arvidjaar@mail.ru> wrote:
> > >> {pts/1}% l .git/refs/heads
> > >> local-mdv  local-mdv.stgit
> > > 
> > > have you tried
> > > 
> > >  $ cat .git/packed-refs
> > > 
> > > ?
> > 
> > The documentation is still lying though :)
> 
> Agreed. It's a minor point, but one that can mislead users who don't
> know about packed refs. Maybe something like this?
> 

And I thought it was such a simple question :)

Thank you!

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2010-02-18  7:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 13:27 Host refs to push are chosen (documentation error)? Andrey Borzenkov
2010-02-17 13:39 ` Tay Ray Chuan
2010-02-17 17:39   ` Avery Pennarun
2010-02-18  1:16     ` Jeff King
2010-02-18  1:51       ` Avery Pennarun
2010-02-18  2:04         ` Junio C Hamano
2010-02-18  2:10           ` Jeff King
2010-02-18  4:06             ` Junio C Hamano
2010-02-18  4:43               ` Jeff King
2010-02-18  5:13                 ` Junio C Hamano
2010-02-18  2:04         ` Jeff King
2010-02-18  7:19       ` Andrey Borzenkov

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).