From: Junio C Hamano <junkio@cox.net>
To: Petr Baudis <pasky@ucw.cz>
Cc: git@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH 1/2] Introduce git-run-with-user-path helper program.
Date: Tue, 17 May 2005 12:27:03 -0700 [thread overview]
Message-ID: <7vk6lxfybc.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20050517190355.GA7136@pasky.ji.cz> (Petr Baudis's message of "Tue, 17 May 2005 21:03:55 +0200")
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
>> +int path_ignored(const char *path)
>> +{
>> + if (!verify_path(path))
>> + return 1;
>> +
>> + /* Put the Porcelain layer ignore logic here.
>> + * Return non-zero if path is to be ignored.
>> + */
>> + return 0;
>> +}
PB> I actually think you shouldn't. All the Porcelain layers should
PB> hopefully use the same git toolkit layer, not each one shipping own due
PB> to differences in things like this.
What you said above _is_ exactly my intention. I phrased that
comment very badly. It should have said:
/* We _will_ put the "ignore logic Porcelain layers agree upon"
* here, once we have a concensus.
*
* The code should return non-zero if path is to be ignored.
*/
I did not put any implementation there because I do not think we
have agreed upon anything yet. This patch is to establish
the framework.
The second patch is separate, because it is _my_ version of the
ignore logic proposal, to serve as a sample. Whatever ignore
logic is agreed upon, that _will_ be in the place you pointed
out and there will be no choice. Everybody _will_ use the
ignore logic.
>> +/****************************************************************/
>> +
>> +/* Path canonicalization part */
PB> And why is this in the library?
Why not? It is something other programs would eventually find
useful.
Also the second patch, a sample implementation of ignore logic I
proposed, wants to know GIT_PROJECT_TOP to figure out the file
pointed at by GIT_DIR/.git/info/ignore-file.
Also it would not hurt if you are always running from the
project top and give only verify_path() approved paths. Then
canon_path would become identity function.
git-run-with-user-path is useful both in implementing
porcelain-add if the porcelain's policy is to take filesystem
paths not GIT paths, like this:
#!/bin/sh
# porcelain-add
exec git-run-with-user-path git-update-cache --add -- -- "$@"
Also if the porcelain's policy is to take GIT paths not
filesystem paths, then users can say:
$ find . ! -type d -print0 |
xargs -0 git-run-with-user-path cg-add --
You cannot use both for obvious reasons.
next prev parent reply other threads:[~2005-05-17 19:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-16 6:05 [PATCH 1/2] Introduce git-run-with-user-path helper program Junio C Hamano
2005-05-17 19:03 ` Petr Baudis
2005-05-17 19:27 ` Junio C Hamano [this message]
2005-05-17 20:35 ` Petr Baudis
2005-05-17 21:18 ` Junio C Hamano
2005-05-17 21:37 ` Petr Baudis
2005-05-17 22:13 ` Junio C Hamano
2005-05-18 21:33 ` Petr Baudis
2005-05-18 22:41 ` Junio C Hamano
2005-05-18 23:24 ` Petr Baudis
2005-05-18 23:56 ` Junio C Hamano
2005-05-19 0:34 ` Linus Torvalds
2005-05-19 20:35 ` Junio C Hamano
2005-05-19 7:40 ` Thomas Glanzmann
2005-05-19 8:23 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2005-05-16 6:04 [PATCH 0/2] Introducing git-run-with-user-path program Junio C Hamano
2005-05-16 23:21 ` Junio C Hamano
2005-05-16 23:40 ` [PATCH 1/2] Introduce git-run-with-user-path helper program Junio C Hamano
2005-05-17 4:15 ` Junio C Hamano
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=7vk6lxfybc.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).