git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@padd.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Jonathan Nieder <jrnieder@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] commit, write-tree: allow to ignore CE_INTENT_TO_ADD while writing trees
Date: Mon, 16 Jan 2012 11:46:40 -0500	[thread overview]
Message-ID: <20120116164640.GA3590@padd.com> (raw)
In-Reply-To: <1326681407-6344-3-git-send-email-pclouds@gmail.com>

pclouds@gmail.com wrote on Mon, 16 Jan 2012 09:36 +0700:
> Normally cache-tree will not produce trees from an index that has
> CE_INTENT_TO_ADD entries. This is a safe measure to avoid
> mis-interpreting user's intention regarding this flag.
> 
> There are situations however where users want to create trees/commits
> regardless i-t-a entries. Allow such cases with commit.ignoreIntentToAdd
> for git-commit and --ignore-intent-to-add for git-write-tree.

Recently I tried to use "--intent-to-add" on a new file, but when
committing was annoyed by the confusing error, and that I was
forced to do something with that new file.

With commit.ignoreIntentToAdd I can happily commit while leaving
the new file for later.  It stays in the index and is easy to see
in "git status".

I don't understand the need for an option in write-tree; just the
configuration variable is required.

Here's some changes to the docs you might squash in.  It took me
a while to figure out what this variable was about, and I tried
to explain it more clearly for a non-developer audience.

		-- Pete

--------8<------------
From 2471de7083ca3198f59a4734c0d11e9446874de1 Mon Sep 17 00:00:00 2001
From: Pete Wyckoff <pw@padd.com>
Date: Mon, 16 Jan 2012 11:44:26 -0500
Subject: [PATCH] documentation for commit.ignoreIntentToAdd

---
 Documentation/config.txt  |   13 ++++++++-----
 Documentation/git-add.txt |   15 ++++++++-------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 7ba8777..a2cbb50 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -821,6 +821,14 @@ color.ui::
 	`never` if you prefer git commands not to use color unless enabled
 	explicitly with some other configuration or the `--color` option.
 
+commit.ignoreIntentToAdd::
+	When 'git add' is invoked with `-N`, an "intent-to-add" entry is
+	made in the index.  At commit time, these entries must be removed
+	from the index ("git reset ...") or added ("git add ...").  This
+	boolean variable makes it possible to commit while leaving the
+	"intent-to-add" entries still in the index.  See the description
+	of the `-N` option in linkgit:git-add[1] for details.
+
 commit.status::
 	A boolean to enable/disable inclusion of status information in the
 	commit message template when using an editor to prepare the commit
@@ -831,11 +839,6 @@ commit.template::
 	"{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the
 	specified user's home directory.
 
-commit.ignoreIntentToAdd::
-	Allow to commit the index as-is even if there are
-	intent-to-add entries (see option `-N` in linkgit:git-add[1])
-	in index.
-
 credential.helper::
 	Specify an external helper to be called when a username or
 	password credential is needed; the helper may consult external
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index ec548ea..1c2ac44 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -125,14 +125,15 @@ subdirectories.
 	useful for, among other things, showing the unstaged content of
 	such files with `git diff`.
 +
-Paths added with this option have intent-to-add flag in index. The
-flag is removed once real content is added or updated. By default you
-cannot commit the index as-is from until this flag is removed from all
-entries (i.e. all entries have real content). See commit.ignoreIntentToAdd
-regardless the flag.
+When committing, these paths must be either added to the index (without
+the `-N` flag) or removed (with "git reset").  However, a configuration
+variable `commit.ignoreIntentToAdd` can be set to allow commits to
+proceed, while the intent-to-add paths remain in the index.
 +
-Committing with `git commit -a` or with selected paths works
-regardless the config key and the flag.
+Regardless of the configuration variable, invoking `git commit -a` will
+commit all files including the ones marked with intent-to-add.
+Specifying a <filepattern> can be used to commit files other than the
+ones marked with intent-to-add.
 
 --refresh::
 	Don't add the file(s), but only refresh their stat()
-- 
1.7.9.rc0.18.gdae96

  reply	other threads:[~2012-01-16 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  2:36 [PATCH 0/2] nd/commit-ignore-i-t-a replacement Nguyễn Thái Ngọc Duy
2012-01-16  2:36 ` [PATCH 1/2] cache-tree: update API to take abitrary flags Nguyễn Thái Ngọc Duy
2012-01-16  2:36 ` [PATCH 2/2] commit, write-tree: allow to ignore CE_INTENT_TO_ADD while writing trees Nguyễn Thái Ngọc Duy
2012-01-16 16:46   ` Pete Wyckoff [this message]
2012-01-16 23:21   ` Junio C Hamano
2012-01-17  1:50     ` Nguyen Thai Ngoc Duy
2012-01-17  2:47       ` Jonathan Nieder

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=20120116164640.GA3590@padd.com \
    --to=pw@padd.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    /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).