* [PATCH/RFC 1/2] format-patch: demonstrate that color.ui=always produces colorized patches
From: Pang Yan Han @ 2011-09-12 15:56 UTC (permalink / raw)
To: git; +Cc: gitster, peff, martin.von.zweigbergk, sdaoden, ib, Pang Yan Han
In-Reply-To: <1315843016-10959-1-git-send-email-pangyanhan@gmail.com>
commit c9bfb953 (want_color: automatically fallback to color.ui) introduced
a regression where format-patch produces colorized patches when color.ui is
set to "always". Demonstrate this through a new test.
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
---
Hi, I don't know if I actually understand the naming convention for tests
correctly here, so I used the next available number for the last 2 digits.
t/t4051-format-patch-color.sh | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
create mode 100755 t/t4051-format-patch-color.sh
diff --git a/t/t4051-format-patch-color.sh b/t/t4051-format-patch-color.sh
new file mode 100755
index 0000000..db30840
--- /dev/null
+++ b/t/t4051-format-patch-color.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description='format-patch - check for non colorized output'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ echo foo >foo &&
+ git add foo &&
+ git commit -m "commit1" &&
+ echo bar >foo &&
+ git add foo &&
+ git commit -m "commit2"
+'
+
+test_expect_failure 'format patch with ui.color=always generates non colorized patch' '
+ git config color.ui always &&
+ git format-patch -1 &&
+ mv 0001-commit2.patch actual &&
+ test_must_fail grep "\[31m-" actual
+'
+
+test_done
--
1.7.7.rc0.190.g816e
^ permalink raw reply related
* [PATCH/RFC 0/2] format-patch: produce non colorized patches when color.ui=always
From: Pang Yan Han @ 2011-09-12 15:56 UTC (permalink / raw)
To: git; +Cc: gitster, peff, martin.von.zweigbergk, sdaoden, ib, Pang Yan Han
Hi list,
commit c9bfb953 (want_color: automatically fallback to color.ui) introduced
a regression which causes format-patch to produce colorized patches when
color.ui is set to "always".
Since patches are ultimately intended for machine consumption, having color
codes present in them is undesirable.
My understanding of the codebase is very limited. I've looked into builtin/log.c
and the call chain which causes format-patch to produce colorized output is:
git_format_config
|_ git_log_config
|_ git_diff_ui_config
|_ git_color_config
|_ git_config_colorbool
which causes git_use_color_default to be set to 1 when color.ui is set to
"always".
I believe that I can assume that the parsing done in git_diff_ui_config is
related to the [<common diff options>] based on git format-patch manpage?
I've introduced a color_disable function in color.c which changes
git_use_color_default to 0. This is the simplest solution I can see without
heavily touching the stuff in the call chain above since they might be
needed for format-patch.
I understand that this is very hacky but well, I'm really looking for ways
to contribute to Git and this seems like one.
Any advice on how this can be better solved is deeply appreciated.
Thanks.
Pang Yan Han (2):
format-patch: demonstrate that color.ui=always produces colorized
patches
format-patch: produce non colorized patches when ui.color=always
builtin/log.c | 1 +
color.c | 5 +++++
color.h | 1 +
t/t4051-format-patch-color.sh | 23 +++++++++++++++++++++++
4 files changed, 30 insertions(+), 0 deletions(-)
create mode 100755 t/t4051-format-patch-color.sh
--
1.7.7.rc0.190.g816e
^ permalink raw reply
* Re: [PATCH v2 0/7] Improved infrastructure for refname normalization
From: Michael Haggerty @ 2011-09-12 15:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, cmn, A Large Angry SCM
In-Reply-To: <7vehzmbd0o.fsf@alter.siamese.dyndns.org>
On 09/12/2011 06:28 AM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> There were a few minor things that looked worth mentioning while
> reviewing, though.
>
> - (style) You seem to be fond of pre-increment a lot, but in general our
> codebase prefers post-increment especially when the end result does not
> make any difference, e.g.
>
> for (i = 1; ...; ++i) {
> ...
OK, changed.
> - (series structure) It might make the series progress easier to follow
> if you introduced check_ref_format_unsafe() in the same commit where
> you change check_ref_format() to take flags parameter.
OK. I'll take the opportunity to rename the functions to
check_refname_format*(), to make it more obvious that they only concern
themselves with the refnames and not the references themselves.
I discovered a bug in my code for handling refnames without
normalization; I will also fix that in v3.
OTOH I am again having serious doubts that trying to support
unnormalized refnames is a good idea. I will write more when I have
time to argue my case.
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* [PATCH v2] git svn dcommit: new option --interactive.
From: Frédéric Heitzmann @ 2011-09-12 14:57 UTC (permalink / raw)
To: git; +Cc: gitster, normalperson, jaysoffian, Frédéric Heitzmann
Allow the user to check the patch set before it is commited to SNV. It is
then possible to accept/discard one patch, accept all, or quit.
This interactive mode is similar with 'git send email' behaviour. However,
'git svn dcommit' returns as soon as one patch is discarded.
Part of the code was taken from git-send-email.perl (see 'ask' function)
Tests several combinations of potential answers to
'git svn dcommit --interactive'. For each of them, test whether patches
were commited to SVN or not.
Thanks-to Eric Wong <normalperson@yhbt.net> for the initial idea.
Signed-off-by: Frédéric Heitzmann <frederic.heitzmann@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
Documentation/git-svn.txt | 8 +++
git-svn.perl | 76 +++++++++++++++++++++++++++++++-
t/t9160-git-svn-dcommit-interactive.sh | 64 +++++++++++++++++++++++++++
3 files changed, 147 insertions(+), 1 deletions(-)
create mode 100644 t/t9160-git-svn-dcommit-interactive.sh
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index e75fc19..022989f 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -226,6 +226,14 @@ discouraged.
branches, use a single space character between the branches
(`--mergeinfo="/branches/foo:1-10 /branches/bar:3,5-6,8"`)
+--interactive;;
+ Ask the user to confirm that a patch set should actually be sent to SVN.
+ For each patch, one may answer "yes" (accept this patch), "no" (discard this
+ patch), "all" (accept all patches), or "quit".
+ +
+ 'git svn dcommit' returns immediately if answer if "no" or "quit", without
+ commiting anything to SVN.
+
'branch'::
Create a branch in the SVN repository.
diff --git a/git-svn.perl b/git-svn.perl
index d067837..56b6867 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -87,7 +87,7 @@ my ($_stdin, $_help, $_edit,
$_version, $_fetch_all, $_no_rebase, $_fetch_parent,
$_merge, $_strategy, $_dry_run, $_local,
$_prefix, $_no_checkout, $_url, $_verbose,
- $_git_format, $_commit_url, $_tag, $_merge_info);
+ $_git_format, $_commit_url, $_tag, $_merge_info, $_interactive);
$Git::SVN::_follow_parent = 1;
$SVN::Git::Fetcher::_placeholder_filename = ".gitignore";
$_q ||= 0;
@@ -163,6 +163,7 @@ my %cmd = (
'revision|r=i' => \$_revision,
'no-rebase' => \$_no_rebase,
'mergeinfo=s' => \$_merge_info,
+ 'interactive|i' => \$_interactive,
%cmt_opts, %fc_opts } ],
branch => [ \&cmd_branch,
'Create a branch in the SVN repository',
@@ -256,6 +257,27 @@ my %cmd = (
{} ],
);
+use Term::ReadLine;
+package FakeTerm;
+sub new {
+ my ($class, $reason) = @_;
+ return bless \$reason, shift;
+}
+sub readline {
+ my $self = shift;
+ die "Cannot use readline on FakeTerm: $$self";
+}
+package main;
+
+my $term = eval {
+ $ENV{"GIT_SVN_NOTTY"}
+ ? new Term::ReadLine 'git-svn', \*STDIN, \*STDOUT
+ : new Term::ReadLine 'git-svn';
+};
+if ($@) {
+ $term = new FakeTerm "$@: going non-interactive";
+}
+
my $cmd;
for (my $i = 0; $i < @ARGV; $i++) {
if (defined $cmd{$ARGV[$i]}) {
@@ -366,6 +388,36 @@ sub version {
exit 0;
}
+sub ask {
+ my ($prompt, %arg) = @_;
+ my $valid_re = $arg{valid_re};
+ my $default = $arg{default};
+ my $resp;
+ my $i = 0;
+
+ if ( !( defined($term->IN)
+ && defined( fileno($term->IN) )
+ && defined( $term->OUT )
+ && defined( fileno($term->OUT) ) ) ){
+ return defined($default) ? $default : undef;
+ }
+
+ while ($i++ < 10) {
+ $resp = $term->readline($prompt);
+ if (!defined $resp) { # EOF
+ print "\n";
+ return defined $default ? $default : undef;
+ }
+ if ($resp eq '' and defined $default) {
+ return $default;
+ }
+ if (!defined $valid_re or $resp =~ /$valid_re/) {
+ return $resp;
+ }
+ }
+ return undef;
+}
+
sub do_git_init_db {
unless (-d $ENV{GIT_DIR}) {
my @init_db = ('init');
@@ -557,6 +609,28 @@ sub cmd_dcommit {
"If these changes depend on each other, re-running ",
"without --no-rebase may be required."
}
+
+ if (defined $_interactive){
+ my $ask_default = "y";
+ foreach my $d (@$linear_refs){
+ print "debug : d = $d\n";
+ my ($fh, $ctx) = command_output_pipe(qw(show --summary), "$d");
+ while (<$fh>){
+ print $_;
+ }
+ command_close_pipe($fh, $ctx);
+ $_ = ask("Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): ",
+ valid_re => qr/^(?:yes|y|no|n|quit|q|all|a)/i,
+ default => $ask_default);
+ die "Commit this patch reply required" unless defined $_;
+ if (/^[nq]/i) {
+ exit(0);
+ } elsif (/^a/i) {
+ last;
+ }
+ }
+ }
+
my $expect_url = $url;
Git::SVN::remove_username($expect_url);
if (defined($_merge_info)) {
diff --git a/t/t9160-git-svn-dcommit-interactive.sh b/t/t9160-git-svn-dcommit-interactive.sh
new file mode 100644
index 0000000..e38d9fa
--- /dev/null
+++ b/t/t9160-git-svn-dcommit-interactive.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Copyright (c) 2011 Frédéric Heitzmann
+
+test_description='git svn dcommit --interactive series'
+. ./lib-git-svn.sh
+
+test_expect_success 'initialize repo' '
+ svn_cmd mkdir -m"mkdir test-interactive" "$svnrepo/test-interactive" &&
+ git svn clone "$svnrepo/test-interactive" test-interactive &&
+ cd test-interactive &&
+ touch foo && git add foo && git commit -m"foo: first commit" &&
+ git svn dcommit
+ '
+
+test_expect_success 'answers: y [\n] yes' '
+ (
+ echo "change #1" >> foo && git commit -a -m"change #1" &&
+ echo "change #2" >> foo && git commit -a -m"change #2" &&
+ echo "change #3" >> foo && git commit -a -m"change #3" &&
+ ( echo "y
+
+y" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
+ test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn)
+ )
+ '
+
+test_expect_success 'answers: yes yes no' '
+ (
+ echo "change #1" >> foo && git commit -a -m"change #1" &&
+ echo "change #2" >> foo && git commit -a -m"change #2" &&
+ echo "change #3" >> foo && git commit -a -m"change #3" &&
+ ( echo "yes
+yes
+no" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
+ test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
+ git reset --hard remotes/git-svn
+ )
+ '
+
+test_expect_success 'answers: yes quit' '
+ (
+ echo "change #1" >> foo && git commit -a -m"change #1" &&
+ echo "change #2" >> foo && git commit -a -m"change #2" &&
+ echo "change #3" >> foo && git commit -a -m"change #3" &&
+ ( echo "yes
+quit" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
+ test $(git rev-parse HEAD^^^) = $(git rev-parse remotes/git-svn) &&
+ git reset --hard remotes/git-svn
+ )
+ '
+
+test_expect_success 'answers: all' '
+ (
+ echo "change #1" >> foo && git commit -a -m"change #1" &&
+ echo "change #2" >> foo && git commit -a -m"change #2" &&
+ echo "change #3" >> foo && git commit -a -m"change #3" &&
+ ( echo "all" | GIT_SVN_NOTTY=1 git svn dcommit --interactive ) &&
+ test $(git rev-parse HEAD) = $(git rev-parse remotes/git-svn) &&
+ git reset --hard remotes/git-svn
+ )
+ '
+
+test_done
--
1.7.7.rc0.73.g0a352.dirty
^ permalink raw reply related
* Re: [PATCH v2] git-svn: teach git-svn to populate svn:mergeinfo
From: Bryan Jacobs @ 2011-09-12 14:24 UTC (permalink / raw)
To: Eric Wong; +Cc: git, Sam Vilain
In-Reply-To: <20110909222159.GA6530@dcvr.yhbt.net>
On Fri, 9 Sep 2011 15:21:59 -0700
Eric Wong <normalperson@yhbt.net> wrote:
> Some comments inline, but I can clean them up myself and push out in a
> bit.
>
> > --- a/Documentation/git-svn.txt
> > +++ b/Documentation/git-svn.txt
> > @@ -213,6 +213,14 @@ discouraged.
> > store this information (as a property), and svn clients
> > starting from version 1.5 can make use of it. 'git svn' currently
> > does not use it and does not set it automatically.
>
> I noticed this conflicts when applying due to the missing --mergeinfo=
> documentation. Did you intend to remove --mergeinfo entirely and
> replace it with this? I think some folks already depend on it (it's
> been around since last year).
No, that was me munging my patch base. Feel free to set the
documentation for mergeinfo however you like, even documenting this
feature if you wish. The functionality of --mergeinfo still should work
with this patch, although obviously if it's provided the
auto-population will be bypassed.
> > + if (not defined($push_merge_info)
> > + or $push_merge_info eq "false"
> > + or $push_merge_info eq "no"
> > + or $push_merge_info eq "never") {
>
> I missed this the first time, but "||" and "!" are easier for
> C programmers to understand and higher in precedence (ref: perlop
> manpage)
>
You're right, "||" and "!" are better here. TMTOWTDI is the Perl motto,
no? A double-edged sword.
Thanks for the help and review. I'll let you do the cleanup and push
the resulting patch when you feel it's ready (as you suggested), rather
than iterating again for these small changes.
Bryan Jacobs
^ permalink raw reply
* Re: What's cooking in git.git (Sep 2011, #03; Sun, 11)
From: Sverre Rabbelier @ 2011-09-12 8:16 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Junio C Hamano, git
In-Reply-To: <vpqehzm6wrt.fsf@bauges.imag.fr>
Heya,
On Mon, Sep 12, 2011 at 09:32, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> I agree it's not urgent, but this serie doesn't touch the code itself,
> so it should be pretty harmless. It fixes some relatively important
> documentation issues, and a nice side effect of putting them in a
> release soon would be to update the doc available at
> http://www.kernel.org/pub/software/scm/git/docs/git-remote-helpers.html
> (when kernel.org is not down).
Agreed. Do we have a different policy for documentation cooking than
code though?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: Git new-feature-branch best practices
From: Alexey Shumkin @ 2011-09-12 8:02 UTC (permalink / raw)
To: git
In-Reply-To: <1315769475.2560.39.camel@mamburu>
take a look
http://comments.gmane.org/gmane.comp.version-control.git/181129
^ permalink raw reply
* Re: git-p4.skipSubmitEdit
From: Luke Diamand @ 2011-09-12 7:34 UTC (permalink / raw)
To: L. A. Linden Levy, git
In-Reply-To: <1315514452.10046.0.camel@uncle-pecos>
On 08/09/11 21:40, L. A. Linden Levy wrote:
> Hi All,
>
> I have been using git-p4 for a while and it has allowed me to completely
> change the way I develop and still be able to use perforce which my
> company has for its main VCS. One thing that was driving me nuts was
> that "git p4 submit" cycles through all of my individual commits and
> asks me if I want to change them. The way I develop I often am checking
> in 20 to 50 different small commits each with a descriptive git comment.
> I felt like I was doing double duty by having emacs open on every commit
> into perforce. So I modified git-p4 to have an option to skip the
> editor. This option coupled with git-p4.skipSubmitEditCheck will make
> the submission non-interactive for "git p4 submit".
Sorry - I've not had a chance to look at this before now. But a couple
of comments:
- Is there a line wrap problem in the patch? It doesn't seem to want
to apply for me.
- needs an update to the documentation in git-p4.txt
- is there any way to eliminate the slightly ugly
"if/pass/else/do-stuff" construct?
- I'd think if you turned off the editor completely then there's no
point doing the submit-edit-check.
- You probably need to follow the instructions in
Documentation/SubmittingPatches so that Junio will pay attention to the
patch.
Regards!
Luke
>
> Below are the patch and environment results:
>
>
> $ git config -l
> ...
> user.name=Loren A. Linden Levy
> git-p4.skipsubmitedit=true
> git-p4.skipsubmiteditcheck=true
> ...
>
> $ git format-patch origin/master --stdout
>
> From 16c4344de0047cbaf3381eca590a3e59b0d0a25c Mon Sep 17 00:00:00 2001
> From: "Loren A. Linden Levy"<lindenle@gmail.com>
> Date: Thu, 8 Sep 2011 13:37:22 -0700
> Subject: [PATCH] changed git-p4
>
> ---
> contrib/fast-import/git-p4 | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index 2f7b270..a438b3e 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -935,18 +935,23 @@ class P4Submit(Command, P4UserMap):
> tmpFile.write(submitTemplate + separatorLine + diff +
> newdiff)
> tmpFile.close()
> mtime = os.stat(fileName).st_mtime
> - if os.environ.has_key("P4EDITOR"):
> - editor = os.environ.get("P4EDITOR")
> + if gitConfig("git-p4.skipSubmitEdit") == "true":
> + pass
> else:
> - editor = read_pipe("git var GIT_EDITOR").strip()
> - system(editor + " " + fileName)
> -
> + if os.environ.has_key("P4EDITOR"):
> + editor = os.environ.get("P4EDITOR")
> + else:
> + editor = read_pipe("git var GIT_EDITOR").strip()
> +
> + system(editor + " " + fileName)
> +
> if gitConfig("git-p4.skipSubmitEditCheck") == "true":
> checkModTime = False
> else:
> checkModTime = True
>
> response = "y"
> +
> if checkModTime and (os.stat(fileName).st_mtime<= mtime):
> response = "x"
> while response != "y" and response != "n":
^ permalink raw reply
* Re: What's cooking in git.git (Sep 2011, #03; Sun, 11)
From: Matthieu Moy @ 2011-09-12 7:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwrde9t6h.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> * jn/remote-helpers-doc (2011-09-01) 3 commits
> - (short) documentation for the testgit remote helper
> - Documentation/git-remote-helpers: explain how import works with multiple refs
> - Documentation/remote-helpers: explain capabilities first
>
> Not urgent.
I agree it's not urgent, but this serie doesn't touch the code itself,
so it should be pretty harmless. It fixes some relatively important
documentation issues, and a nice side effect of putting them in a
release soon would be to update the doc available at
http://www.kernel.org/pub/software/scm/git/docs/git-remote-helpers.html
(when kernel.org is not down).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* What's cooking in git.git (Sep 2011, #03; Sun, 11)
From: Junio C Hamano @ 2011-09-12 6:21 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'.
Some of the recent patches are fixes to new feature topics already merged
to "master" and are being fast tracked for 1.7.7-rc1, but otherwise
patches for new features and fixes to longstanding issues will stay in
'pu' or 'next' until the 1.7.7 final.
I was hoping that k.org would be back into healthy state soonish and that
is why I haven't tagged the -rc1 yet, but it has already been two weeks,
so sometime in the middle of the coming week -rc1 will happen with or
without k.org repository keeping in sync with us.
In the meantime, here are the repositories that have my integration
branches:
With maint, master, next, pu and todo:
url = git://repo.or.cz/alt-git.git
url = https://code.google.com/p/git-core/
With only maint and master:
url = git://git.sourceforge.jp/gitroot/git-core/git.git
url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
With all the topics and integration branches:
url = https://github.com/gitster/git
--------------------------------------------------
[New Topics]
* hl/iso8601-more-zone-formats (2011-09-09) 2 commits
- fixup? simplification and tightening
- date.c: Support iso8601 timezone formats
* jc/signed-push (2011-09-09) 7 commits
. push -s: support pre-receive-signature hook
. push -s: receiving end
. push -s: send signed push certificate
. push -s: skeleton
. refactor run_receive_hook()
- Split GPG interface into its own helper library
- send-pack: typofix error message
(this branch is tangled with jc/signed-push-3.)
This was the v2 that updated notes tree on the receiving end.
* jc/signed-push-3 (2011-09-09) 4 commits
- push -s: signed push
- rename "match_refs()" to "match_push_refs()"
- Split GPG interface into its own helper library
- send-pack: typofix error message
(this branch is tangled with jc/signed-push.)
This is the third edition, that moves the preparation of the notes tree to
the sending end.
* jc/run-receive-hook-cleanup (2011-09-09) 1 commit
- refactor run_receive_hook()
This is a remnant in the jc/signed-push topic that has become unnecessary
for the purpose of jc/signed-push-3, but is retained for its clean-up
value.
The corresponding one will be dropped when rebuilding the jc/signed-push
topic on top of this topic later.
* jk/for-each-ref (2011-09-08) 5 commits
- for-each-ref: add split message parts to %(contents:*).
- for-each-ref: handle multiline subjects like --pretty
- for-each-ref: refactor subject and body placeholder parsing
- t6300: add more body-parsing tests
- t7004: factor out gpg setup
* wh/normalize-alt-odb-path (2011-09-07) 1 commit
- sha1_file: normalize alt_odb path before comparing and storing
* fk/use-kwset-pickaxe-grep-f (2011-09-11) 2 commits
- obstack.c: Fix some sparse warnings
- sparse: Fix an "Using plain integer as NULL pointer" warning
* jc/make-static (2011-09-11) 2 commits
(merged to 'next' on 2011-09-11 at 2acb0af)
+ vcs-svn: remove unused functions and make some static
+ make-static: master
* jl/maint-fetch-submodule-check-fix (2011-09-09) 1 commit
- fetch: skip on-demand checking when no submodules are configured
* rj/quietly-create-dep-dir (2011-09-11) 1 commit
- Makefile: Make dependency directory creation less noisy
* js/cred-macos-x-keychain (2011-09-11) 1 commit
- contrib: add a credential helper for Mac OS X's keychain
(this branch uses jk/http-auth-keyring.)
* mh/check-ref-format (2011-09-11) 8 commits
- Add tools to avoid the use of unnormalized refnames.
- Do not allow ".lock" at the end of any refname component
- Add a library function normalize_refname()
- Change check_ref_format() to take a flags argument
- fixup asciidoc formatting
- git check-ref-format: add options --allow-onelevel and --refspec-pattern
- Change bad_ref_char() to return a boolean value
- t1402: add some more tests
* mz/remote-rename (2011-09-11) 4 commits
- remote: only update remote-tracking branch if updating refspec
- remote rename: warn when refspec was not updated
- remote: "rename o foo" should not rename ref "origin/bar"
- remote: write correct fetch spec when renaming remote 'remote'
* rj/maint-t9159-svn-rev-notation (2011-09-11) 1 commit
- t9159-*.sh: Add an svn version check
--------------------------------------------------
[Stalled]
* jk/add-i-hunk-filter (2011-07-27) 5 commits
(merged to 'next' on 2011-08-11 at 8ff9a56)
+ add--interactive: add option to autosplit hunks
+ add--interactive: allow negatation of hunk filters
+ add--interactive: allow hunk filtering on command line
+ add--interactive: factor out regex error handling
+ add--interactive: refactor patch mode argument processing
Needs documentation updates, tests, and integration with the higher level
callers, e.g. "git add -p".
* jh/receive-count-limit (2011-05-23) 10 commits
- receive-pack: Allow server to refuse pushes with too many objects
- pack-objects: Estimate pack size; abort early if pack size limit is exceeded
- send-pack/receive-pack: Allow server to refuse pushing too large packs
- pack-objects: Allow --max-pack-size to be used together with --stdout
- send-pack/receive-pack: Allow server to refuse pushes with too many commits
- pack-objects: Teach new option --max-commit-count, limiting #commits in pack
- receive-pack: Prepare for addition of the new 'limit-*' family of capabilities
- Tighten rules for matching server capabilities in server_supports()
- send-pack: Attempt to retrieve remote status even if pack-objects fails
- Update technical docs to reflect side-band-64k capability in receive-pack
Would need another round to separate per-pack and per-session limits.
* jm/mergetool-pathspec (2011-06-22) 2 commits
- mergetool: Don't assume paths are unmerged
- mergetool: Add tests for filename with whitespace
I think this is a good idea, but it probably needs a re-roll.
Cf. $gmane/176254, 176255, 166256
* jk/generation-numbers (2011-09-11) 8 commits
- metadata-cache.c: make two functions static
- limit "contains" traversals based on commit generation
- check commit generation cache validity against grafts
- pretty: support %G to show the generation number of a commit
- commit: add commit_generation function
- add metadata-cache infrastructure
- decorate: allow storing values instead of pointers
- Merge branch 'jk/tag-contains-ab' (early part) into HEAD
The initial "tag --contains" de-pessimization without need for generation
numbers is already in; backburnered.
* sr/transport-helper-fix-rfc (2011-07-19) 2 commits
- t5800: point out that deleting branches does not work
- t5800: document inability to push new branch with old content
* po/cygwin-backslash (2011-08-05) 2 commits
- On Cygwin support both UNIX and DOS style path-names
- git-compat-util: add generic find_last_dir_sep that respects is_dir_sep
I think a further refactoring (no, not my suggestion) was offered?
--------------------------------------------------
[Cooking]
* cb/common-prefix-unification (2011-09-11) 4 commits
- dir.c: make common_prefix_len() static
- rename pathspec_prefix() to common_prefix() and move to dir.[ch]
- consolidate pathspec_prefix and common_prefix
- remove prefix argument from pathspec_prefix
* cb/send-email-help (2011-09-05) 1 commit
- send-email: add option -h
* jc/fetch-pack-fsck-objects (2011-09-04) 3 commits
- test: fetch/receive with fsckobjects
- transfer.fsckobjects: unify fetch/receive.fsckobjects
- fetch.fsckobjects: verify downloaded objects
* jc/receive-verify (2011-09-09) 6 commits
- receive-pack: check connectivity before concluding "git push"
- check_everything_connected(): libify
- check_everything_connected(): refactor to use an iterator
- fetch: verify we have everything we need before updating our ref
- rev-list --verify-object
- list-objects: pass callback data to show_objects()
(this branch uses jc/traverse-commit-list; is tangled with jc/fetch-verify and jc/fetch-verify.)
* tr/doc-note-rewrite (2011-09-05) 1 commit
- Documentation: "on for all" configuration of notes.rewriteRef
It was questioned if the new text suggests a sane and safe thing to do.
* jc/request-pull-show-head (2011-09-06) 1 commit
- State what commit to expect in request-pull
* jn/maint-http-error-message (2011-09-06) 2 commits
- http: avoid empty error messages for some curl errors
- http: remove extra newline in error message
* bk/ancestry-path (2011-08-25) 3 commits
(merged to 'next' on 2011-09-02 at d05ba5d)
+ revision: do not include sibling history in --ancestry-path output
+ revision: keep track of the end-user input from the command line
+ rev-list: Demonstrate breakage with --ancestry-path --all
The topic came up a bit too late in the cycle.
Will cook for a while.
* mg/branch-list (2011-09-08) 6 commits
(merged to 'next' on 2011-09-11 at 20a9cdb)
+ branch: -v does not automatically imply --list
(merged to 'next' on 2011-09-02 at b818eae)
+ branch: allow pattern arguments
+ branch: introduce --list option
+ git-branch: introduce missing long forms for the options
+ git-tag: introduce long forms for the options
+ t6040: test branch -vv
Not urgent; the topic came up a bit too late in the cycle.
* mm/rebase-i-exec-edit (2011-08-26) 2 commits
(merged to 'next' on 2011-09-02 at e75b1b9)
+ rebase -i: notice and warn if "exec $cmd" modifies the index or the working tree
+ rebase -i: clean error message for --continue after failed exec
Not urgent; the topic came up a bit too late in the cycle.
* jk/default-attr (2011-08-26) 1 commit
- attr: map builtin userdiff drivers to well-known extensions
Not urgent; I fixed up the test breakage just for fun.
* hv/submodule-merge-search (2011-08-26) 5 commits
- submodule: Search for merges only at end of recursive merge
- allow multiple calls to submodule merge search for the same path
- submodule: Demonstrate known breakage during recursive merge
- push: Don't push a repository with unpushed submodules
(merged to 'next' on 2011-08-24 at 398e764)
+ push: teach --recurse-submodules the on-demand option
(this branch is tangled with fg/submodule-auto-push.)
Not urgent; the topic came up a bit too late in the cycle.
The bottom one needs to be replaced with a properly written commit log message.
* mm/mediawiki-as-a-remote (2011-09-01) 2 commits
- git-remote-mediawiki: allow push to set MediaWiki metadata
- Add a remote helper to interact with mediawiki (fetch & push)
Fun.
Not urgent; the topic came up a bit too late in the cycle.
* nd/maint-autofix-tag-in-head (2011-08-26) 3 commits
- Accept tags in HEAD or MERGE_HEAD
- merge: remove global variable head[]
- merge: keep stash[] a local variable
Probably needs a re-roll to aim a bit higher.
Not urgent; will not be in 1.7.7.
* bc/unstash-clean-crufts (2011-08-27) 4 commits
(merged to 'next' on 2011-09-02 at 7bfd66f)
+ git-stash: remove untracked/ignored directories when stashed
+ t/t3905: add missing '&&' linkage
+ git-stash.sh: fix typo in error message
+ t/t3905: use the name 'actual' for test output, swap arguments to test_cmp
Not urgent; the topic came up a bit too late in the cycle.
* da/make-auto-header-dependencies (2011-08-30) 1 commit
(merged to 'next' on 2011-09-02 at e04a4af)
+ Makefile: Improve compiler header dependency check
(this branch uses fk/make-auto-header-dependencies.)
Not urgent; will not be in 1.7.7.
* gb/am-hg-patch (2011-08-29) 1 commit
(merged to 'next' on 2011-09-02 at 3edfe4c)
+ am: preliminary support for hg patches
Not urgent; the topic came up a bit too late in the cycle.
* jc/diff-index-unpack (2011-08-29) 3 commits
(merged to 'next' on 2011-09-02 at 4206bd9)
+ diff-index: pass pathspec down to unpack-trees machinery
+ unpack-trees: allow pruning with pathspec
+ traverse_trees(): allow pruning with pathspec
Will cook for a while.
* jn/remote-helpers-doc (2011-09-01) 3 commits
- (short) documentation for the testgit remote helper
- Documentation/git-remote-helpers: explain how import works with multiple refs
- Documentation/remote-helpers: explain capabilities first
Not urgent.
* nm/grep-object-sha1-lock (2011-08-30) 1 commit
(merged to 'next' on 2011-09-02 at 336f57d)
+ grep: Fix race condition in delta_base_cache
Not urgent; the topic came up a bit too late in the cycle.
* tr/mergetool-valgrind (2011-08-30) 1 commit
(merged to 'next' on 2011-09-02 at f5f2c61)
+ Symlink mergetools scriptlets into valgrind wrappers
Not urgent; the topic came up a bit too late in the cycle.
* fg/submodule-auto-push (2011-09-11) 2 commits
(merged to 'next' on 2011-09-11 at 3fc86f7)
+ submodule.c: make two functions static
(merged to 'next' on 2011-08-24 at 398e764)
+ push: teach --recurse-submodules the on-demand option
(this branch is tangled with hv/submodule-merge-search.)
What the topic aims to achieve may make sense, but the implementation
looked somewhat suboptimal.
* jc/fetch-verify (2011-09-01) 3 commits
- fetch: verify we have everything we need before updating our ref
- rev-list --verify-object
- list-objects: pass callback data to show_objects()
(this branch uses jc/traverse-commit-list; is tangled with jc/receive-verify and jc/receive-verify.)
Make "git fetch" verify what it received a bit more carefully before
updating the refs in the receiving end.
Not urgent; the topic came up a bit too late in the cycle.
* jc/traverse-commit-list (2011-08-22) 3 commits
(merged to 'next' on 2011-08-24 at df50dd7)
+ revision.c: update show_object_with_name() without using malloc()
+ revision.c: add show_object_with_name() helper function
+ rev-list: fix finish_object() call
(this branch is used by jc/fetch-verify and jc/receive-verify.)
Not urgent; will not be in 1.7.7.
* fk/make-auto-header-dependencies (2011-08-18) 1 commit
(merged to 'next' on 2011-08-24 at 3da2c25)
+ Makefile: Use computed header dependencies if the compiler supports it
(this branch is used by da/make-auto-header-dependencies.)
Not urgent; will not be in 1.7.7.
* mh/iterate-refs (2011-09-11) 7 commits
- refs.c: make create_cached_refs() static
- Retain caches of submodule refs
- Store the submodule name in struct cached_refs
- Allocate cached_refs objects dynamically
- Change the signature of read_packed_refs()
- Access reference caches only through new function get_cached_refs()
- Extract a function clear_cached_refs()
I did not see anything fundamentally wrong with this series, but it was
unclear what the benefit of these changes are. If the series were to read
parts of the ref hierarchy (like refs/heads/) lazily, the story would
have been different, though.
Not urgent; will not be in 1.7.7.
* hv/submodule-update-none (2011-08-11) 2 commits
(merged to 'next' on 2011-08-24 at 5302fc1)
+ add update 'none' flag to disable update of submodule by default
+ submodule: move update configuration variable further up
Not urgent; will not be in 1.7.7.
* jc/lookup-object-hash (2011-08-11) 6 commits
(merged to 'next' on 2011-08-24 at 5825411)
+ object hash: replace linear probing with 4-way cuckoo hashing
+ object hash: we know the table size is a power of two
+ object hash: next_size() helper for readability
+ pack-objects --count-only
+ object.c: remove duplicated code for object hashing
+ object.c: code movement for readability
I do not think there is anything fundamentally wrong with this series, but
the risk of breakage far outweighs observed performance gain in one
particular workload. Will keep it in 'next' at least for one cycle.
Not urgent; will not be in 1.7.7.
* fg/submodule-git-file-git-dir (2011-08-22) 2 commits
(merged to 'next' on 2011-08-23 at 762194e)
+ Move git-dir for submodules
+ rev-parse: add option --resolve-git-dir <path>
I do not think there is anything fundamentally wrong with this series, but
the risk of breakage outweighs any benefit for having this new
feature. Will keep it in 'next' at least for one cycle.
Not urgent; will not be in 1.7.7.
* jk/http-auth-keyring (2011-09-11) 14 commits
(merged to 'next' on 2011-09-11 at 491ce6a)
+ credentials: make credential_fill_gently() static
(merged to 'next' on 2011-08-03 at b06e80e)
+ credentials: add "getpass" helper
+ credentials: add "store" helper
+ credentials: add "cache" helper
+ docs: end-user documentation for the credential subsystem
+ http: use hostname in credential description
+ allow the user to configure credential helpers
+ look for credentials in config before prompting
+ http: use credential API to get passwords
+ introduce credentials API
+ http: retry authentication failures for all http requests
+ remote-curl: don't retry auth failures with dumb protocol
+ improve httpd auth tests
+ url: decode buffers that are not NUL-terminated
(this branch is used by js/cred-macos-x-keychain.)
Looked mostly reasonable except for the limitation that it is not clear
how to deal with a site at which a user needs to use different passwords
for different repositories. Will keep it in "next" at least for one cycle,
until we start hearing real-world success reports on the list.
Not urgent; will not be in 1.7.7.
* rr/revert-cherry-pick-continue (2011-09-11) 19 commits
(merged to 'next' on 2011-09-11 at 7d78054)
+ builtin/revert.c: make commit_list_append() static
(merged to 'next' on 2011-08-24 at 712c115)
+ revert: Propagate errors upwards from do_pick_commit
+ revert: Introduce --continue to continue the operation
+ revert: Don't implicitly stomp pending sequencer operation
+ revert: Remove sequencer state when no commits are pending
+ reset: Make reset remove the sequencer state
+ revert: Introduce --reset to remove sequencer state
+ revert: Make pick_commits functionally act on a commit list
+ revert: Save command-line options for continuing operation
+ revert: Save data for continuing after conflict resolution
+ revert: Don't create invalid replay_opts in parse_args
+ revert: Separate cmdline parsing from functional code
+ revert: Introduce struct to keep command-line options
+ revert: Eliminate global "commit" variable
+ revert: Rename no_replay to record_origin
+ revert: Don't check lone argument in get_encoding
+ revert: Simplify and inline add_message_to_msg
+ config: Introduce functions to write non-standard file
+ advice: Introduce error_resolve_conflict
Will keep it in 'next' at least for one cycle.
Not urgent; will not be in 1.7.7.
--------------------------------------------------
[Discarded]
* jk/pager-with-alias (2011-08-19) 1 commit
. support pager.* for aliases
* cb/maint-quiet-push (2011-09-05) 4 commits
. t5541: avoid TAP test miscounting
. push: old receive-pack does not understand --quiet
. fix push --quiet via http
. tests for push --quiet
Dropped for rerolling after 1.7.7 cycle.
^ permalink raw reply
* Re: [PATCH 1/3] make-static: master
From: Ramkumar Ramachandra @ 2011-09-12 6:14 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ramsay Jones, GIT Mailing-list
In-Reply-To: <7vhb4in4j7.fsf@alter.siamese.dyndns.org>
Hi Junio,
Junio C Hamano writes:
> Many symbols that are exported to the global scope do not have to be.
>
> Signed-off-by: Junio C Hamano <junio@pobox.com>
> ---
> * To be applied on top of 3793ac5 (RelNotes/1.7.7: minor fixes, 2011-09-07)
> [...]
Awesome! I've seen many similar "make-static" patches come up on the
list, but turned down due to code churn issues. I'm happy to finally
see it being merged. What does this mean: should we try to get such
things merged immediately after a release? On a related note: I'd
also like to know if we can do anything about restructuring the source
tree (moving files around, renaming etc).
Minor nit: I can see commits with "Author: Junio C Hamano
<gitster@pobox.com>", and "Signed-off-by: Junio C Hamano
<junio@pobox.com>" on both 'pu' and 'next'. They seem to be different
people at first glance :)
Thanks.
-- Ram
^ permalink raw reply
* Re: [PATCH] send-mail: Add option to sleep between sending each email.
From: Ramkumar Ramachandra @ 2011-09-12 5:34 UTC (permalink / raw)
To: Junio C Hamano
Cc: Matthieu Moy, Georgi Chorbadzhiyski, Git List, Michael Witten
In-Reply-To: <7vbouvx8j5.fsf@alter.siamese.dyndns.org>
Hi,
Michael Witten writes:
> [...]
> From a quick glance, my patch would appear to have become more advanced,
> as per your own request, Junio:
>
> Message-ID: <7vskkh1va5.fsf@gitster.siamese.dyndns.org>
> http://thread.gmane.org/gmane.comp.version-control.git/116083
Wow, that was over two years ago. I only started contributing to Git
a little over a year and a half ago: no wonder I missed the
discussion. Thanks for digging it out.
Junio C Hamano writes:
> [...]
> IIRC, "git send-email" does its best to force ordering by assigning
> monotonically increasing timestamps on the Date: field, so that the
> recipients can sort the messages based on it, in addition to the
> In-Reply-To field to help threading. I personally do not think there is
> anything more than that that should done in the program.
I agree with Junio here. However, I realize that the patch adds some
value: perhaps we can have it as a script under 'contrib/'?
Thanks.
-- Ram
^ permalink raw reply
* Re: [PATCH] SubmittingPathces: remove Cogito reference
From: Ramkumar Ramachandra @ 2011-09-12 5:25 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Junio C Hamano, Git List
In-Reply-To: <1315744690-6477-1-git-send-email-srabbelier@gmail.com>
Hi Sverre,
Sverre Rabbelier writes:
> Subject: [PATCH] SubmittingPathces: remove Cogito reference
You misspelled SubmittingPatches there. Also, I feel that the subject
is a little misleading. Perhaps something like this instead?
SubmittingPatches: Remove diff tool examples
> [...]
Looks alright otherwise.
Thanks.
-- Ram
^ permalink raw reply
* Re: [PATCH v2 0/7] Improved infrastructure for refname normalization
From: Junio C Hamano @ 2011-09-12 4:28 UTC (permalink / raw)
To: Michael Haggerty; +Cc: git, cmn, A Large Angry SCM
In-Reply-To: <1315637443-14012-1-git-send-email-mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Patch series re-roll:
Thanks for working on this. I very much like the general direction of the
series, the strategy to avoid wholesale audit of the callers and marking
the places that needs fixing with "_unsafe()".
There were a few minor things that looked worth mentioning while
reviewing, though.
- (style) You seem to be fond of pre-increment a lot, but in general our
codebase prefers post-increment especially when the end result does not
make any difference, e.g.
for (i = 1; ...; ++i) {
...
- (series structure) It might make the series progress easier to follow
if you introduced check_ref_format_unsafe() in the same commit where
you change check_ref_format() to take flags parameter.
^ permalink raw reply
* Business transaction.
From: Mr. Daniel Tsai @ 2011-09-11 14:35 UTC (permalink / raw)
To: danieltsai0
Hello my friend. My name is Daniel Tsai and
I live in Hong Kong. I want you to be my
partner in a business transaction of 44.5Million USD.
If you are interested for more details,
you MUST reply me to my private email address:
danieltsai11@yahoo.com.hk or danieltsai95@aol.com
when I get your message, I will tell you what
to do next. Thank you.
Mr. Daniel Tsai
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: Junio C Hamano @ 2011-09-12 1:10 UTC (permalink / raw)
To: BJ Hargrave; +Cc: git
In-Reply-To: <348F09EE-5EE2-4F3E-B1B1-6FD34BDBD117@bjhargrave.com>
BJ Hargrave <bj@bjhargrave.com> writes:
> On Sep 11, 2011, at 16:43 , Junio C Hamano wrote:
>
>> Funny.
>>
>> I am sure we fixed a similar breakage elsewhere a few years ago, by
>> swapping the size and nmemb to the calls (i.e. instead of writing one
>> block of "size" bytes, you could write "size" blocks of 1-byte) and making
>> sure fwrite() reports the number of items. IOW
>>
>> if (buf && fwrite(buf, 1, size, f) != size)
>> die_errno("Could not write '%s'", filename);
>>
>
> Do you want me to resubmit the patch using this technique instead of the size > 0 check?
Not really.
I am not sure when/why we would try to write an empty blob out to begin
with...
^ permalink raw reply
* Re: [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
From: Junio C Hamano @ 2011-09-12 0:06 UTC (permalink / raw)
To: GIT Mailing-list; +Cc: Ramsay Jones
In-Reply-To: <7vobyqn4jh.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> There are many others that can be identified by running the attached
> script after you build your git. I'll follow this message up with three
> consolidated patches, but the latter two needs to be split into smaller
> pieces to be either queued on top (for topics in next) or squashed into
> (for topics in pu), which I am not going to do myself today (hint, hint).
Well, I lied ;-) I've separated things out, queued fix-ups at the tips of
branches, and pushed out the integration result to the public repositories
(other than k.org that seems to be still down).
^ permalink raw reply
* Recorded talk on using git-svn
From: Thomas Ferris Nicolaisen @ 2011-09-11 22:14 UTC (permalink / raw)
To: git
Hi,
I just did a talk at JavaZone this week about using git-svn, and the
recording is now online:
http://vimeo.com/28762003
The demo features normal use of git-svn, plus setup of a git-svn
mirror, using Jenkins to automatically sync the git mirror, and then
putting the mirror on Github.
Maybe some here will find it useful.
^ permalink raw reply
* Re: [PATCH 2/2] obstack.c: Fix some sparse warnings
From: Sverre Rabbelier @ 2011-09-11 21:56 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list
In-Reply-To: <4E6D0B7D.9070602@ramsay1.demon.co.uk>
Heya,
On Sun, Sep 11, 2011 at 21:26, Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
> compat/obstack.c:399:1: error: symbol 'print_and_abort' redeclared with \
> different type (originally declared at compat/obstack.c:95) \
> - different modifiers
> @@ -395,7 +395,6 @@ _obstack_memory_used (struct obstack *h)
> # endif
>
> static void
> -__attribute__ ((noreturn))
> print_and_abort (void)
> {
> /* Don't change any of these strings. Yes, it would be possible to add
Wouldn't the better solution be to add noreturn to the declaration at
compat/obstack.c:95?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH 3/3] Makefile: Make dependency directory creation less noisy
From: Junio C Hamano @ 2011-09-11 21:45 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0EA2.5080406@ramsay1.demon.co.uk>
Thanks.
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: BJ Hargrave @ 2011-09-11 21:43 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vty8iolnj.fsf@alter.siamese.dyndns.org>
On Sep 11, 2011, at 16:43 , Junio C Hamano wrote:
> Funny.
>
> I am sure we fixed a similar breakage elsewhere a few years ago, by
> swapping the size and nmemb to the calls (i.e. instead of writing one
> block of "size" bytes, you could write "size" blocks of 1-byte) and making
> sure fwrite() reports the number of items. IOW
>
> if (buf && fwrite(buf, 1, size, f) != size)
> die_errno("Could not write '%s'", filename);
>
Do you want me to resubmit the patch using this technique instead of the size > 0 check?
--
BJ
^ permalink raw reply
* [PATCH 3/3] make-static: pu
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
This needs to be split into separate patches and squashed into each
individual commit that introduces these symbols.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
dir.c | 2 +-
dir.h | 1 -
metadata-cache.c | 8 ++++----
metadata-cache.h | 5 -----
refs.c | 2 +-
5 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dir.c b/dir.c
index fba6433..bee7ed1 100644
--- a/dir.c
+++ b/dir.c
@@ -34,7 +34,7 @@ static int fnmatch_icase(const char *pattern, const char *string, int flags)
return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
}
-size_t common_prefix_len(const char **pathspec)
+static size_t common_prefix_len(const char **pathspec)
{
const char *n, *first;
size_t max = 0;
diff --git a/dir.h b/dir.h
index 592ceca..9b7bfd4 100644
--- a/dir.h
+++ b/dir.h
@@ -64,7 +64,6 @@ struct dir_struct {
#define MATCHED_RECURSIVELY 1
#define MATCHED_FNMATCH 2
#define MATCHED_EXACTLY 3
-extern size_t common_prefix_len(const char **pathspec);
extern char *common_prefix(const char **pathspec);
extern int match_pathspec(const char **pathspec, const char *name, int namelen, int prefix, char *seen);
extern int match_pathspec_depth(const struct pathspec *pathspec,
diff --git a/metadata-cache.c b/metadata-cache.c
index 32d3c21..5f5ca4e 100644
--- a/metadata-cache.c
+++ b/metadata-cache.c
@@ -287,8 +287,8 @@ static void *lookup_disk(struct metadata_cache *c,
return c->disk_entries + (pos * record_size(c)) + 20;
}
-const void *metadata_cache_lookup(struct metadata_cache *c,
- const struct object *obj)
+static const void *metadata_cache_lookup(struct metadata_cache *c,
+ const struct object *obj)
{
void *r;
@@ -300,8 +300,8 @@ const void *metadata_cache_lookup(struct metadata_cache *c,
return r;
}
-void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
- const void *value)
+static void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
+ const void *value)
{
metadata_cache_init(c);
add_decoration_value(&c->mem, obj, value, NULL);
diff --git a/metadata-cache.h b/metadata-cache.h
index 15484b5..4819563 100644
--- a/metadata-cache.h
+++ b/metadata-cache.h
@@ -24,11 +24,6 @@ struct metadata_cache {
#define METADATA_CACHE_INIT(name, width, validity) \
{ validity, { (name), (width) } }
-const void *metadata_cache_lookup(struct metadata_cache *,
- const struct object *);
-void metadata_cache_add(struct metadata_cache *, const struct object *,
- const void *value);
-
/* Convenience wrappers around metadata_cache_{lookup,add} */
int metadata_cache_lookup_uint32(struct metadata_cache *,
const struct object *,
diff --git a/refs.c b/refs.c
index 1c4aa33..6e9588b 100644
--- a/refs.c
+++ b/refs.c
@@ -185,7 +185,7 @@ static void clear_cached_refs(struct cached_refs *ca)
ca->did_loose = ca->did_packed = 0;
}
-struct cached_refs *create_cached_refs(const char *submodule)
+static struct cached_refs *create_cached_refs(const char *submodule)
{
int len;
struct cached_refs *refs;
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* [PATCH 2/3] make-static: next
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
This needs to be split into separate patches and queued on top of each
individual topic.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/revert.c | 2 +-
credential.c | 46 +++++++++++++++++++++++-----------------------
credential.h | 1 -
submodule.c | 4 ++--
4 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5e97622..515f3cc 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -659,7 +659,7 @@ static void read_and_refresh_cache(struct replay_opts *opts)
* assert(commit_list_count(list) == 2);
* return list;
*/
-struct commit_list **commit_list_append(struct commit *commit,
+static struct commit_list **commit_list_append(struct commit *commit,
struct commit_list **next)
{
struct commit_list *new = xmalloc(sizeof(struct commit_list));
diff --git a/credential.c b/credential.c
index 7a0c751..6243b03 100644
--- a/credential.c
+++ b/credential.c
@@ -171,6 +171,29 @@ static int credential_do(struct credential *c, const char *method,
return r;
}
+static int credential_fill_gently(struct credential *c,
+ const struct string_list *methods)
+{
+ int i;
+
+ if (c->username && c->password)
+ return 0;
+
+ if (!methods)
+ methods = &default_methods;
+
+ if (!methods->nr)
+ return credential_getpass(c);
+
+ for (i = 0; i < methods->nr; i++) {
+ if (!credential_do(c, methods->items[i].string, NULL) &&
+ c->username && c->password)
+ return 0;
+ }
+
+ return -1;
+}
+
void credential_fill(struct credential *c, const struct string_list *methods)
{
struct strbuf err = STRBUF_INIT;
@@ -195,29 +218,6 @@ void credential_fill(struct credential *c, const struct string_list *methods)
die("%s", err.buf);
}
-int credential_fill_gently(struct credential *c,
- const struct string_list *methods)
-{
- int i;
-
- if (c->username && c->password)
- return 0;
-
- if (!methods)
- methods = &default_methods;
-
- if (!methods->nr)
- return credential_getpass(c);
-
- for (i = 0; i < methods->nr; i++) {
- if (!credential_do(c, methods->items[i].string, NULL) &&
- c->username && c->password)
- return 0;
- }
-
- return -1;
-}
-
void credential_reject(struct credential *c, const struct string_list *methods)
{
int i;
diff --git a/credential.h b/credential.h
index 788ed8e..07541ad 100644
--- a/credential.h
+++ b/credential.h
@@ -13,7 +13,6 @@ struct string_list;
int credential_getpass(struct credential *);
void credential_from_config(struct credential *);
-int credential_fill_gently(struct credential *, const struct string_list *methods);
void credential_fill(struct credential *, const struct string_list *methods);
void credential_reject(struct credential *, const struct string_list *methods);
diff --git a/submodule.c b/submodule.c
index 38d9877..5a02890 100644
--- a/submodule.c
+++ b/submodule.c
@@ -318,7 +318,7 @@ static int has_remote(const char *refname, const unsigned char *sha1, int flags,
return 1;
}
-int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
+static int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
{
int *needs_pushing = data;
@@ -352,7 +352,7 @@ int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void
return 1;
}
-int push_submodule(const char *path, const unsigned char sha1[20], void *data)
+static int push_submodule(const char *path, const unsigned char sha1[20], void *data)
{
if (add_submodule_odb(path) || !lookup_commit_reference(sha1))
return 1;
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* [PATCH 1/3] make-static: master
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
Signed-off-by: Junio C Hamano <junio@pobox.com>
---
* To be applied on top of 3793ac5 (RelNotes/1.7.7: minor fixes, 2011-09-07)
builtin.h | 2 --
builtin/notes.c | 4 ++--
cache.h | 2 --
convert.c | 2 +-
convert.h | 1 -
diff.c | 2 +-
diff.h | 1 -
dir.c | 4 ++--
dir.h | 2 --
git-compat-util.h | 5 -----
graph.c | 28 ++++++++++++++++++++++++++--
graph.h | 29 -----------------------------
notes.c | 15 +++++++++++++--
notes.h | 14 --------------
parse-options.c | 2 +-
parse-options.h | 1 -
rerere.c | 2 +-
rerere.h | 1 -
sha1-array.c | 2 +-
sha1-array.h | 1 -
trace.c | 2 +-
wrapper.c | 40 ++++++++++++++++++++--------------------
22 files changed, 69 insertions(+), 93 deletions(-)
diff --git a/builtin.h b/builtin.h
index 0e9da90..8f50a3a 100644
--- a/builtin.h
+++ b/builtin.h
@@ -16,7 +16,6 @@ extern const char git_more_info_string[];
extern void prune_packed_objects(int);
extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
int merge_title, int shortlog_len);
-extern void commit_notes(struct notes_tree *t, const char *msg);
struct notes_rewrite_cfg {
struct notes_tree **trees;
@@ -28,7 +27,6 @@ struct notes_rewrite_cfg {
int mode_from_env;
};
-combine_notes_fn parse_combine_notes_fn(const char *v);
struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd);
int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
const unsigned char *from_obj, const unsigned char *to_obj);
diff --git a/builtin/notes.c b/builtin/notes.c
index f8e437d..34b74ee 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -288,7 +288,7 @@ static int parse_reedit_arg(const struct option *opt, const char *arg, int unset
return parse_reuse_arg(opt, arg, unset);
}
-void commit_notes(struct notes_tree *t, const char *msg)
+static void commit_notes(struct notes_tree *t, const char *msg)
{
struct strbuf buf = STRBUF_INIT;
unsigned char commit_sha1[20];
@@ -312,7 +312,7 @@ void commit_notes(struct notes_tree *t, const char *msg)
strbuf_release(&buf);
}
-combine_notes_fn parse_combine_notes_fn(const char *v)
+static combine_notes_fn parse_combine_notes_fn(const char *v)
{
if (!strcasecmp(v, "overwrite"))
return combine_notes_overwrite;
diff --git a/cache.h b/cache.h
index 607c2ea..e1fc31e 100644
--- a/cache.h
+++ b/cache.h
@@ -709,7 +709,6 @@ int git_mkstemp(char *path, size_t n, const char *template);
int git_mkstemps(char *path, size_t n, const char *template, int suffix_len);
/* set default permissions by passing mode arguments to open(2) */
-int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
int git_mkstemp_mode(char *pattern, int mode);
/*
@@ -1147,7 +1146,6 @@ extern void alloc_report(void);
/* trace.c */
__attribute__((format (printf, 1, 2)))
extern void trace_printf(const char *format, ...);
-extern void trace_vprintf(const char *key, const char *format, va_list ap);
__attribute__((format (printf, 2, 3)))
extern void trace_argv_printf(const char **argv, const char *format, ...);
extern void trace_repo_setup(const char *prefix);
diff --git a/convert.c b/convert.c
index 3bb5a4d..fc74a6e 100644
--- a/convert.c
+++ b/convert.c
@@ -867,7 +867,7 @@ static struct stream_filter null_filter_singleton = {
&null_vtbl,
};
-int is_null_stream_filter(struct stream_filter *filter)
+static int is_null_stream_filter(struct stream_filter *filter)
{
return filter == &null_filter_singleton;
}
diff --git a/convert.h b/convert.h
index d799a165..3d464eb 100644
--- a/convert.h
+++ b/convert.h
@@ -51,7 +51,6 @@ struct stream_filter; /* opaque */
extern struct stream_filter *get_stream_filter(const char *path, const unsigned char *);
extern void free_stream_filter(struct stream_filter *);
-extern int is_null_stream_filter(struct stream_filter *);
/*
* Use as much input up to *isize_p and fill output up to *osize_p;
diff --git a/diff.c b/diff.c
index fcc0078..bd4be32 100644
--- a/diff.c
+++ b/diff.c
@@ -25,7 +25,7 @@
static int diff_detect_rename_default;
static int diff_rename_limit_default = 400;
static int diff_suppress_blank_empty;
-int diff_use_color_default = -1;
+static int diff_use_color_default = -1;
static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
diff --git a/diff.h b/diff.h
index 8c66b59..985bed4 100644
--- a/diff.h
+++ b/diff.h
@@ -230,7 +230,6 @@ extern int parse_long_opt(const char *opt, const char **argv,
extern int git_diff_basic_config(const char *var, const char *value, void *cb);
extern int git_diff_ui_config(const char *var, const char *value, void *cb);
-extern int diff_use_color_default;
extern void diff_setup(struct diff_options *);
extern int diff_opt_parse(struct diff_options *, const char **, int);
extern int diff_setup_done(struct diff_options *);
diff --git a/dir.c b/dir.c
index 08281d2..ebf1de6 100644
--- a/dir.c
+++ b/dir.c
@@ -19,7 +19,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, in
static int get_dtype(struct dirent *de, const char *path, int len);
/* helper string functions with support for the ignore_case flag */
-int strcmp_icase(const char *a, const char *b)
+static int strcmp_icase(const char *a, const char *b)
{
return ignore_case ? strcasecmp(a, b) : strcmp(a, b);
}
@@ -29,7 +29,7 @@ int strncmp_icase(const char *a, const char *b, size_t count)
return ignore_case ? strncasecmp(a, b, count) : strncmp(a, b, count);
}
-int fnmatch_icase(const char *pattern, const char *string, int flags)
+static int fnmatch_icase(const char *pattern, const char *string, int flags)
{
return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
}
diff --git a/dir.h b/dir.h
index 433b5b4..640b18a 100644
--- a/dir.h
+++ b/dir.h
@@ -106,8 +106,6 @@ extern int remove_dir_recursively(struct strbuf *path, int flag);
/* tries to remove the path with empty directories along it, ignores ENOENT */
extern int remove_path(const char *path);
-extern int strcmp_icase(const char *a, const char *b);
extern int strncmp_icase(const char *a, const char *b, size_t count);
-extern int fnmatch_icase(const char *pattern, const char *string, int flags);
#endif
diff --git a/git-compat-util.h b/git-compat-util.h
index 5ef8ff7..3b5648d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -330,7 +330,6 @@ extern char *gitmkdtemp(char *);
#ifdef NO_MKSTEMPS
#define mkstemps gitmkstemps
-extern int gitmkstemps(char *, int);
#endif
#ifdef NO_UNSETENV
@@ -566,10 +565,6 @@ void git_qsort(void *base, size_t nmemb, size_t size,
*/
int unlink_or_warn(const char *path);
/*
- * Likewise for rmdir(2).
- */
-int rmdir_or_warn(const char *path);
-/*
* Calls the correct function out of {unlink,rmdir}_or_warn based on
* the supplied file mode.
*/
diff --git a/graph.c b/graph.c
index 7358416..e013289 100644
--- a/graph.c
+++ b/graph.c
@@ -62,7 +62,22 @@ enum graph_state {
static const char **column_colors;
static unsigned short column_colors_max;
-void graph_set_column_colors(const char **colors, unsigned short colors_max)
+/*
+ * Set up a custom scheme for column colors.
+ *
+ * The default column color scheme inserts ANSI color escapes to colorize
+ * the graph. The various color escapes are stored in an array of strings
+ * where each entry corresponds to a color, except for the last entry,
+ * which denotes the escape for resetting the color back to the default.
+ * When generating the graph, strings from this array are inserted before
+ * and after the various column characters.
+ *
+ * This function allows you to enable a custom array of color escapes.
+ * The 'colors_max' argument is the index of the last "reset" entry.
+ *
+ * This functions must be called BEFORE graph_init() is called.
+ */
+static void graph_set_column_colors(const char **colors, unsigned short colors_max)
{
column_colors = colors;
column_colors_max = colors_max;
@@ -1113,7 +1128,16 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf
graph_update_state(graph, GRAPH_PADDING);
}
-int graph_next_line(struct git_graph *graph, struct strbuf *sb)
+/*
+ * Output the next line for a graph.
+ * This formats the next graph line into the specified strbuf. It is not
+ * terminated with a newline.
+ *
+ * Returns 1 if the line includes the current commit, and 0 otherwise.
+ * graph_next_line() will return 1 exactly once for each time
+ * graph_update() is called.
+ */
+static int graph_next_line(struct git_graph *graph, struct strbuf *sb)
{
switch (graph->state) {
case GRAPH_PADDING:
diff --git a/graph.h b/graph.h
index aff960c..5ddbb1a 100644
--- a/graph.h
+++ b/graph.h
@@ -5,23 +5,6 @@
struct git_graph;
/*
- * Set up a custom scheme for column colors.
- *
- * The default column color scheme inserts ANSI color escapes to colorize
- * the graph. The various color escapes are stored in an array of strings
- * where each entry corresponds to a color, except for the last entry,
- * which denotes the escape for resetting the color back to the default.
- * When generating the graph, strings from this array are inserted before
- * and after the various column characters.
- *
- * This function allows you to enable a custom array of color escapes.
- * The 'colors_max' argument is the index of the last "reset" entry.
- *
- * This functions must be called BEFORE graph_init() is called.
- */
-void graph_set_column_colors(const char **colors, unsigned short colors_max);
-
-/*
* Create a new struct git_graph.
*/
struct git_graph *graph_init(struct rev_info *opt);
@@ -50,18 +33,6 @@ void graph_update(struct git_graph *graph, struct commit *commit);
int graph_is_commit_finished(struct git_graph const *graph);
/*
- * Output the next line for a graph.
- * This formats the next graph line into the specified strbuf. It is not
- * terminated with a newline.
- *
- * Returns 1 if the line includes the current commit, and 0 otherwise.
- * graph_next_line() will return 1 exactly once for each time
- * graph_update() is called.
- */
-int graph_next_line(struct git_graph *graph, struct strbuf *sb);
-
-
-/*
* graph_show_*: helper functions for printing to stdout
*/
diff --git a/notes.c b/notes.c
index 93e9868..d98243f 100644
--- a/notes.c
+++ b/notes.c
@@ -1196,8 +1196,19 @@ void free_notes(struct notes_tree *t)
memset(t, 0, sizeof(struct notes_tree));
}
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags)
+
+/*
+ * Fill the given strbuf with the notes associated with the given object.
+ *
+ * If the given notes_tree structure is not initialized, it will be auto-
+ * initialized to the default value (see documentation for init_notes() above).
+ * If the given notes_tree is NULL, the internal/default notes_tree will be
+ * used instead.
+ *
+ * 'flags' is a bitwise combination of the above formatting flags.
+ */
+static void format_note(struct notes_tree *t, const unsigned char *object_sha1,
+ struct strbuf *sb, const char *output_encoding, int flags)
{
static const char utf8[] = "utf-8";
const unsigned char *sha1;
diff --git a/notes.h b/notes.h
index c716694..3592b19 100644
--- a/notes.h
+++ b/notes.h
@@ -241,20 +241,6 @@ void free_notes(struct notes_tree *t);
#define NOTES_SHOW_HEADER 1
#define NOTES_INDENT 2
-/*
- * Fill the given strbuf with the notes associated with the given object.
- *
- * If the given notes_tree structure is not initialized, it will be auto-
- * initialized to the default value (see documentation for init_notes() above).
- * If the given notes_tree is NULL, the internal/default notes_tree will be
- * used instead.
- *
- * 'flags' is a bitwise combination of the above formatting flags.
- */
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags);
-
-
struct string_list;
struct display_notes_opt {
diff --git a/parse-options.c b/parse-options.c
index 503ab5d..db80155 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -11,7 +11,7 @@ static int parse_options_usage(struct parse_opt_ctx_t *ctx,
#define OPT_SHORT 1
#define OPT_UNSET 2
-int optbug(const struct option *opt, const char *reason)
+static int optbug(const struct option *opt, const char *reason)
{
if (opt->long_name)
return error("BUG: option '%s' %s", opt->long_name, reason);
diff --git a/parse-options.h b/parse-options.h
index 59e0b52..eed93cb 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -165,7 +165,6 @@ extern NORETURN void usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options);
-extern int optbug(const struct option *opt, const char *reason);
extern int opterror(const struct option *opt, const char *reason, int flags);
/*----- incremental advanced APIs -----*/
diff --git a/rerere.c b/rerere.c
index dcb525a..a2e36de 100644
--- a/rerere.c
+++ b/rerere.c
@@ -25,7 +25,7 @@ const char *rerere_path(const char *hex, const char *file)
return git_path("rr-cache/%s/%s", hex, file);
}
-int has_rerere_resolution(const char *hex)
+static int has_rerere_resolution(const char *hex)
{
struct stat st;
return !stat(rerere_path(hex, "postimage"), &st);
diff --git a/rerere.h b/rerere.h
index fcd8bc1..156d2aa 100644
--- a/rerere.h
+++ b/rerere.h
@@ -16,7 +16,6 @@ extern void *RERERE_RESOLVED;
extern int setup_rerere(struct string_list *, int);
extern int rerere(int);
extern const char *rerere_path(const char *hex, const char *file);
-extern int has_rerere_resolution(const char *hex);
extern int rerere_forget(const char **);
extern int rerere_remaining(struct string_list *);
extern void rerere_clear(struct string_list *);
diff --git a/sha1-array.c b/sha1-array.c
index b2f47f9..6f4a224 100644
--- a/sha1-array.c
+++ b/sha1-array.c
@@ -14,7 +14,7 @@ static int void_hashcmp(const void *a, const void *b)
return hashcmp(a, b);
}
-void sha1_array_sort(struct sha1_array *array)
+static void sha1_array_sort(struct sha1_array *array)
{
qsort(array->sha1, array->nr, sizeof(*array->sha1), void_hashcmp);
array->sorted = 1;
diff --git a/sha1-array.h b/sha1-array.h
index 4499b5d..72bb33b 100644
--- a/sha1-array.h
+++ b/sha1-array.h
@@ -11,7 +11,6 @@ struct sha1_array {
#define SHA1_ARRAY_INIT { NULL, 0, 0, 0 }
void sha1_array_append(struct sha1_array *array, const unsigned char *sha1);
-void sha1_array_sort(struct sha1_array *array);
int sha1_array_lookup(struct sha1_array *array, const unsigned char *sha1);
void sha1_array_clear(struct sha1_array *array);
diff --git a/trace.c b/trace.c
index d953416..5ec0e3b 100644
--- a/trace.c
+++ b/trace.c
@@ -62,7 +62,7 @@ static int get_trace_fd(const char *key, int *need_close)
static const char err_msg[] = "Could not trace into fd given by "
"GIT_TRACE environment variable";
-void trace_vprintf(const char *key, const char *fmt, va_list ap)
+static void trace_vprintf(const char *key, const char *fmt, va_list ap)
{
struct strbuf buf = STRBUF_INIT;
diff --git a/wrapper.c b/wrapper.c
index 85f09df..390a7ae 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -236,29 +236,12 @@ int git_mkstemp(char *path, size_t len, const char *template)
return mkstemp(path);
}
-/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
-int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
-{
- const char *tmp;
- size_t n;
-
- tmp = getenv("TMPDIR");
- if (!tmp)
- tmp = "/tmp";
- n = snprintf(path, len, "%s/%s", tmp, template);
- if (len <= n) {
- errno = ENAMETOOLONG;
- return -1;
- }
- return mkstemps(path, suffix_len);
-}
-
/* Adapted from libiberty's mkstemp.c. */
#undef TMP_MAX
#define TMP_MAX 16384
-int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
+static int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
{
static const char letters[] =
"abcdefghijklmnopqrstuvwxyz"
@@ -327,11 +310,28 @@ int git_mkstemp_mode(char *pattern, int mode)
return git_mkstemps_mode(pattern, 0, mode);
}
-int gitmkstemps(char *pattern, int suffix_len)
+static int gitmkstemps(char *pattern, int suffix_len)
{
return git_mkstemps_mode(pattern, suffix_len, 0600);
}
+/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
+int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
+{
+ const char *tmp;
+ size_t n;
+
+ tmp = getenv("TMPDIR");
+ if (!tmp)
+ tmp = "/tmp";
+ n = snprintf(path, len, "%s/%s", tmp, template);
+ if (len <= n) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ return mkstemps(path, suffix_len);
+}
+
int xmkstemp_mode(char *template, int mode)
{
int fd;
@@ -372,7 +372,7 @@ int unlink_or_warn(const char *file)
return warn_if_unremovable("unlink", file, unlink(file));
}
-int rmdir_or_warn(const char *file)
+static int rmdir_or_warn(const char *file)
{
return warn_if_unremovable("rmdir", file, rmdir(file));
}
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* Re: [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
There are many others that can be identified by running the attached
script after you build your git. I'll follow this message up with three
consolidated patches, but the latter two needs to be split into smaller
pieces to be either queued on top (for topics in next) or squashed into
(for topics in pu), which I am not going to do myself today (hint, hint).
#!/usr/bin/perl -w
my %defd = ();
my %used = ();
my %def_ok = map { $_ => 1 } qw(
main
alloc_report
have_git_dir
prepare_git_cmd
print_string_list
tm_to_time_t
unsorted_string_list_has_string
xdl_atol
xdl_cha_first
xdl_cha_next
xdl_mmfile_size
xdl_num_out
xdl_recs_cmp
);
for (<*.o>, <*/*.o>, <*/*/*.o>) {
my $obj = $_;
open(I, "-|", qw(nm -g), $obj) or die;
while (<I>) {
unless (/^[0-9a-f ]+([A-Z]) (\S*)$/) {
print STDERR "? $_";
next;
}
if (($1 eq "U") || $1 eq "C") {
$used{$2}++;
}
else {
push @{$defd{$obj}}, $2;
}
}
close I;
}
for my $obj (sort keys %defd) {
my $syms = $defd{$obj};
for my $sym (@$syms) {
next if exists $used{$sym} or exists $def_ok{$sym};
print "$obj - $sym\n";
}
}
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox