* [PATCH] Disconnect stash from its base commit
From: Nanako Shiraishi @ 2008-07-02 10:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, Olivier Marin
In-Reply-To: <7vskuuoygp.fsf@gitster.siamese.dyndns.org>
A stash records the state of the files in the working tree as a merge
between the HEAD and another commit that records the state of the index,
that in turn is a child commit of the HEAD commit. In order to later
apply (or pop) the stash, however, only the tree objects of these three
commits are necessary.
This patch changes the structure of a stash to use a parentless new commit
that has the same tree as the HEAD commit, in place of the HEAD commit.
This way, a stash does not keep the history that leads to the HEAD commit
reachable, even if the stash is kept forever.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
The patch in the message Olivier quoted alone will be insufficient. This
is an update to that patch.
Documentation/git-stash.txt | 14 +++++++-------
git-stash.sh | 3 +++
t/t3903-stash.sh | 2 +-
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 23ac331..17c65e9 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -101,18 +101,18 @@ DISCUSSION
----------
A stash is represented as a commit whose tree records the state of the
-working directory, and its first parent is the commit at `HEAD` when
-the stash was created. The tree of the second parent records the
+working directory, and its first parent is the commit that has the same
+tree as the `HEAD`. The tree of the second parent records the
state of the index when the stash is made, and it is made a child of
-the `HEAD` commit. The ancestry graph looks like this:
+the first commit. The ancestry graph looks like this:
.----W
/ /
- -----H----I
+ H*---I
-where `H` is the `HEAD` commit, `I` is a commit that records the state
-of the index, and `W` is a commit that records the state of the working
-tree.
+where `H{asterisk}` is a commit with the same tree as the `HEAD`, `I` is
+a commit that records the state of the index, and `W` is a commit that
+records the state of the working tree.
EXAMPLES
diff --git a/git-stash.sh b/git-stash.sh
index 4938ade..8f374b3 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -54,6 +54,9 @@ create_stash () {
fi
msg=$(printf '%s: %s' "$branch" "$head")
+ # create the base commit that is parentless
+ b_commit=$(printf 'base of %s\n' "$msg" | git commit-tree "HEAD:")
+
# state of the index
i_tree=$(git write-tree) &&
i_commit=$(printf 'index on %s\n' "$msg" |
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 54d99ed..b083c04 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -32,7 +32,7 @@ index 0cfbf08..00750ed 100644
EOF
test_expect_success 'parents of stash' '
- test $(git rev-parse stash^) = $(git rev-parse HEAD) &&
+ test $(git rev-parse stash^^{tree}) = $(git rev-parse HEAD^{tree}) &&
git diff stash^2..stash > output &&
test_cmp output expect
'
--
1.5.6
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply related
* Re: [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
From: Marius Storm-Olsen @ 2008-07-02 10:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: prohaska, Johannes Sixt, git, msysgit, Marius Storm-Olsen
In-Reply-To: <7vod5gbpza.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 401 bytes --]
Junio C Hamano said the following on 02.07.2008 11:22:
> Steffen Prohaska <prohaska@zib.de> writes:
>
>> From: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
>>
>> SIGPIPE isn't supported in MinGW.
>
> Shouldn't #ifdef be on SIGPIPE not on __MINGW32__?
That's certainly a good suggestion. :-)
--
.marius [@] storm-olsen [.com]
'if you know what you're doing, it's not research'
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
^ permalink raw reply
* Re: [PATCH/v2] git-basis, a script to manage bases for git-bundle
From: Jakub Narebski @ 2008-07-02 9:44 UTC (permalink / raw)
To: Jeff King; +Cc: Adam Brewster, git
In-Reply-To: <20080702032155.GA13581@sigill.intra.peff.net>
On Wed, 2 July 2008, Jeff King wrote:
>
> Glancing over Junio's comments, though, it might make sense to
> integrate this more tightly with git-bundle, in which case the perl
> stuff would go away. So I'll let you work out with him which is the
> best route.
Well, there is one situation where either separate git-bases program
(which is a good start; it can be named git-bundle--bases; there are
some precedents for that ;-)), or allowing to create 'bases' file
without creating bundle would be good to have. Namely situation
where two computers are _sometimes off-line (disconnected)_. If you
want to transfer new commits from machine B to machine A, you would
generate 'bases' file on machine A, then transfer this file using some
off-line medium, then generate bundle on machine B using those bases,
etc.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
From: Junio C Hamano @ 2008-07-02 9:22 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit, Marius Storm-Olsen
In-Reply-To: <1214987532-23640-4-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> From: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
>
> SIGPIPE isn't supported in MinGW.
Shouldn't #ifdef be on SIGPIPE not on __MINGW32__?
> @@ -100,9 +100,11 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
> i++;
> }
>
> +#ifndef __MINGW32__
> /* sometimes the program was terminated because this signal
> * was received in the process of writing the gpg input: */
> signal(SIGPIPE, SIG_IGN);
> +#endif
^ permalink raw reply
* Re: [PATCH 11/12] verify_path(): do not allow absolute paths
From: Junio C Hamano @ 2008-07-02 9:21 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit, Johannes Schindelin
In-Reply-To: <1214987532-23640-11-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Steffen Prohaska <prohaska@zib.de>
No commit log message? Justification?
^ permalink raw reply
* Re: [PATCH 08/12] fast-import: MinGW does not have getppid(). So do not print it.
From: Junio C Hamano @ 2008-07-02 9:20 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit, Johannes Schindelin
In-Reply-To: <1214987532-23640-8-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> diff --git a/fast-import.c b/fast-import.c
> index e72b286..271b93c 100644
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -391,7 +391,9 @@ static void write_crash_report(const char *err)
>
> fprintf(rpt, "fast-import crash report:\n");
> fprintf(rpt, " fast-import process: %d\n", getpid());
> +#ifndef __MINGW32__
> fprintf(rpt, " parent process : %d\n", getppid());
> +#endif
> fprintf(rpt, " at %s\n", show_date(time(NULL), 0, DATE_LOCAL));
> fputc('\n', rpt);
>
> --
> 1.5.6.1.255.g32571
It does not matter too much for this part that writes crash report, but
keeping the file format the same across platforms will make it easier for
tools to read output, so as a general principle, I think this is a
suboptimal solution to the issue. How about throwing something like this
in MinGW specific header files?
#define getppid() 0
^ permalink raw reply
* Re: [PATCH 07/12] Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
From: Junio C Hamano @ 2008-07-02 9:16 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit, Dmitry Kakurin
In-Reply-To: <1214987532-23640-7-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> From: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
>
> Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
> Signed-off-by: Steffen Prohaska <prohaska@zib.de>
> ---
> convert.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/convert.c b/convert.c
> index 1c66844..f24ac25 100644
> --- a/convert.c
> +++ b/convert.c
> @@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat *
> else
> stats->printable++;
> }
> +
> + // If file ends with EOF then don't count this EOF as non-printable
> + if ( size >= 1 && buf[size-1] == '\032' )
> + stats->nonprintable--;
Style.
I debated for 5 seconds with myself if this should be inside #ifdef, but
doing this everywhere would give us reproducibility --- otherwise the
resulting project won't be cross platform, so I think the intention of
this change is good.
^ permalink raw reply
* Re: [PATCH 05/12] Windows(msysgit): Per default, display help as HTML in default browser
From: Junio C Hamano @ 2008-07-02 9:11 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit
In-Reply-To: <1214987532-23640-5-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> +/* Convert slashes to backslashes on Windows. */
> +char *make_native_separator(char *path);
Makes one onder why it is not inside #ifdef, but presumably it is no-op on
other platforms (which is fine, better than fine)?
> static int show_all = 0;
> +#ifdef __MINGW32__
> +static enum help_format help_format = HELP_FORMAT_WEB;
> +#else
> static enum help_format help_format = HELP_FORMAT_MAN;
> +#endif
That's Ugly isn't it? Can't you do this with Makefile macro without
#ifdef please?
> @@ -644,12 +649,35 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)
>
> static void show_html_page(const char *git_cmd)
> {
> +#ifdef __MINGW32__
> + const char* exec_path = git_exec_path();
> + char *htmlpath = make_native_separator(
> + mkpath("%s/../doc/git/html/%s.html"
> + , exec_path
> + , git_cmd)
> + );
> + if (!file_exists(htmlpath)) {
> + htmlpath = make_native_separator(
> + mkpath("%s/../doc/git/html/git-%s.html"
> + , exec_path
> + , git_cmd)
> + );
> + if (!file_exists(htmlpath)) {
> + fprintf(stderr, "Can't find HTML help for '%s'.\n"
> + , git_cmd);
> + exit(1);
> + }
> + }
> + printf("Launching default browser to display HTML help ...\n");
> + ShellExecute(NULL, "open", htmlpath, NULL, "\\", 0);
> +#else
> const char *page = cmd_to_page(git_cmd);
> struct strbuf page_path; /* it leaks but we exec bellow */
>
> get_html_page_path(&page_path, page);
>
> execl_git_cmd("web--browse", "-c", "help.browser", page_path.buf, NULL);
> +#endif
> }
Hmm. The above almost makes me barf and suggest making them two totally
separate functions (i.e. introduce a new "show_html_page_on_windows()"
function and do not bother us Unix folks ;-).
But I suspect your code is not beyond salvaging. Why is the htmlpath
computed by hand in this function, instead of having the port specific
implementation hidden inside get_html_page_path() function?
About the execution part, isn't it the matter of using "open" (whatever
that is) as one of the supported backend for web--browse to unify these
two independent case arms?
^ permalink raw reply
* Suspicious code in builtin-fast-export.c
From: Johannes Sixt @ 2008-07-02 9:04 UTC (permalink / raw)
To: Pieter de Bie; +Cc: Git Mailing List
export_marks() has this code:
struct object_decoration *deco = idnums.hash;
...
for (i = 0; i < idnums.size; ++i) {
deco++;
if (deco && deco->base && deco->base->type == 1) {
...
}
}
I see that deco is off by one here at the end of the idnums.hash array
(and, btw, the check for 'deco &&' is always true). Indeed, this crashes
on Windows, and I can make it crash on Linux with this patch (which
overallocates a bit and writes junk into that space):
diff --git a/wrapper.c b/wrapper.c
index 4e04f76..658925e 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -72,7 +72,7 @@ void *xrealloc(void *ptr, size_t size)
void *xcalloc(size_t nmemb, size_t size)
{
- void *ret = calloc(nmemb, size);
+ void *ret = calloc(nmemb+1, size);
if (!ret && (!nmemb || !size))
ret = calloc(1, 1);
if (!ret) {
@@ -83,6 +83,7 @@ void *xcalloc(size_t nmemb, size_t size)
if (!ret)
die("Out of memory, calloc failed");
}
+ memset(ret+nmemb*size, 0xDE, size);
return ret;
}
--
1.5.6.64.gd77fe
^ permalink raw reply related
* Re: [PATCH] git-add--interactive: manual hunk editing mode
From: Thomas Rast @ 2008-07-02 9:03 UTC (permalink / raw)
To: git; +Cc: Jeff King, Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
[Wrong button at first, sorry for the double mail Junio]
Junio C Hamano wrote:
>
> If you change '-' to ' ', or remove '+', then you are temporarily
> reverting the change you have made since HEAD to your working tree copy.
> If you do not change anything, you are taking something that was in your
> working tree copy. Both are simpler and easier to explain operations.
[...]
> Once you start to [support truly free editing of the hunk],
> you would need to worry about the case where
> the hunk extended to include later lines overlaps with the hunk after the
> one we are currently looking at, and run coalesce_overlapping_hunks to
> concatenate them into a larger single hunk. But to be able to do that,
> you would need to keep track of the number of lines in a hunk yourself
> anyway, which would mean that you cannot rely on --recount anymore. The
> extension recently made to "git apply" becomes redundant and unused code.
>
> In short, declaring that you are supporting the use to change ' ' to '-'
> means you are opening a whole can of worms, and I asked the question
> because I did not know if you are really prepared to deal with it.
This issue is why I feed the entire patch (not just the edited hunk)
to git-apply --check. That's really the only promise this feature
makes: if you hand it a patch that does not apply, it will refuse. If
you do hand it a hunk where you manually inserted some extra context,
then added some extra changes that weren't in the original hunk, well,
tough. (You asked for a gun _and_ loaded it _and_ pointed it at your
foot!)
That being said, we could of course add a notice of the form
# Do not edit in any other ways unless you know what you are doing.
if that constitutes appropriate "trigger safety".
- Thomas
--
Thomas Rast
trast@student.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH 02/12] Do not complain about "no common commits" in an empty repo
From: Junio C Hamano @ 2008-07-02 8:58 UTC (permalink / raw)
To: prohaska; +Cc: Johannes Sixt, git, msysgit, Johannes Schindelin
In-Reply-To: <1214987532-23640-2-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> If the repo is empty, we know that already, thank you very much.
> So shut fetch-pack up about that case.
Two complaints.
* What does this have to do with Windows port? Please don't hide a
general interface change in a larger and mostly unrelated topic.
* Do you think people can tell without reading the code in larger context
outside the patch and this commit log text if you are talking about the
case you fetch _into_ an empty repository, or if you are attempting to
fetch _from_ an empty repository, or what? Please try to be a bit
easier for _readers_. Being more redundant and verbose is better than
being too concise.
About the first point, "no common commits" is just a friendly reminder and
not even an error. When you see it, you will learn to expect looooooooong
download session.
I personally happen to agree with the logic of this patch, though --- if
you are fetching into an empty repository, you would already expect that
the download is as big as the other end anyway, so you would not need to
be further reminded about that.
But that is just one-man's opinion. Maybe somebody knows a reason why I
am (and the logic I am agreeing with is) wrong. Maybe not. So make the
"remainder of Windows port" series 11 commits, and send this as a general
interface fix via the normal channel to be discussed, please.
^ permalink raw reply
* Re: [PATCH 3/3] git-branch -v: show the remote tracking statistics
From: Junio C Hamano @ 2008-07-02 8:42 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Ingo Molnar, Bruce Stephens, git
In-Reply-To: <486B3B05.4080006@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
> What do you think about showing the tracking information only if --track
> is supplied? But then even write more information:
>
> * jc/report-tracking 41666f7 diverged 3 vs. 117
> foo 1234567 behind 22
> bar fedcba9 ahead 6
>
> and filter the output to show only tracking branches.
I am not sure about the use of --track option, but now the infrastructure
is clean enough for anybody to paint it in his favorite color, and I do
not care deeply about how it would look like. Discuss away and give me an
applicable patch that the list has concensus on, and I'll apply it.
^ permalink raw reply
* Re: [PATCH] git-add--interactive: manual hunk editing mode
From: Junio C Hamano @ 2008-07-02 8:38 UTC (permalink / raw)
To: Thomas Rast; +Cc: git, Jeff King
In-Reply-To: <200807020900.28690.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> Junio C Hamano wrote:
> ...
>> > +# To remove '-' lines, make them ' ' lines (context).
>> > +# To remove '+' lines, delete them.
>> > +# Lines starting with # will be removed.
>>
>> Don't you want to say "Do not touch lines that begin with ' '"?
>
> Why? You can make them '-' instead if you really want to :-)
If you change '-' to ' ', or remove '+', then you are temporarily
reverting the change you have made since HEAD to your working tree copy.
If you do not change anything, you are taking something that was in your
working tree copy. Both are simpler and easier to explain operations.
Once you allow changing ' ' to '-' or insert '+' at random places,
however, you are letting the user commit lines that is neither from HEAD
nor from the working tree.
If the goal of "e" action in "add -i" is to support that operation (I am
not saying that it is a bad thing to support), you have to deal with an
issue that your patch so far did not have to deal with, and it would
require a much larger change to the way how "add -i" is structured.
When you give the user a hunk like this to edit:
@@ -4,9 +4,6 @@ GIT v1.6.0 Release Notes
User visible changes
--------------------
-[[Note that none of these are not merged to 'master' as of this writing
-but they will be before 1.6.0 happens]]
-
With the default Makefile settings, most of the programs are now
installed outside your $PATH, except for "git", "gitk", "git-gui" and
some server side programs that need to be accessible for technical
the user may want to change the line before the line that has "User
visible changes", or the lines toward the end of the hunk. The user may
want to edit the line that ends with "for technical" for rewording the
sentence, but the rest of the sentence is outside the context, and these
lines somehow needs to be summoned to the editing session for completing
the updated sentence. In order to support that, you need to be able to
extend the context on demand in either direction, beyond the original "git
diff" output you captured in $hunk[$i]{TEXT} (sorry, I misspelled this as
$mode->{TEXT} in the previous message).
Once you start to do that, you would need to worry about the case where
the hunk extended to include later lines overlaps with the hunk after the
one we are currently looking at, and run coalesce_overlapping_hunks to
concatenate them into a larger single hunk. But to be able to do that,
you would need to keep track of the number of lines in a hunk yourself
anyway, which would mean that you cannot rely on --recount anymore. The
extension recently made to "git apply" becomes redundant and unused code.
In short, declaring that you are supporting the use to change ' ' to '-'
means you are opening a whole can of worms, and I asked the question
because I did not know if you are really prepared to deal with it.
^ permalink raw reply
* Re: [PATCH 3/3] git-branch -v: show the remote tracking statistics
From: Karl Hasselström @ 2008-07-02 8:33 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Ingo Molnar, Bruce Stephens, git
In-Reply-To: <486B3B05.4080006@viscovery.net>
On 2008-07-02 10:23:33 +0200, Johannes Sixt wrote:
> * jc/report-tracking 41666f7 diverged 3 vs. 117
Or even "ahead 3, behind 117" here. Otherwise the user has to remember
which number is which, which kind of defeats your point. And it's just
one more character.
> foo 1234567 behind 22
> bar fedcba9 ahead 6
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* [PATCH 07/12] Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Dmitry Kakurin, Steffen Prohaska
In-Reply-To: <1214987532-23640-6-git-send-email-prohaska@zib.de>
From: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
convert.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/convert.c b/convert.c
index 1c66844..f24ac25 100644
--- a/convert.c
+++ b/convert.c
@@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat *
else
stats->printable++;
}
+
+ // If file ends with EOF then don't count this EOF as non-printable
+ if ( size >= 1 && buf[size-1] == '\032' )
+ stats->nonprintable--;
}
/*
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 11/12] verify_path(): do not allow absolute paths
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Johannes Schindelin,
Steffen Prohaska
In-Reply-To: <1214987532-23640-10-git-send-email-prohaska@zib.de>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
read-cache.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index f83de8c..cb130ef 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -650,6 +650,11 @@ int verify_path(const char *path)
{
char c;
+#ifdef __MINGW32__
+ if (is_absolute_path(path))
+ return error("Cannot handle absolute path: %s", path);
+#endif
+
goto inside;
for (;;) {
if (!c)
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 09/12] We need to check for msys as well as Windows in add--interactive.
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, msysgit, Junio C Hamano, Mike Pape, Steffen Prohaska
In-Reply-To: <1214987532-23640-8-git-send-email-prohaska@zib.de>
From: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
git-add--interactive.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 903953e..78a64e6 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -42,7 +42,7 @@ sub colored {
my $patch_mode;
sub run_cmd_pipe {
- if ($^O eq 'MSWin32') {
+ if ($^O eq 'MSWin32' || $^O eq 'msys') {
my @invalid = grep {m/[":*]/} @_;
die "$^O does not support: @invalid\n" if @invalid;
my @args = map { m/ /o ? "\"$_\"": $_ } @_;
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 06/12] connect: Fix custom ports with plink (Putty's ssh)
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Edward Z. Yang, Steffen Prohaska
In-Reply-To: <1214987532-23640-5-git-send-email-prohaska@zib.de>
From: Edward Z. Yang <edwardzyang@thewritingpot.com>
PuTTY requires -P while OpenSSH requires -p; if plink is detected
as GIT_SSH, use the alternate flag.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
connect.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/connect.c b/connect.c
index 574f42f..0d007f3 100644
--- a/connect.c
+++ b/connect.c
@@ -599,11 +599,13 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
conn->argv = arg = xcalloc(6, sizeof(*arg));
if (protocol == PROTO_SSH) {
const char *ssh = getenv("GIT_SSH");
+ int putty = ssh && strstr(ssh, "plink");
if (!ssh) ssh = "ssh";
*arg++ = ssh;
if (port) {
- *arg++ = "-p";
+ /* P is for PuTTY, p is for OpenSSH */
+ *arg++ = putty ? "-P" : "-p";
*arg++ = port;
}
*arg++ = host;
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Marius Storm-Olsen,
Steffen Prohaska
In-Reply-To: <1214987532-23640-3-git-send-email-prohaska@zib.de>
From: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
SIGPIPE isn't supported in MinGW.
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
builtin-verify-tag.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c
index 92eaa89..540e3b9 100644
--- a/builtin-verify-tag.c
+++ b/builtin-verify-tag.c
@@ -100,9 +100,11 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
i++;
}
+#ifndef __MINGW32__
/* sometimes the program was terminated because this signal
* was received in the process of writing the gpg input: */
signal(SIGPIPE, SIG_IGN);
+#endif
while (i < argc)
if (verify_tag(argv[i++], verbose))
had_error = 1;
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 12/12] [TODO] setup: bring changes from 4msysgit/next to next
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Johannes Sixt, Dmitry Kakurin,
Steffen Prohaska
In-Reply-To: <1214987532-23640-11-git-send-email-prohaska@zib.de>
From: Johannes Sixt <johannes.sixt@telecom.at>
Hannes,
You introduced "minoffset" in 861429a7c37c7. Here is your original
message:
'''
An earlier patch has implemented getcwd() so that it converts the
drive letter into the POSIX-like path that is used internally by
MinGW (C:\foo => /c/foo), but this style does not work outside
the MinGW shell. It is better to just convert the backslashes
to forward slashes and handle the drive letter explicitly.
'''
Dmitry replaced setenv() with set_git_dir in 855f254b2b5b08.
Here is his original message:
'''
git clone was failing with 'invalid object name HEAD' if ran from
cmd.exe directly
environment.c caches results of many getenv calls.
Under MinGW setenv(X) invalidates all previous values returned by
getenv(X)
so cached values become dangling pointers.
Replaced all setenv(GIT_DIR, ...) with set_git_dir
Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
'''
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
setup.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/setup.c b/setup.c
index 6cf9094..1fd30c4 100644
--- a/setup.c
+++ b/setup.c
@@ -381,6 +381,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
const char *gitdirenv;
const char *gitfile_dir;
int len, offset, ceil_offset;
+ int minoffset = 0;
/*
* Let's assume that we are in a git repository.
@@ -431,6 +432,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
if (!getcwd(cwd, sizeof(cwd)-1))
die("Unable to read current working directory");
+ if (has_dos_drive_prefix(cwd))
+ minoffset = 2;
ceil_offset = longest_ancestor_length(cwd, env_ceiling_dirs);
if (ceil_offset < 0 && has_dos_drive_prefix(cwd))
@@ -461,11 +464,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
inside_git_dir = 1;
if (!work_tree_env)
inside_work_tree = 0;
- setenv(GIT_DIR_ENVIRONMENT, ".", 1);
+ set_git_dir(".");
check_repository_format_gently(nongit_ok);
return NULL;
}
- while (--offset > ceil_offset && cwd[offset] != '/');
+ while (offset > minoffset && --offset > ceil_offset && cwd[offset] != '/');
if (offset <= ceil_offset) {
if (nongit_ok) {
if (chdir(cwd))
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 10/12] Add ANSI control code emulation for the Windows console
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, msysgit, Junio C Hamano, Peter, Steffen Prohaska
In-Reply-To: <1214987532-23640-9-git-send-email-prohaska@zib.de>
From: Peter <git@peter.is-a-geek.org>
This adds only the minimum necessary to keep git pull/merge's diffstat from
wrapping. Notably absent is support for the K (erase) operation, and support
for POSIX write.
Cygwin does not need the WIN_ANSI define, since it has its own (more complete)
ANSI emulation.
Signed-off-by: Peter Harris <git@peter.is-a-geek.org>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
Makefile | 6 +
compat/winansi.c | 309 +++++++++++++++++++++++++++++++++++++++++++++++++++++
git-compat-util.h | 7 ++
3 files changed, 322 insertions(+), 0 deletions(-)
create mode 100644 compat/winansi.c
diff --git a/Makefile b/Makefile
index 5914e1a..a7f2dcb 100644
--- a/Makefile
+++ b/Makefile
@@ -737,6 +737,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_SVN_TESTS = YesPlease
NO_PERL_MAKEMAKER = YesPlease
NO_POSIX_ONLY_PROGRAMS = YesPlease
+ WIN_ANSI = YesPlease
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
@@ -981,6 +982,11 @@ ifdef NO_EXTERNAL_GREP
BASIC_CFLAGS += -DNO_EXTERNAL_GREP
endif
+ifdef WIN_ANSI
+ COMPAT_CFLAGS += -DWIN_ANSI
+ COMPAT_OBJS += compat/winansi.o
+endif
+
ifeq ($(TCLTK_PATH),)
NO_TCLTK=NoThanks
endif
diff --git a/compat/winansi.c b/compat/winansi.c
new file mode 100644
index 0000000..86c3fd2
--- /dev/null
+++ b/compat/winansi.c
@@ -0,0 +1,309 @@
+#include <windows.h>
+#include "../git-compat-util.h"
+
+/*
+ Functions to be wrapped:
+*/
+#undef printf
+#undef fputs
+
+/*
+ ANSI codes to implement: m, K
+*/
+
+static HANDLE console;
+static WORD plain_attr;
+static WORD attr;
+static int negative;
+
+static void init(void)
+{
+ CONSOLE_SCREEN_BUFFER_INFO sbi;
+
+ static int initialized = 0;
+ if (initialized)
+ return;
+
+ console = GetStdHandle(STD_OUTPUT_HANDLE);
+ if (console == INVALID_HANDLE_VALUE)
+ console = NULL;
+
+ if (!console)
+ return;
+
+ GetConsoleScreenBufferInfo(console, &sbi);
+ attr = plain_attr = sbi.wAttributes;
+ negative = 0;
+
+ initialized = 1;
+}
+
+
+#define FOREGROUND_ALL (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
+#define BACKGROUND_ALL (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
+
+static void set_console_attr(void)
+{
+ WORD attributes = attr;
+ if (negative) {
+ attributes &= ~FOREGROUND_ALL;
+ attributes &= ~BACKGROUND_ALL;
+
+ /* This could probably use a bitmask instead of a series of ifs */
+ if (attr & FOREGROUND_RED)
+ attributes |= BACKGROUND_RED;
+ if (attr & FOREGROUND_GREEN)
+ attributes |= BACKGROUND_GREEN;
+ if (attr & FOREGROUND_BLUE)
+ attributes |= BACKGROUND_BLUE;
+
+ if (attr & BACKGROUND_RED)
+ attributes |= FOREGROUND_RED;
+ if (attr & BACKGROUND_GREEN)
+ attributes |= FOREGROUND_GREEN;
+ if (attr & BACKGROUND_BLUE)
+ attributes |= FOREGROUND_BLUE;
+ }
+ SetConsoleTextAttribute(console, attributes);
+}
+
+static const char *set_attr(const char *str)
+{
+ const char *func;
+ size_t len = strspn(str, "0123456789;");
+ func = str + len;
+
+ switch (*func) {
+ case 'm':
+ do {
+ long val = strtol(str, (char **)&str, 10);
+ switch (val) {
+ case 0: /* reset */
+ attr = plain_attr;
+ negative = 0;
+ break;
+ case 1: /* bold */
+ attr |= FOREGROUND_INTENSITY;
+ break;
+ case 2: /* faint */
+ case 22: /* normal */
+ attr &= ~FOREGROUND_INTENSITY;
+ break;
+ case 3: /* italic */
+ /* Unsupported */
+ break;
+ case 4: /* underline */
+ case 21: /* double underline */
+ /* Wikipedia says this flag does nothing */
+ /* Furthermore, mingw doesn't define this flag
+ attr |= COMMON_LVB_UNDERSCORE; */
+ break;
+ case 24: /* no underline */
+ /* attr &= ~COMMON_LVB_UNDERSCORE; */
+ break;
+ case 5: /* slow blink */
+ case 6: /* fast blink */
+ /* We don't have blink, but we do have background intensity */
+ attr |= BACKGROUND_INTENSITY;
+ break;
+ case 25: /* no blink */
+ attr &= ~BACKGROUND_INTENSITY;
+ break;
+ case 7: /* negative */
+ negative = 1;
+ break;
+ case 27: /* positive */
+ negative = 0;
+ break;
+ case 8: /* conceal */
+ case 28: /* reveal */
+ /* Unsupported */
+ break;
+ case 30: /* Black */
+ attr &= ~FOREGROUND_ALL;
+ break;
+ case 31: /* Red */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_RED;
+ break;
+ case 32: /* Green */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_GREEN;
+ break;
+ case 33: /* Yellow */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_RED | FOREGROUND_GREEN;
+ break;
+ case 34: /* Blue */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_BLUE;
+ break;
+ case 35: /* Magenta */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_RED | FOREGROUND_BLUE;
+ break;
+ case 36: /* Cyan */
+ attr &= ~FOREGROUND_ALL;
+ attr |= FOREGROUND_GREEN | FOREGROUND_BLUE;
+ break;
+ case 37: /* White */
+ attr |= FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+ break;
+ case 38: /* Unknown */
+ break;
+ case 39: /* reset */
+ attr &= ~FOREGROUND_ALL;
+ attr |= (plain_attr & FOREGROUND_ALL);
+ break;
+ case 40: /* Black */
+ attr &= ~BACKGROUND_ALL;
+ break;
+ case 41: /* Red */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_RED;
+ break;
+ case 42: /* Green */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_GREEN;
+ break;
+ case 43: /* Yellow */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_RED | BACKGROUND_GREEN;
+ break;
+ case 44: /* Blue */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_BLUE;
+ break;
+ case 45: /* Magenta */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_RED | BACKGROUND_BLUE;
+ break;
+ case 46: /* Cyan */
+ attr &= ~BACKGROUND_ALL;
+ attr |= BACKGROUND_GREEN | BACKGROUND_BLUE;
+ break;
+ case 47: /* White */
+ attr |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE;
+ break;
+ case 48: /* Unknown */
+ break;
+ case 49: /* reset */
+ attr &= ~BACKGROUND_ALL;
+ attr |= (plain_attr & BACKGROUND_ALL);
+ break;
+ default:
+ /* Unsupported code */
+ break;
+ }
+ str++;
+ } while (*(str-1) == ';');
+
+ set_console_attr();
+ break;
+ case 'K':
+ /* TODO */
+ break;
+ default:
+ /* Unsupported code */
+ break;
+ }
+
+ return func + 1;
+}
+
+static int ansi_emulate(const char *str, FILE *stream)
+{
+ int rv = 0;
+ const char *pos = str;
+
+ while (*pos) {
+ pos = strstr(str, "\033[");
+ if (pos) {
+ size_t len = pos - str;
+
+ if (len) {
+ size_t output_len = fwrite(str, 1, len, stream);
+ rv += output_len;
+ if (output_len < len)
+ return rv;
+ }
+
+ str = pos + 2;
+ rv += 2;
+
+ fflush(stream);
+
+ pos = set_attr(str);
+ rv += pos - str;
+ str = pos;
+ } else {
+ rv += strlen(str);
+ fputs(str, stream);
+ return rv;
+ }
+ }
+ return rv;
+}
+
+int git_fputs(const char *str, FILE *stream)
+{
+ int rv;
+
+ init();
+
+ if (!console)
+ return fputs(str, stream);
+
+ if (!isatty(fileno(stream)))
+ return fputs(str, stream);
+
+ rv = ansi_emulate(str, stream);
+
+ if (rv >= 0)
+ return 0;
+ else
+ return EOF;
+}
+
+int git_printf(const char *format, ...)
+{
+ va_list list;
+
+ char small_buf[256];
+ char *buf = small_buf;
+ int len, rv;
+
+ init();
+
+ if (!console)
+ goto abort;
+
+ if (!isatty(fileno(stdout)))
+ goto abort;
+
+ va_start(list, format);
+ len = vsnprintf(small_buf, sizeof(small_buf), format, list);
+ va_end(list);
+
+ if (len > sizeof(small_buf) - 1) {
+ buf = malloc(len + 1);
+ if (!buf)
+ goto abort;
+
+ va_start(list, format);
+ len = vsnprintf(buf, len + 1, format, list);
+ va_end(list);
+ }
+
+ rv = ansi_emulate(buf, stdout);
+
+ if (buf != small_buf)
+ free(buf);
+ return rv;
+
+abort:
+ va_start(list, format);
+ rv = vprintf(format, list);
+ va_end(list);
+ return rv;
+}
diff --git a/git-compat-util.h b/git-compat-util.h
index 545df59..fc5168e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -357,4 +357,11 @@ void git_qsort(void *base, size_t nmemb, size_t size,
# define FORCE_DIR_SET_GID 0
#endif
+#ifdef WIN_ANSI
+extern int git_fputs(const char *str, FILE *stream);
+extern int git_printf(const char *format, ...) __attribute__((format (printf, 1, 2)));
+#define fputs git_fputs
+#define printf(...) git_printf(__VA_ARGS__)
+#endif
+
#endif
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 01/12] Fake reencoding success under NO_ICONV instead of returning NULL.
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Johannes Sixt, Steffen Prohaska
In-Reply-To: <15FB2EE9-298D-41D1-B66A-DDC786282ECB@zib.de>
From: Johannes Sixt <johannes.sixt@telecom.at>
git-am when invoked from git-rebase seems to rely on successful conversion.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
utf8.c | 7 +++++++
utf8.h | 4 ----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/utf8.c b/utf8.c
index dc37353..b07d43e 100644
--- a/utf8.c
+++ b/utf8.c
@@ -388,4 +388,11 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e
iconv_close(conv);
return out;
}
+#else
+char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding)
+{
+ if (!in_encoding)
+ return NULL;
+ return xstrdup(in);
+}
#endif
diff --git a/utf8.h b/utf8.h
index 98cce1b..f22ef31 100644
--- a/utf8.h
+++ b/utf8.h
@@ -10,10 +10,6 @@ int is_encoding_utf8(const char *name);
int print_wrapped_text(const char *text, int indent, int indent2, int len);
-#ifndef NO_ICONV
char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding);
-#else
-#define reencode_string(a,b,c) NULL
-#endif
#endif
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 05/12] Windows(msysgit): Per default, display help as HTML in default browser
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, msysgit, Junio C Hamano, Steffen Prohaska
In-Reply-To: <1214987532-23640-4-git-send-email-prohaska@zib.de>
The implementation directly calls the Win32 API to launch the browser.
Note that the specific directory layout of msysgit is required.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
cache.h | 2 ++
help.c | 28 ++++++++++++++++++++++++++++
path.c | 13 +++++++++++++
3 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/cache.h b/cache.h
index 0d8edda..958d257 100644
--- a/cache.h
+++ b/cache.h
@@ -529,6 +529,8 @@ const char *make_nonrelative_path(const char *path);
const char *make_relative_path(const char *abs, const char *base);
int normalize_absolute_path(char *buf, const char *path);
int longest_ancestor_length(const char *path, const char *prefix_list);
+/* Convert slashes to backslashes on Windows. */
+char *make_native_separator(char *path);
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
extern int sha1_object_info(const unsigned char *, unsigned long *);
diff --git a/help.c b/help.c
index ca9632b..811f8db 100644
--- a/help.c
+++ b/help.c
@@ -9,6 +9,7 @@
#include "common-cmds.h"
#include "parse-options.h"
#include "run-command.h"
+#include "dir.h"
static struct man_viewer_list {
struct man_viewer_list *next;
@@ -28,7 +29,11 @@ enum help_format {
};
static int show_all = 0;
+#ifdef __MINGW32__
+static enum help_format help_format = HELP_FORMAT_WEB;
+#else
static enum help_format help_format = HELP_FORMAT_MAN;
+#endif
static struct option builtin_help_options[] = {
OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
OPT_SET_INT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
@@ -644,12 +649,35 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)
static void show_html_page(const char *git_cmd)
{
+#ifdef __MINGW32__
+ const char* exec_path = git_exec_path();
+ char *htmlpath = make_native_separator(
+ mkpath("%s/../doc/git/html/%s.html"
+ , exec_path
+ , git_cmd)
+ );
+ if (!file_exists(htmlpath)) {
+ htmlpath = make_native_separator(
+ mkpath("%s/../doc/git/html/git-%s.html"
+ , exec_path
+ , git_cmd)
+ );
+ if (!file_exists(htmlpath)) {
+ fprintf(stderr, "Can't find HTML help for '%s'.\n"
+ , git_cmd);
+ exit(1);
+ }
+ }
+ printf("Launching default browser to display HTML help ...\n");
+ ShellExecute(NULL, "open", htmlpath, NULL, "\\", 0);
+#else
const char *page = cmd_to_page(git_cmd);
struct strbuf page_path; /* it leaks but we exec bellow */
get_html_page_path(&page_path, page);
execl_git_cmd("web--browse", "-c", "help.browser", page_path.buf, NULL);
+#endif
}
void help_unknown_cmd(const char *cmd)
diff --git a/path.c b/path.c
index 5983255..2a4a76a 100644
--- a/path.c
+++ b/path.c
@@ -439,3 +439,16 @@ int longest_ancestor_length(const char *path, const char *prefix_list)
return max_len;
}
+
+char *make_native_separator(char* path) {
+#ifdef __MINGW32__
+ char* c;
+ for (c = path; *c; c++) {
+ if (*c == '/')
+ *c = '\\';
+ }
+ return path;
+#else
+ return path;
+#endif
+}
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 08/12] fast-import: MinGW does not have getppid(). So do not print it.
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Johannes Schindelin,
Steffen Prohaska
In-Reply-To: <1214987532-23640-7-git-send-email-prohaska@zib.de>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
fast-import.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index e72b286..271b93c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -391,7 +391,9 @@ static void write_crash_report(const char *err)
fprintf(rpt, "fast-import crash report:\n");
fprintf(rpt, " fast-import process: %d\n", getpid());
+#ifndef __MINGW32__
fprintf(rpt, " parent process : %d\n", getppid());
+#endif
fprintf(rpt, " at %s\n", show_date(time(NULL), 0, DATE_LOCAL));
fputc('\n', rpt);
--
1.5.6.1.255.g32571
^ permalink raw reply related
* [PATCH 02/12] Do not complain about "no common commits" in an empty repo
From: Steffen Prohaska @ 2008-07-02 8:32 UTC (permalink / raw)
To: Johannes Sixt
Cc: git, msysgit, Junio C Hamano, Johannes Schindelin,
Steffen Prohaska
In-Reply-To: <1214987532-23640-1-git-send-email-prohaska@zib.de>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
If the repo is empty, we know that already, thank you very much.
So shut fetch-pack up about that case.
Fixes issue 3, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
builtin-fetch-pack.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index f4dbcf0..2175c6d 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -309,7 +309,8 @@ done:
}
flushes--;
}
- return retval;
+ /* it is no error to fetch into a completely empty repo */
+ return count ? retval : 0;
}
static struct commit_list *complete;
--
1.5.6.1.255.g32571
^ permalink raw reply related
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