Thanks to Dale, Charles, Joe, & John, for the replies.

From: "Dale R. Worley" <wor...@alum.mit.edu>
Sent: Friday, May 17, 2013 5:19 PM
From: "Philip Oakley" <philipoak...@iee.org>

Recently there have been a couple of example commands that have a single
dot '.' in the command line.

In this case what is its proper meaning, that is, is it expanded by the
bash shell, or by git it self, and what would its typical expanded
version look like if it is the current dicetory e.g. fully qualified
etc. ?

(I ask as someone more familiar with Windows, so some of the linux stuff
can still be a mystery ;-)

"." means the current directory.  But it is interpreted as such by the
OS itself.  The shell passes it to the program as the string ".", and
programs generally deal with "." without replacing it with the
absolute path of the current directory.  When ".", or a path starting
with "./", is used in an OS call, the OS knows what directory is
designated.  (Which could actually change if the program makes the
chdir() call.)

I wasn't really sure about that (relative to the shell '*' expansion), so it's good to get it confirmed that the shell doesn't touch it.

What this means, I think, is that it is git itself which is expanding the '.' as part of its dwimmery [DWIM - Do What I Mean apparently], so I guess that in the two examples I'd seen the '.' is not being expanded to 'current directory', but to 'current branch' in line with the expected parameter type for that position. Another one of those little "undocumented" features (it may be somewhere in https://github.com/tacker66/git-docpdf/blob/master/git-doc.pdf which collates all the doc!) - it's not in the gitcli guide https://www.kernel.org/pub/software/scm/git/docs/gitcli.html


Extra strange:  In Unix-like system, if, while the program is running,
you move that current directory to somewhere else in the file tree,
the absolute name of the program's current directory changes, of
course.  But the directory's *identity* is unchanged, and the program
is generally unaware that the continents have shifted.  Except when it
does actually matter, which can lead to remarkably puzzling bugs.

Dale


--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to