Git development
 help / color / mirror / Atom feed
* [PATCH v2 3/4] Documentation: format full commands in typewriter font
From: Thomas Rast @ 2010-01-10  0:02 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

Use `code snippet` style instead of 'emphasis' for `git cmd ...`
according to the following rules:

* The SYNOPSIS sections are left untouched.

* If the intent is that the user type the command exactly as given, it
  is `code`.
  If the user is only loosely referred to a command and/or option, it
  remains 'emphasised'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/config.txt            |   12 ++++++------
 Documentation/git-add.txt           |    2 +-
 Documentation/git-bisect.txt        |    2 +-
 Documentation/git-cvsserver.txt     |    2 +-
 Documentation/git-filter-branch.txt |    6 +++---
 Documentation/git-ls-tree.txt       |    4 ++--
 Documentation/git-merge.txt         |   14 +++++++-------
 Documentation/git-replace.txt       |    2 +-
 Documentation/git-revert.txt        |    4 ++--
 Documentation/git-stash.txt         |    2 +-
 Documentation/git-submodule.txt     |    4 ++--
 Documentation/git-var.txt           |    2 +-
 12 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 23a965e..6bfd9e1 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -741,15 +741,15 @@ diff.mnemonicprefix::
 	standard "a/" and "b/" depending on what is being compared.  When
 	this configuration is in effect, reverse diff output also swaps
 	the order of the prefixes:
-'git-diff';;
+`git diff`;;
 	compares the (i)ndex and the (w)ork tree;
-'git-diff HEAD';;
+`git diff HEAD`;;
 	 compares a (c)ommit and the (w)ork tree;
-'git diff --cached';;
+`git diff --cached`;;
 	compares a (c)ommit and the (i)ndex;
-'git-diff HEAD:file1 file2';;
+`git-diff HEAD:file1 file2`;;
 	compares an (o)bject and a (w)ork tree entity;
-'git diff --no-index a b';;
+`git diff --no-index a b`;;
 	compares two non-git things (1) and (2).
 
 diff.renameLimit::
@@ -1015,7 +1015,7 @@ gui.spellingdictionary::
 	off.
 
 gui.fastcopyblame::
-	If true, 'git gui blame' uses '-C' instead of '-C -C' for original
+	If true, 'git gui blame' uses `-C` instead of `-C -C` for original
 	location detection. It makes blame significantly faster on huge
 	repositories at the expense of less thorough copy detection.
 
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 1f1b199..f74fcf3 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -39,7 +39,7 @@ The `git add` command will not add ignored files by default.  If any
 ignored files were explicitly specified on the command line, `git add`
 will fail with a list of ignored files.  Ignored files reached by
 directory recursion or filename globbing performed by Git (quote your
-globs before the shell) will be silently ignored.  The `add` command can
+globs before the shell) will be silently ignored.  The 'git add' command can
 be used to add ignored files with the `-f` (force) option.
 
 Please see linkgit:git-commit[1] for alternative ways to add content to a
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index c39d957..f91c7ac 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -26,7 +26,7 @@ on the subcommand:
  git bisect log
  git bisect run <cmd>...
 
-This command uses 'git rev-list --bisect' to help drive the
+This command uses `git rev-list --bisect` to help drive the
 binary search process to find which change introduced a bug, given an
 old "good" commit object name and a later "bad" commit object name.
 
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index 99a7c14..19b1daf 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -294,7 +294,7 @@ To get a checkout with the Eclipse CVS client:
 Protocol notes: If you are using anonymous access via pserver, just select that.
 Those using SSH access should choose the 'ext' protocol, and configure 'ext'
 access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to
-"'git cvsserver'". Note that password support is not good when using 'ext',
+"`git cvsserver`". Note that password support is not good when using 'ext',
 you will definitely want to have SSH keys setup.
 
 Alternatively, you can just use the non-standard extssh protocol that Eclipse
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 394a77a..544836a 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -129,8 +129,8 @@ convenience functions, too.  For example, calling 'skip_commit "$@"'
 will leave out the current commit (but not its changes! If you want
 that, use 'git-rebase' instead).
 +
-You can also use the 'git_commit_non_empty_tree "$@"' instead of
-'git commit-tree "$@"' if you don't wish to keep commits with a single parent
+You can also use the `git_commit_non_empty_tree "$@"` instead of
+`git commit-tree "$@"` if you don't wish to keep commits with a single parent
 and that makes no change to the tree.
 
 --tag-name-filter <command>::
@@ -179,7 +179,7 @@ the nearest ancestor that was not excluded.
 	and only one parent, it will hence keep merges points. Also, this
 	option is not compatible with the use of '--commit-filter'. Though you
 	just need to use the function 'git_commit_non_empty_tree "$@"' instead
-	of the 'git commit-tree "$@"' idiom in your commit filter to make that
+	of the `git commit-tree "$@"` idiom in your commit filter to make that
 	happen.
 
 --original <namespace>::
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index c3fdccb..1f89d36 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -28,7 +28,7 @@ in the current working directory.  Note that:
    in a directory 'sub' that has a directory 'dir', you can run 'git
    ls-tree -r HEAD dir' to list the contents of the tree (that is
    'sub/dir' in 'HEAD').  You don't want to give a tree that is not at the
-   root level (e.g. 'git ls-tree -r HEAD:sub dir') in this case, as that
+   root level (e.g. `git ls-tree -r HEAD:sub dir`) in this case, as that
    would result in asking for 'sub/sub/dir' in the 'HEAD' commit.
    However, the current working directory can be ignored by passing
    --full-tree option.
@@ -84,7 +84,7 @@ Output Format
 
 Unless the `-z` option is used, TAB, LF, and backslash characters
 in pathnames are represented as `\t`, `\n`, and `\\`, respectively.
-This output format is compatible with what '--index-info --stdin' of
+This output format is compatible with what `--index-info --stdin` of
 'git update-index' expects.
 
 When the `-l` option is used, format changes to
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 3277f4e..04c21d3 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -193,7 +193,7 @@ After seeing a conflict, you can do two things:
 
  * Decide not to merge.  The only clean-ups you need are to reset
    the index file to the `HEAD` commit to reverse 2. and to clean
-   up working tree changes made by 2. and 3.; 'git-reset --hard' can
+   up working tree changes made by 2. and 3.; `git-reset --hard` can
    be used for this.
 
  * Resolve the conflicts.  Git will mark the conflicts in
@@ -202,19 +202,19 @@ After seeing a conflict, you can do two things:
 
 You can work through the conflict with a number of tools:
 
- * Use a mergetool.  'git mergetool' to launch a graphical
+ * Use a mergetool.  `git mergetool` to launch a graphical
    mergetool which will work you through the merge.
 
- * Look at the diffs.  'git diff' will show a three-way diff,
+ * Look at the diffs.  `git diff` will show a three-way diff,
    highlighting changes from both the HEAD and their versions.
 
- * Look at the diffs on their own. 'git log --merge -p <path>'
+ * Look at the diffs on their own. `git log --merge -p <path>`
    will show diffs first for the HEAD version and then
    their version.
 
- * Look at the originals.  'git show :1:filename' shows the
-   common ancestor, 'git show :2:filename' shows the HEAD
-   version and 'git show :3:filename' shows their version.
+ * Look at the originals.  `git show :1:filename` shows the
+   common ancestor, `git show :2:filename` shows the HEAD
+   version and `git show :3:filename` shows their version.
 
 
 EXAMPLES
diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt
index 65a0da5..fde2092 100644
--- a/Documentation/git-replace.txt
+++ b/Documentation/git-replace.txt
@@ -65,7 +65,7 @@ OPTIONS
 BUGS
 ----
 Comparing blobs or trees that have been replaced with those that
-replace them will not work properly. And using 'git reset --hard' to
+replace them will not work properly. And using `git reset --hard` to
 go back to a replaced commit will move the branch to the replacement
 commit instead of the replaced commit.
 
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 5e11758..36f3bc3 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -20,8 +20,8 @@ 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
+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
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 3f14b72..f001d0e 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -20,7 +20,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-Use 'git stash' when you want to record the current state of the
+Use `git stash` when you want to record the current state of the
 working directory and the index, but want to go back to a clean
 working directory.  The command saves your local modifications away
 and reverts the working directory to match the `HEAD` commit.
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 4ef70c4..68f656c 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -114,8 +114,8 @@ init::
 	The key used in .git/config is `submodule.$name.url`.
 	This command does not alter existing information in .git/config.
 	You can then customize the submodule clone URLs in .git/config
-	for your local setup and proceed to 'git submodule update';
-	you can also just use 'git submodule update --init' without
+	for your local setup and proceed to `git submodule update`;
+	you can also just use `git submodule update --init` without
 	the explicit 'init' step if you do not intend to customize
 	any submodule locations.
 
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt
index ef6aa81..bb98182 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -20,7 +20,7 @@ OPTIONS
 	Cause the logical variables to be listed. In addition, all the
 	variables of the git configuration file .git/config are listed
 	as well. (However, the configuration variables listing functionality
-	is deprecated in favor of 'git config -l'.)
+	is deprecated in favor of `git config -l`.)
 
 EXAMPLE
 --------
-- 
1.6.6.218.g502b0

^ permalink raw reply related

* Re: [PATCH v2 0/4] Documentation style fixes
From: Thomas Rast @ 2010-01-10  0:07 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <cover.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:
>   Documentation: spell 'git cmd' without dash throughout
[...]
>  115 files changed, 634 insertions(+), 626 deletions(-)

Turns out the fourth patch is over 200kB and can't be sent over the
list.  I pushed the whole series to

  git://repo.or.cz/git/sbeyer.git t/doc-merge-revamp

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* Re: [PATCH v2 0/4] Documentation style fixes
From: Thomas Rast @ 2010-01-10  0:19 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder
In-Reply-To: <201001100107.29920.trast@student.ethz.ch>

Thomas Rast wrote:
> Thomas Rast wrote:
> >   Documentation: spell 'git cmd' without dash throughout
> [...]
> >  115 files changed, 634 insertions(+), 626 deletions(-)
> 
> Turns out the fourth patch is over 200kB and can't be sent over the
> list.  I pushed the whole series to
> 
>   git://repo.or.cz/git/sbeyer.git t/doc-merge-revamp

Ah, here's the midnight issue.  That should have said

  git://repo.or.cz/git/trast.git t/doc-merge-revamp

Sorry for the noise.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* Re: [PATCH v2 4/4] Documentation: spell 'git cmd' without dash throughout
From: Jonathan Nieder @ 2010-01-10  2:56 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <9516c897017ec420403bb7f687fb8962de42cb7c.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:

> Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
> git-cvsserver, git-upload-pack, git-receive-pack, and
> git-upload-archive are concerned, because those really live in the
> $PATH.

Agreed.  Some forms of 'man' even support 'man git am', so the "it's
what you pass to 'man'" excuse does not even apply any more.

>  110 files changed, 584 insertions(+), 584 deletions(-)

But yikes!  Did you do this by hand or by some automated process?

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 6bfd9e1..db28408 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -64,7 +64,7 @@ The values following the equals sign in variable assign are all either
>  a string, an integer, or a boolean.  Boolean values may be given as yes/no,
>  0/1, true/false or on/off.  Case is not significant in boolean values, when
>  converting value to the canonical form using '--bool' type specifier;
> -'git-config' will ensure that the output is "true" or "false".
> +'git config' will ensure that the output is "true" or "false".
>  
>  String values may be entirely or partially enclosed in double quotes.
>  You need to enclose variable values in double quotes if you want to
> @@ -442,7 +442,7 @@ core.pager::
>  
>  core.whitespace::
>  	A comma separated list of common whitespace problems to
> -	notice.  'git-diff' will use `color.diff.whitespace` to
> +	notice.  'git diff' will use `color.diff.whitespace` to
>  	highlight them, and 'git-apply --whitespace=error' will

A 'git-apply' snuck in. ;-)

> @@ -563,24 +563,24 @@ branch.autosetuprebase::
[...]
>  	Specify multiple values to get an octopus merge.
> -	If you wish to setup 'git-pull' so that it merges into <name> from
> +	If you wish to setup 'git pull' so that it merges into <name> from

Not relevant to this patch, but shouldn't ‘setup’ be ‘set up’?

> @@ -718,14 +718,14 @@ commit.template::
>  	specified user's home directory.
>  
>  diff.autorefreshindex::
> -	When using 'git-diff' to compare with work tree
> +	When using 'git diff' to compare with work tree
>  	files, do not consider stat-only change as changed.
>  	Instead, silently run `git update-index --refresh` to
>  	update the cached stat information for paths whose
>  	contents in the work tree match the contents in the
>  	index.  This option defaults to true.  Note that this
> -	affects only 'git-diff' Porcelain, and not lower level
> -	'diff' commands, such as 'git-diff-files'.
> +	affects only 'git diff' Porcelain, and not lower level
> +	'diff' commands, such as 'git diff-files'.

This sounds better to me without the comma before ‘such as’.

> @@ -840,7 +840,7 @@ format.pretty::
>  	linkgit:git-whatchanged[1].
>  
>  format.thread::
> -	The default threading style for 'git-format-patch'.  Can be
> +	The default threading style for 'git format-patch'.  Can be
>  	either a boolean value, `shallow` or `deep`.  `shallow`
>  	threading makes every mail a reply to the head of the series,
>  	where the head is chosen from the cover letter, the

The ‘either’ here sounds awkward, because there are three options.
Also it is not completely clear that ‘shallow’ and ‘deep’ are not
boolean values here.  So maybe ‘Can be a boolean value, or shallow or
deep’, despite the awkward nested ‘or’ expression.

> @@ -875,18 +875,18 @@ gc.autopacklimit::
>  	default	value is 50.  Setting this to 0 disables it.
>  
>  gc.packrefs::
> -	'git-gc' does not run `git pack-refs` in a bare repository by
> +	'git gc' does not run `git pack-refs` in a bare repository by
>  	default so that older dumb-transport clients can still fetch
> -	from the repository.  Setting this to `true` lets 'git-gc'
> +	from the repository.  Setting this to `true` lets 'git gc'
>  	to run `git pack-refs`.  Setting this to `false` tells

Should be ‘lets git gc run’ or ‘tells git gc to run’.  Not to mention
this is not true any more: 'git gc' has run pack-refs by default ever
since commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24).  As that commit message mentions, git versions before
v1.5.1.2 cannot clone repos with packed refs over http, and git
versions before v1.4.4 cannot handled packed refs period, but more
recent git should have no problems.

So to summarize, the changes to config.txt look good, except a
‘git-apply’ snuck past.

The other changes mentioned above follow.

  Documentation: config: git gc packs refs by default now
  Documentation: tiny git config manual tweaks

 Documentation/config.txt |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

^ permalink raw reply

* [PATCH 1/2] Documentation: git gc packs refs by default now
From: Jonathan Nieder @ 2010-01-10  2:59 UTC (permalink / raw)
  To: git; +Cc: Thomas Rast, Junio C Hamano
In-Reply-To: <20100110025641.GB1083@progeny.tock>

In commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24), 'git gc' was changed to run pack-refs by default 

Versions before v1.5.1.2 cannot clone repos with packed refs over
http, and versions before v1.4.4 cannot handled packed refs at
all, but more recent git should have no problems.  Try to make
this more clear in the git-config manual.

The analagous passage in git-gc.txt was updated already with
commit fe2128a (Change git-gc documentation to reflect
gc.packrefs implementation., 2008-01-09).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/config.txt |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index b5b27ba..bcfed1c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -875,15 +875,12 @@ gc.autopacklimit::
 	default	value is 50.  Setting this to 0 disables it.
 
 gc.packrefs::
-	'git-gc' does not run `git pack-refs` in a bare repository by
-	default so that older dumb-transport clients can still fetch
-	from the repository.  Setting this to `true` lets 'git-gc'
-	to run `git pack-refs`.  Setting this to `false` tells
-	'git-gc' never to run `git pack-refs`. The default setting is
-	`notbare`. Enable it only when you know you do not have to
-	support such clients.  The default setting will change to `true`
-	at some stage, and setting this to `false` will continue to
-	prevent `git pack-refs` from being run from 'git-gc'.
+	Running `git pack-refs` in a repository renders it
+	unclonable by Git versions prior to 1.5.1.2 over dumb
+	transports such as HTTP.  This variable determines whether
+	'git gc' runs `git pack-refs`. This can be set to "nobare"
+	to enable it within all non-bare repos or it can be set to a
+	boolean value.  The default is `true`.
 
 gc.pruneexpire::
 	When 'git-gc' is run, it will call 'prune --expire 2.weeks.ago'.
-- 
1.6.6

^ permalink raw reply related

* [PATCH 2/2] Documentation: tiny git config manual tweaks
From: Jonathan Nieder @ 2010-01-10  3:01 UTC (permalink / raw)
  To: git; +Cc: Thomas Rast, Junio C Hamano
In-Reply-To: <20100110025641.GB1083@progeny.tock>

As a verb, 'setup' is spelled 'set up'.  “diff commands such as
diff-files” scans better without a comma.  Clarify that shallow
and deep are special non-boolean values for format.thread rather
than boolean values with some other name.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/config.txt |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index bcfed1c..f7728ec 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -537,7 +537,7 @@ apply.whitespace::
 	as the '--whitespace' option. See linkgit:git-apply[1].
 
 branch.autosetupmerge::
-	Tells 'git-branch' and 'git-checkout' to setup new branches
+	Tells 'git-branch' and 'git-checkout' to set up new branches
 	so that linkgit:git-pull[1] will appropriately merge from the
 	starting point branch. Note that even if this option is not set,
 	this behavior can be chosen per-branch using the `--track`
@@ -725,7 +725,7 @@ diff.autorefreshindex::
 	contents in the work tree match the contents in the
 	index.  This option defaults to true.  Note that this
 	affects only 'git-diff' Porcelain, and not lower level
-	'diff' commands, such as 'git-diff-files'.
+	'diff' commands such as 'git-diff-files'.
 
 diff.external::
 	If this config variable is set, diff generation is not
@@ -841,8 +841,8 @@ format.pretty::
 
 format.thread::
 	The default threading style for 'git-format-patch'.  Can be
-	either a boolean value, `shallow` or `deep`.  `shallow`
-	threading makes every mail a reply to the head of the series,
+	a boolean value, or `shallow` or `deep`.  `shallow` threading
+	makes every mail a reply to the head of the series,
 	where the head is chosen from the cover letter, the
 	`\--in-reply-to`, and the first patch mail, in this order.
 	`deep` threading makes every mail a reply to the previous one.
-- 
1.6.6

^ permalink raw reply related

* Re: [PATCH v2 3/4] Documentation: format full commands in typewriter font
From: Jonathan Nieder @ 2010-01-10  3:31 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <9d10ee6a8526dc9f9c220cc6bb4b509c8cc73b0a.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:
> * If the intent is that the user type the command exactly as given, it
>   is `code`.
>   If the user is only loosely referred to a command and/or option, it
>   remains 'emphasised'.

Okay.  I think I was guilty of pushing this convention (in commits
like 2fd02c92).  If the distinction is too hazy to be useful, I think
it would be fine to always use `code`, though that would be a bigger
patch.

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 23a965e..6bfd9e1 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -741,15 +741,15 @@ diff.mnemonicprefix::
>  	standard "a/" and "b/" depending on what is being compared.  When
>  	this configuration is in effect, reverse diff output also swaps
>  	the order of the prefixes:
> -'git-diff';;
> +`git diff`;;
>  	compares the (i)ndex and the (w)ork tree;
> -'git-diff HEAD';;
> +`git diff HEAD`;;
>  	 compares a (c)ommit and the (w)ork tree;
> -'git diff --cached';;
> +`git diff --cached`;;
>  	compares a (c)ommit and the (i)ndex;
> -'git-diff HEAD:file1 file2';;
> +`git-diff HEAD:file1 file2`;;

Shouldn't this use ‘git diff’ (no hyphen)?  Alternatively, if you are
leaving this for the next commit, should the other 'git-diff' lines
keep their dash until then, too?

> diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
> index c39d957..f91c7ac 100644
> --- a/Documentation/git-bisect.txt
> +++ b/Documentation/git-bisect.txt
> @@ -26,7 +26,7 @@ on the subcommand:
>   git bisect log
>   git bisect run <cmd>...
>  
> -This command uses 'git rev-list --bisect' to help drive the
> +This command uses `git rev-list --bisect` to help drive the

Does rev-list --bisect take more arguments (i.e., isn’t the command
being only loosely referred to here)?

> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index 394a77a..544836a 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -129,8 +129,8 @@ convenience functions, too.  For example, calling 'skip_commit "$@"'
>  will leave out the current commit (but not its changes! If you want
>  that, use 'git-rebase' instead).
>  +
> -You can also use the 'git_commit_non_empty_tree "$@"' instead of
> -'git commit-tree "$@"' if you don't wish to keep commits with a single parent
> +You can also use the `git_commit_non_empty_tree "$@"` instead of
> +`git commit-tree "$@"` if you don't wish to keep commits with a single parent
>  and that makes no change to the tree.

Not this commit’s topic, but perhaps ‘use the ...’ should be ‘use ...’
or ‘use the ... idiom’...

>  --tag-name-filter <command>::
> @@ -179,7 +179,7 @@ the nearest ancestor that was not excluded.
>  	and only one parent, it will hence keep merges points. Also, this
>  	option is not compatible with the use of '--commit-filter'. Though you
>  	just need to use the function 'git_commit_non_empty_tree "$@"' instead
> -	of the 'git commit-tree "$@"' idiom in your commit filter to make that
> +	of the `git commit-tree "$@"` idiom in your commit filter to make that
>  	happen.

... to match this.

> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
> index 3277f4e..04c21d3 100644
> --- a/Documentation/git-merge.txt
> +++ b/Documentation/git-merge.txt
> @@ -193,7 +193,7 @@ After seeing a conflict, you can do two things:
>  
>   * Decide not to merge.  The only clean-ups you need are to reset
>     the index file to the `HEAD` commit to reverse 2. and to clean
> -   up working tree changes made by 2. and 3.; 'git-reset --hard' can
> +   up working tree changes made by 2. and 3.; `git-reset --hard` can

Probably `git reset --hard` (I won’t mention any more of these).

Except for the bisect-change above,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

The rest looks good, and really does seem clearer in some places.

Thanks,
Jonathan

^ permalink raw reply

* [PATCH 1/4] difftool--helper: Update copyright and remove distracting comments
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg

Some of the comments in git-difftool--helper are not needed because
the code is sufficiently readable without them.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-difftool--helper.sh |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 57e8e32..1b13808 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -3,9 +3,8 @@
 # This script is typically launched by using the 'git difftool'
 # convenience command.
 #
-# Copyright (c) 2009 David Aguilar
+# Copyright (c) 2009-2010 David Aguilar
 
-# Load common functions from git-mergetool--lib
 TOOL_MODE=diff
 . git-mergetool--lib
 
@@ -20,7 +19,6 @@ should_prompt () {
 	fi
 }
 
-# Sets up shell variables and runs a merge tool
 launch_merge_tool () {
 	# Merged is the filename as it appears in the work tree
 	# Local is the contents of a/filename
@@ -39,7 +37,6 @@ launch_merge_tool () {
 		read ans
 	fi
 
-	# Run the appropriate merge tool command
 	run_merge_tool "$merge_tool"
 }
 
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related

* [PATCH 2/4] difftool--helper: Remove use of the GIT_MERGE_TOOL variable
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg
In-Reply-To: <1263096163-15743-1-git-send-email-davvid@gmail.com>

An undocumented mis-feature in git-difftool is that it allows you
to specify a default difftool by setting GIT_MERGE_TOOL.
This behavior was never documented and was included as an
oversight back when git-difftool was maintained outside of git.

git-mergetool never honored GIT_MERGE_TOOL so neither should
git-difftool.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-difftool--helper.sh |    9 ++++-----
 t/t7800-difftool.sh     |    9 ---------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 1b13808..3621f28 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -40,11 +40,10 @@ launch_merge_tool () {
 	run_merge_tool "$merge_tool"
 }
 
-# Allow GIT_DIFF_TOOL and GIT_MERGE_TOOL to provide default values
-test -n "$GIT_MERGE_TOOL" && merge_tool="$GIT_MERGE_TOOL"
-test -n "$GIT_DIFF_TOOL" && merge_tool="$GIT_DIFF_TOOL"
-
-if test -z "$merge_tool"; then
+# GIT_DIFF_TOOL indicates that --tool=... was specified
+if test -n "$GIT_DIFF_TOOL"; then
+	merge_tool="$GIT_DIFF_TOOL"
+else
 	merge_tool="$(get_merge_tool)" || exit
 fi
 
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9bf6c98..eca51a8 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -32,7 +32,6 @@ restore_test_defaults()
 	# Restores the test defaults used by several tests
 	remove_config_vars
 	unset GIT_DIFF_TOOL
-	unset GIT_MERGE_TOOL
 	unset GIT_DIFFTOOL_PROMPT
 	unset GIT_DIFFTOOL_NO_PROMPT
 	git config diff.tool test-tool &&
@@ -107,15 +106,7 @@ test_expect_success 'GIT_DIFF_TOOL overrides' '
 	git config diff.tool bogus-tool &&
 	git config merge.tool bogus-tool &&
 
-	GIT_MERGE_TOOL=test-tool &&
-	export GIT_MERGE_TOOL &&
-	diff=$(git difftool --no-prompt branch) &&
-	test "$diff" = "branch" &&
-	unset GIT_MERGE_TOOL &&
-
-	GIT_MERGE_TOOL=bogus-tool &&
 	GIT_DIFF_TOOL=test-tool &&
-	export GIT_MERGE_TOOL &&
 	export GIT_DIFF_TOOL &&
 
 	diff=$(git difftool --no-prompt branch) &&
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related

* [PATCH 3/4] difftool: Allow specifying unconfigured commands with --extcmd
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg
In-Reply-To: <1263096163-15743-1-git-send-email-davvid@gmail.com>

git-difftool requires difftool.<tool>.cmd configuration even when
tools use the standard "$diffcmd $from $to" form.  This teaches
git-difftool to run these tools in lieu of configuration by
allowing the command to be specified on the command line.

Reference: http://article.gmane.org/gmane.comp.version-control.git/133377
Signed-off-by: David Aguilar <davvid@gmail.com>
---
 Documentation/git-difftool.txt |    5 +++++
 git-difftool--helper.sh        |   30 +++++++++++++++++++++++-------
 git-difftool.perl              |    4 ++++
 t/t7800-difftool.sh            |   19 ++++++++++++++++++-
 4 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index a5bce62..f67d2db 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -58,6 +58,11 @@ is set to the name of the temporary file containing the contents
 of the diff post-image.  `$BASE` is provided for compatibility
 with custom merge tool commands and has the same value as `$LOCAL`.
 
+--extcmd=<command>::
+	Specify a custom command for viewing diffs.
+	'git-difftool' ignores the configured defaults and runs
+	`$command $LOCAL $REMOTE` when this option is specified.
+
 -g::
 --gui::
 	When 'git-difftool' is invoked with the `-g` or `--gui` option
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 3621f28..d806eae 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -19,6 +19,11 @@ should_prompt () {
 	fi
 }
 
+# Indicates that --extcmd=... was specified
+use_ext_cmd () {
+	test -n "$GIT_DIFFTOOL_EXTCMD"
+}
+
 launch_merge_tool () {
 	# Merged is the filename as it appears in the work tree
 	# Local is the contents of a/filename
@@ -33,18 +38,29 @@ launch_merge_tool () {
 	# the user with the real $MERGED name before launching $merge_tool.
 	if should_prompt; then
 		printf "\nViewing: '$MERGED'\n"
-		printf "Hit return to launch '%s': " "$merge_tool"
+		if use_ext_cmd; then
+			printf "Hit return to launch '%s': " \
+				"$GIT_DIFFTOOL_EXTCMD"
+		else
+			printf "Hit return to launch '%s': " "$merge_tool"
+		fi
 		read ans
 	fi
 
-	run_merge_tool "$merge_tool"
+	if use_ext_cmd; then
+		$GIT_DIFFTOOL_EXTCMD "$LOCAL" "$REMOTE"
+	else
+		run_merge_tool "$merge_tool"
+	fi
+
 }
 
-# GIT_DIFF_TOOL indicates that --tool=... was specified
-if test -n "$GIT_DIFF_TOOL"; then
-	merge_tool="$GIT_DIFF_TOOL"
-else
-	merge_tool="$(get_merge_tool)" || exit
+if ! use_ext_cmd; then
+	if test -n "$GIT_DIFF_TOOL"; then
+		merge_tool="$GIT_DIFF_TOOL"
+	else
+		merge_tool="$(get_merge_tool)" || exit
+	fi
 fi
 
 # Launch the merge tool on each path provided by 'git diff'
diff --git a/git-difftool.perl b/git-difftool.perl
index 8c836e4..f8ff245 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -62,6 +62,10 @@ sub generate_command
 			$skip_next = 1;
 			next;
 		}
+		if ($arg =~ /^--extcmd=/) {
+			$ENV{GIT_DIFFTOOL_EXTCMD} = substr($arg, 9);
+			next;
+		}
 		if ($arg =~ /^--tool=/) {
 			$ENV{GIT_DIFF_TOOL} = substr($arg, 7);
 			next;
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index eca51a8..8ee186a 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -214,7 +214,24 @@ test_expect_success 'difftool.<tool>.path' '
 	diff=$(git difftool --tool=tkdiff --no-prompt branch) &&
 	git config --unset difftool.tkdiff.path &&
 	lines=$(echo "$diff" | grep file | wc -l) &&
-	test "$lines" -eq 1
+	test "$lines" -eq 1 &&
+
+	restore_test_defaults
+'
+
+test_expect_success 'difftool --extcmd=...' '
+	diff=$(git difftool --no-prompt --extcmd=cat branch) &&
+
+	lines=$(echo "$diff" | wc -l) &&
+	test "$lines" -eq 2 &&
+
+	lines=$(echo "$diff" | grep master | wc -l) &&
+	test "$lines" -eq 1 &&
+
+	lines=$(echo "$diff" | grep branch | wc -l) &&
+	test "$lines" -eq 1 &&
+
+	restore_test_defaults
 '
 
 test_done
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related

* [PATCH 4/4] git-diff.txt: Link to git-difftool
From: David Aguilar @ 2010-01-10  4:02 UTC (permalink / raw)
  To: gitster; +Cc: git, markus.heidelberg
In-Reply-To: <1263096163-15743-1-git-send-email-davvid@gmail.com>

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 Documentation/git-diff.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 0ac7112..723a648 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -157,6 +157,10 @@ $ git diff -R                          <2>
 rewrites (very expensive).
 <2> Output diff in reverse.
 
+SEE ALSO
+--------
+linkgit:git-difftool[1]::
+	Show changes using common diff tools
 
 Author
 ------
-- 
1.6.6.4.g20a38b.dirty

^ permalink raw reply related

* Re: [PATCH v2 1/4] Documentation/git-merge: reword references to "remote" and "pull"
From: Jonathan Nieder @ 2010-01-10  4:13 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <57bddb115331a23816af772172531fb56fceace4.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:
> The git-merge manpage was written in terms of merging a "remote",
> which is no longer the case: you merge local or remote-tracking
> branches; pull is for actual remotes.
 
Right.

> Adjust the manpage accordingly.  We refer to the arguments as
> "commits", and change instances of "remote" to "other" (where branches
> are concerned) or "theirs" (where conflict sides are concerned).

Makes sense.  It might be nice to emphasize the metaphor of merging
another branch’s history into the current branch, but <commit>
really does seem clearer than ‘{ <branch> | <commit> }’ or any other
alternative I can come up with.

> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
> index e886c2e..4896587 100644
> --- a/Documentation/git-merge.txt
> +++ b/Documentation/git-merge.txt
> @@ -10,17 +10,17 @@ SYNOPSIS
>  --------
>  [verse]
>  'git merge' [-n] [--stat] [--no-commit] [--squash] [-s <strategy>]...
> -	[-m <msg>] <remote>...
> -'git merge' <msg> HEAD <remote>...
> +	[-m <msg>] <commit>...
> +'git merge' <msg> HEAD <commit>...
>  
>  DESCRIPTION
>  -----------
> -This is the top-level interface to the merge machinery
> -which drives multiple merge strategy scripts.
> +Merges the history specified by <commit> into HEAD, optionally using a
> +specific merge strategy.

Perhaps just

| Rejoins two or more diverging branches of development.

would be simpler.  The ability to choose a merge strategy seems more
like a detail for later.

> -The second syntax (<msg> `HEAD` <remote>) is supported for
> +The second syntax (<msg> `HEAD` <commit>...) is supported for
>  historical reasons.  Do not use it from the command line or in
> -new scripts.  It is the same as `git merge -m <msg> <remote>`.
> +new scripts.  It is the same as `git merge -m <msg> <commit>...`.

Technically, they are not entirely the same: ‘merge -m <msg>’ will
warn that the log message is ignored when the merge results in a
fast-forward, whereas ‘merge <msg> HEAD’ will not.  See commit
77c29b4a (Revert recent "git merge <msg> HEAD <commit>..."
deprecation, 2009-12-08).  So should this say

| Use `git merge -m <msg> <commit>...` instead.

to side-step the issue?  Not sure.

> @@ -33,10 +33,10 @@ include::merge-options.txt[]
>  	used to give a good default for automated 'git merge'
>  	invocations.
>  
> -<remote>...::
> -	Other branch heads to merge into our branch.  You need at
> -	least one <remote>.  Specifying more than one <remote>
> -	obviously means you are trying an Octopus.
> +<commit>...::
> +	Commits, usually other branch heads, to merge into our branch.
> +	You need at least one <commit>.  Specifying more than one
> +	<commit> obviously means you are trying an Octopus.

Nice.

> @@ -96,8 +96,8 @@ file matches exactly the current `HEAD` commit; otherwise we
>  will write out your local changes already registered in your
>  index file along with the merge result, which is not good.
>  Because 1. involves only those paths differing between your
> -branch and the remote branch you are pulling from during the
> -merge (which is typically a fraction of the whole tree), you can
> +branch and the branch you are merging
> +(which is typically a fraction of the whole tree), you can

Hmm.  The old wording distinguishes nicely between the HEAD and
MERGE_HEAD that will be parents for the new HEAD.  From some points
of view, the new wording does not: both are branches you are
merging (though only one is an argument to 'git merge').

Sadly, I have not come up with a good expression for “the other
commit whose history is to be incorporated into the current
branch”.

Maybe we should punt and just say “the other branch”?

> @@ -202,15 +202,15 @@ You can work through the conflict with a number of tools:
>     mergetool which will work you through the merge.
>  
>   * Look at the diffs.  'git diff' will show a three-way diff,
> -   highlighting changes from both the HEAD and remote versions.
> +   highlighting changes from both the HEAD and their versions.
>  
>   * Look at the diffs on their own. 'git log --merge -p <path>'

This is a bit awkward, since 'they' is playing two roles.  Also,
the context does not make it obvious what 'our' and 'their'
versions are.

Maybe:

|   * Look at the diffs.  'git diff' will show a three-way diff,
|     highlighting changes from both the HEAD and MERGE_HEAD
|     versions.
|
|   * Look at the diffs from each branch.  'git log --merge -p
|     <path>' will show diffs first for the HEAD version and
|     then the MERGE_HEAD version.
|
|   * Look at the originals.  'git show :1:filename' shows the
|     common ancestor, 'git show :2:filename' shows the HEAD
|     version, and 'git show :3:filename' shows the MERGE_HEAD
|     version.

Thanks for looking into this,
Jonathan

^ permalink raw reply

* Re: [PATCH v2 2/4] Documentation: warn prominently against merging with dirty trees
From: Jonathan Nieder @ 2010-01-10  4:49 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano
In-Reply-To: <e330d8ca1a9ec38ce40b0f67123b1dd893f0b31c.1263081032.git.trast@student.ethz.ch>

Thomas Rast wrote:

> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
> index 4896587..3277f4e 100644
> --- a/Documentation/git-merge.txt
> +++ b/Documentation/git-merge.txt
> @@ -22,6 +22,10 @@ The second syntax (<msg> `HEAD` <commit>...) is supported for
>  historical reasons.  Do not use it from the command line or in
>  new scripts.  It is the same as `git merge -m <msg> <commit>...`.
>  
> +*Warning*: Running 'git-merge' with uncommitted changes is
> +discouraged:

Is this true?  The 'git reset' manual page gives an example of something
I end up doing pretty often:

| Undo a merge or pull inside a dirty work tree
|
|         $ git pull                         (1)
|         Auto-merging nitfol
|         Merge made by recursive.
|          nitfol                |   20 +++++----
|          ...
|         $ git reset --merge ORIG_HEAD      (2)
|
|     1. Even if you may have local modifications in your working tree, you
|     can safely say "git pull" when you know that the change in the other
|     branch does not overlap with them.
|     2. After inspecting the result of the merge, you may find that the
|     change in the other branch is unsatisfactory. Running "git reset
|     --hard ORIG_HEAD" will let you go back to where you were, but it will
|     discard your local changes, which you do not want. "git reset --merge"
|     keeps your local changes.

> while possible, it leaves you in a state that is hard to
> +back out of in the case of a conflict.
> +

Oh, that is a problem.  Maybe 'git merge' should refuse to merge
unless told otherwise, if there is a dirty index and there might be
conflicts.

In other words, would it be possible to fix this without relying on
people to look at the documentation?

Jonathan

^ permalink raw reply

* Re: [PATCH v2 2/4] Documentation: warn prominently against merging with dirty trees
From: Junio C Hamano @ 2010-01-10  6:31 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Thomas Rast, git, Junio C Hamano
In-Reply-To: <20100110044949.GA8974@progeny.tock>

Jonathan Nieder <jrnieder@gmail.com> writes:

> |     1. Even if you may have local modifications in your working tree, you
> |     can safely say "git pull" when you know that the change in the other
> |     branch does not overlap with them.
> |     2. After inspecting the result of the merge, you may find that the
> |     change in the other branch is unsatisfactory. Running "git reset
> |     --hard ORIG_HEAD" will let you go back to where you were, but it will
> |     discard your local changes, which you do not want. "git reset --merge"
> |     keeps your local changes.
>
>> while possible, it leaves you in a state that is hard to
>> +back out of in the case of a conflict.
>> +
>
> Oh, that is a problem.  Maybe 'git merge' should refuse to merge
> unless told otherwise, if there is a dirty index and there might be
> conflicts.

"git reset --merge" will keep your local changes after such a merge, and
"mergy" operations (not just "merge" but also "revert", "am -3", etc)
won't get you into a situation where you cannot, by refusing to do
anything when e.g. your index is dirty.  Especially when Christian's
"reset --merge" update becomes solid, "... is hard to back out of" will
become a false statement.

Of course, the user needs to understand what he or she is doing (see
http://thread.gmane.org/gmane.comp.version-control.git/136166/focus=136171
for example).  And that is one reason we (at least I) try to teach new
people to start working from a clean tree, until they get comfortable
working with mergy operations.

^ permalink raw reply

* Re: [PATCH] ls-files: fix overeager pathspec optimization
From: Junio C Hamano @ 2010-01-10  6:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Jeff King, Michael J Gruber, Jon Schewe, spearce, git
In-Reply-To: <alpine.LFD.2.00.1001091004380.7821@localhost.localdomain>

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Sat, 9 Jan 2010, Junio C Hamano wrote:
>> 
>> Having sent these patches, I am wondering if the simplest fix might be this
>> one-liner.
>> 
>> diff --git a/dir.c b/dir.c
>> index d0999ba..7fba335 100644
>> --- a/dir.c
>> +++ b/dir.c
>> @@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
>>  	simplify = create_simplify(pathspec);
>> -	read_directory_recursive(dir, path, len, 0, simplify);
>> +	read_directory_recursive(dir, "", 0, 0, simplify);
>>  	free_simplify(simplify);
>
> That one-liner doesn't work at all for me.
> ...
> IOW, it now ignores _everything_, because the dir and the path don't 
> match.

Hmph, you are right.  The real series is not equivalent to the one-liner
at all.

^ permalink raw reply

* Re: [PATCH v2 0/4] Documentation style fixes
From: Junio C Hamano @ 2010-01-10  6:34 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Jonathan Nieder
In-Reply-To: <201001100107.29920.trast@student.ethz.ch>

As to the general direction I am in full agreement with what you and
Jonathan discussed in the review of your series, namely:

 - We prefer dashless these days;

 - Reference to a concrete command line is <code>git clone</code> which is
   typeset differently from general descriptions of what <emphasis>git
   clone</emphasis> command does.

I'd like to proceed with this series by (1) pulling from you and queuing
the result in 'next', (2) asking other people (including Jonathan) to
proofread and send necessary updates to the list, (3) asking you to check
and queue these updates from others yourself and tell me to pull again to
my 'next', and (4) merging the result to 'master' when done.

Does it sound workable?  Am I placing too much undue burden on you?

^ permalink raw reply

* Re: [PATCH v2 0/4] Documentation style fixes
From: Junio C Hamano @ 2010-01-10  7:12 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Junio C Hamano, Jonathan Nieder
In-Reply-To: <201001100107.29920.trast@student.ethz.ch>

Thomas Rast <trast@student.ethz.ch> writes:

> Turns out the fourth patch is over 200kB and can't be sent over the
> list.  I pushed the whole series to
>
>   git://repo.or.cz/git/sbeyer.git t/doc-merge-revamp

I think you meant s/sbeyer/trast/ ;-)

^ permalink raw reply

* [PATCH 2/2] Use $(git rev-parse --show-toplevel) in cd_to_toplevel()
From: Steven Drake @ 2010-01-10  7:19 UTC (permalink / raw)
  To: git

as it gives the absolute (aka "physical") path of the toplevel directory 
and 'cd -P' is not supported by all shell implementations.

See NetBSD PR/42168.
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=42168
---
 git-sh-setup.sh |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index dfcb807..3cbec05 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -120,16 +120,10 @@ is_bare_repository () {
 }
 
 cd_to_toplevel () {
-	cdup=$(git rev-parse --show-cdup)
-	if test ! -z "$cdup"
+	if test ! -z "$(git rev-parse --show-cdup)"
 	then
-		# The "-P" option says to follow "physical" directory
-		# structure instead of following symbolic links.  When cdup is
-		# "../", this means following the ".." entry in the current
-		# directory instead textually removing a symlink path element
-		# from the PWD shell variable.  The "-P" behavior is more
-		# consistent with the C-style chdir used by most of Git.
-		cd -P "$cdup" || {
+		cdup=$(git rev-parse --show-toplevel)
+		cd "$cdup" || {
 			echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree"
 			exit 1
 		}
-- 
1.6.4

^ permalink raw reply related

* [PATCH 1/2] Add 'git rev-parse --show-toplevel' option.
From: Steven Drake @ 2010-01-10  7:19 UTC (permalink / raw)
  To: git

 Shows the absolute path of the top-level working directory.
---
 Documentation/git-rev-parse.txt |    3 +++
 builtin-rev-parse.c             |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 82045a2..dc829b3 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -112,6 +112,9 @@ OPTIONS
 --remotes::
 	Show tag refs found in `$GIT_DIR/refs/remotes`.
 
+--show-toplevel::
+	Show the absolute path of the top-level directory.
+
 --show-prefix::
 	When the command is invoked from a subdirectory, show the
 	path of the current directory relative to the top-level
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 37d0233..96ab8bb 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -581,6 +581,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
 				for_each_remote_ref(show_reference, NULL);
 				continue;
 			}
+			if (!strcmp(arg, "--show-toplevel")) {
+				const char *work_tree = get_git_work_tree();
+				if (work_tree)
+					printf("%s\n", work_tree);
+				continue;
+			}
 			if (!strcmp(arg, "--show-prefix")) {
 				if (prefix)
 					puts(prefix);
-- 
1.6.4

^ permalink raw reply related

* Re: Linking multiple Git repositories for version tracking
From: Christoph Jahn @ 2010-01-10  8:12 UTC (permalink / raw)
  To: git
In-Reply-To: <op.u574cwxqn3qeew@klee>

I have had the very same issue a while ago when still using SVN (shame on 
me ;-). SVN offers a special tag "svn:externals" which is something like 
symlinks. Having used it for a while I came to the conclusion that such a 
thing, as well-intentioned as it may be, is something I want to avoid by 
all means.

There are two reasons for that:
- Lock-in
- It is conceptually wrong

The conceptual part -which I consider to be more important- is mostly 
about the fact that we are talking about dependency management and not 
version control any more. Do I really want to "hide" dependencies inside 
the VCS? Also, there may be different dependencies for compilation and 
testing. That's why I chose to use Maven for this task.

My $0.02

-- 
Best regards,
Christoph

^ permalink raw reply

* Re: [PATCH 2/2] Use $(git rev-parse --show-toplevel) in cd_to_toplevel()
From: Jonathan Nieder @ 2010-01-10 10:11 UTC (permalink / raw)
  To: Steven Drake; +Cc: git
In-Reply-To: <alpine.LNX.2.00.1001102016380.2560@vqena.qenxr.bet.am>

Steven Drake wrote:

> 'cd -P' is not supported by all shell implementations.

Makes sense.

git already does not handle those cases where 'cd "$(pwd)"' fails
while 'cd .' does not, so your patch shouldn’t break anything. [1]

> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index dfcb807..3cbec05 100755
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -120,16 +120,10 @@ is_bare_repository () {
>  }
>  
>  cd_to_toplevel () {
> -	cdup=$(git rev-parse --show-cdup)
> -	if test ! -z "$cdup"
> +	if test ! -z "$(git rev-parse --show-cdup)"
>  	then
> -		# The "-P" option says to follow "physical" directory
> -		# structure instead of following symbolic links.  When cdup is
> -		# "../", this means following the ".." entry in the current
> -		# directory instead textually removing a symlink path element
> -		# from the PWD shell variable.  The "-P" behavior is more
> -		# consistent with the C-style chdir used by most of Git.
> -		cd -P "$cdup" || {
> +		cdup=$(git rev-parse --show-toplevel)
> +		cd "$cdup" || {

Why not 'cdup=$(git rev-parse --show-toplevel) && cd "$cdup"'
unconditionally?  That would avoid having to look for the .git dir
twice and would mirror setup_work_tree() a bit more closely.

Avoiding -P not only improves portability but makes the function
easier to understand.  I like it.

Thanks,
Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/135563/focus=135571

^ permalink raw reply

* Re: [PATCH] git-p4: Fix empty submit template when editor fires up
From: Jonathan Nieder @ 2010-01-10 11:11 UTC (permalink / raw)
  To: Kevin Leung; +Cc: git, Simon Hausmann, gitster
In-Reply-To: <1262235876-1239-1-git-send-email-kevinlsk@gmail.com>

Kevin Leung wrote:
> read_pipe() returns "\n". We need to remove it before passing it
> to system().
> 
> Signed-off-by: Kevin Leung <kevinlsk@gmail.com>

If I understand correctly, this is a cosmetic change: os.system()
calls system(3), which uses 'sh -c', which has no problem coping with
an extra newline at the end.  So 'need' seems too strong a word.
Still, the change sounds sensible.

> ---
>  contrib/fast-import/git-p4 |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index 0cef242..04bf4f4 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -732,8 +732,8 @@ class P4Submit(Command):
>              if os.environ.has_key("P4EDITOR"):
>                  editor = os.environ.get("P4EDITOR")
>              else:
> -                editor = read_pipe("git var GIT_EDITOR")
> -            system(editor + " " + fileName)
> +                editor = read_pipe("git var GIT_EDITOR").strip()
> +            system("%s %s" % (editor, fileName))
>  
>              response = "y"
>              if os.stat(fileName).st_mtime <= mtime:
> -- 

What is the rationale for the rewritten system() line?  I would have
understood a change to

	os.spawnlp("sh", "-c", editor + " \"$@\"", fileName)

for better behavior when TMPDIR contains shell metacharacters, but
even this has nothing to do with read_pipe() returning a trailing
newline.

Just my two cents,
Jonathan

^ permalink raw reply

* How to check new commit availability without full fetch?
From: Leo Razoumov @ 2010-01-10 11:12 UTC (permalink / raw)
  To: Git Mailing List

Hi List,
I am trying to find a way to check availability of new commits
*before* doing fetch or pull. Unfortunately, neither fetch nor pull
take "--dry-run" option (unlike push)
I am sure I am not the only one with such an itch.

Any help and advice are greatly appreciated.

--Leo--

^ permalink raw reply

* Re: [PATCH] git-p4: Fix empty submit template when editor fires up
From: Jonathan Nieder @ 2010-01-10 11:14 UTC (permalink / raw)
  To: Kevin Leung; +Cc: git, Simon Hausmann, gitster
In-Reply-To: <20100110111153.GA19612@progeny.tock>

Jonathan Nieder wrote:
> Kevin Leung wrote:
> > read_pipe() returns "\n". We need to remove it before passing it
> > to system().
> > 
> > Signed-off-by: Kevin Leung <kevinlsk@gmail.com>
> 
> If I understand correctly, this is a cosmetic change:

... and of course I didn't the subject.  Sorry about that.  Thanks
for cleaning up my mess.

Acked-by: Jonathan Nieder <jrnieder@gmail.com>

> What is the rationale for the rewritten system() line?  I would have
> understood a change to
> 
> 	os.spawnlp("sh", "-c", editor + " \"$@\"", fileName)

I am still curious about this, though it is not so important.

Jonathan

^ permalink raw reply

* Саня *** Ti-3 *** Бурим добавил Вас в друзья на сайте ВКонтакте.ру
From: ВКонтакте.ру @ 2010-01-10 11:42 UTC (permalink / raw)
  To: Здравствуйте

Здравствуйте,

Саня *** Ti-3 *** Бурим добавил Вас в друзья на сайте ВКонтакте.ру

Вы можете зайти на сайт и просмотреть страницы Ваших друзей, используя
Ваш e-mail и автоматически созданный пароль: 6eoRw9MC

ВКонтакте.ру - сайт, который ежедневно позволяет десяткам миллионов людей находить старых друзей и оставаться с ними на связи, делиться фотографиями
и событиями из жизни.

Чтобы войти на сайт, пройдите по ссылке:
http://vk.com/login.php?regemail=git@vger.kernel.org#6eoRw9MC

Внимание: Ваша регистрация не будет активирована, если Вы проигнорируете
это приглашение.

Желаем удачи!
С уважением,
Администрация ВКонтакте.ру

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox