* [PATCH 0/2] Fix the building of Info documents
From: Teemu Likonen @ 2008-12-29 8:03 UTC (permalink / raw)
To: git; +Cc: gitster
In these days Info documents are probably only used by Emacs users. I'm
one, so I wanted to fix the building of Git Info documents. And it's
even possible - to certain extent.
My real opinion is that the document conversion chain .txt - .xml -
.texi - .info. just can't work without a miracle. These patches
certainly don't do a miracle but they allow building an usable Info
version of the user manual and the man pages. As usual, there are
problems with markup conversions. For example, two dashes (--) in a
.texi file turn into one Ascii dash (-), so there are options like
"-interactive" and "-stat" in the Info documents. I wouldn't advertise
these documents very loudly to the public.
(My real real real opinion is that the GNU people should drop the Info
system and start using html instead. Html probably isn't a simple
drop-in replacement but at least it's a relevant format in 2008-2009.)
Teemu Likonen (2):
Fix the building of user-manual.texi and gitman.texi documents
Fix the building of gitman.info document
Documentation/Makefile | 9 +++++----
Documentation/cat-texi.perl | 8 ++++++--
2 files changed, 11 insertions(+), 6 deletions(-)
^ permalink raw reply
* [PATCH 1/2] Fix the building of user-manual.texi and gitman.texi documents
From: Teemu Likonen @ 2008-12-29 8:03 UTC (permalink / raw)
To: git; +Cc: gitster
In-Reply-To: <1230537789-5376-1-git-send-email-tlikonen@iki.fi>
Previously "docbook2x-texi" failed to generate user-manual.texi and
gitman.texi files from .xml input files because "iconv" stopped at
"illegal input sequence" error. This was due to some UTF-8 octets in the
input .xml files. This patch adds option --encoding=UTF-8 for
"docbook2x-texi" to allow the building of .texi files complete.
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---
Documentation/Makefile | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index c34c1ca..c41a7b4 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -187,13 +187,14 @@ git.info: user-manual.texi
user-manual.texi: user-manual.xml
$(RM) $@+ $@
- $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
+ $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout | \
+ $(PERL_PATH) fix-texi.perl >$@+
mv $@+ $@
gitman.texi: $(MAN_XML) cat-texi.perl
$(RM) $@+ $@
- ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \
- $(PERL_PATH) cat-texi.perl $@ >$@+
+ ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
+ --to-stdout $(xml);)) | $(PERL_PATH) cat-texi.perl $@ >$@+
mv $@+ $@
gitman.info: gitman.texi
--
1.6.1.16.gd45c5
^ permalink raw reply related
* [PATCH 2/2] Fix the building of gitman.info document
From: Teemu Likonen @ 2008-12-29 8:03 UTC (permalink / raw)
To: git; +Cc: gitster
In-Reply-To: <1230537789-5376-2-git-send-email-tlikonen@iki.fi>
"makeinfo" failed to generate gitman.info from gitman.texi input file
because the combined manual page file contains several nodes with the
same name (DESCRIPTION, OPTIONS, SEE ALSO etc.). An Info document should
contain unique node names.
This patch creates a simple (read: ugly) work-around by suppressing the
validation of the final Info file. Jumping to nodes in the Info document
still works but they are not very useful. Common man-page headings like
DESCRIPTION and OPTIONS appear in the Info node list and they point to
the man page where they appear first (that is git-add currently).
Also, this patch adds directory-entry information for Info document to
make the document appear in the top-level Info directory.
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---
Documentation/Makefile | 2 +-
Documentation/cat-texi.perl | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index c41a7b4..5cd8b63 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -198,7 +198,7 @@ gitman.texi: $(MAN_XML) cat-texi.perl
mv $@+ $@
gitman.info: gitman.texi
- $(MAKEINFO) --no-split $*.texi
+ $(MAKEINFO) --no-split --no-validate $*.texi
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
$(RM) $@+ $@
diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
index dbc133c..828ec62 100755
--- a/Documentation/cat-texi.perl
+++ b/Documentation/cat-texi.perl
@@ -18,8 +18,12 @@ close TMP;
printf '\input texinfo
@setfilename gitman.info
-@documentencoding us-ascii
-@node Top,,%s
+@documentencoding UTF-8
+@dircategory Development
+@direntry
+* Git Man Pages: (gitman). Manual pages for Git revision control system
+@end direntry
+@node Top,,, (dir)
@top Git Manual Pages
@documentlanguage en
@menu
--
1.6.1.16.gd45c5
^ permalink raw reply related
* Re: [PATCH] http-push: support full URI in handle_remote_ls_ctx()
From: Mike Hommey @ 2008-12-29 7:17 UTC (permalink / raw)
To: Kirill A. Korinskiy; +Cc: Junio C Hamano, git
In-Reply-To: <1230517935-11299-1-git-send-email-catap@catap.ru>
On Mon, Dec 29, 2008 at 05:32:15AM +0300, Kirill A. Korinskiy wrote:
> The program calls remote_ls() to get list of files from the server
> over HTTP; handle_remote_ls_ctx() is used to parse its response to
> populate "struct remote_ls_ctx" that is returned from remote_ls().
>
> The handle_remote_ls_ctx() function assumed that the server returns a
> local path in href field, but RFC 4918 (14.7) demand of support full
> URI (e.g. "http://localhost:8080/repo.git").
>
> This resulted in push failure (e.g. git-http-push issues a PROPFIND
> request to "/repo.git/alhost:8080/repo.git/refs/" to the server).
>
> Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
> ---
> http-push.c | 25 +++++++++++++++++++------
> 1 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/http-push.c b/http-push.c
> index 7c6460919bf3eba10c46cede11ffdd9c53fd2dd2..a4b7d08663504a57008f66a39fffe293f62c1d08 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -87,6 +87,7 @@ static struct object_list *objects;
> struct repo
> {
> char *url;
> + char *path;
> int path_len;
> int has_info_refs;
> int can_update_info_refs;
> @@ -1424,9 +1425,19 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
> ls->userFunc(ls);
> }
> } else if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
> - ls->dentry_name = xmalloc(strlen(ctx->cdata) -
> + char *path = ctx->cdata;
> + if (*ctx->cdata == 'h') {
> + path = strstr(path, "//");
I would make that a "://"
> + if (path) {
> + path = strchr(path+2, '/');
and s/2/3/, accordingly.
But I realize the existing code already does something like what your
are doing...
Mike
^ permalink raw reply
* Re: [PATCH] Documentation/diff-options.txt: unify options
From: jidanni @ 2008-12-29 7:03 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <7vvdt4aj0e.fsf@gitster.siamese.dyndns.org>
(You were right about my previous patch being bad.
At least git-am gives an error message when fed
http://article.gmane.org/gmane.comp.version-control.git/104017/raw
git-apply however does nothing and returns 0! Must be a bug.)
OK, here's a better patch:
Signed-off-by: jidanni <jidanni@jidanni.org>
---
Documentation/diff-options.txt | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index c62b45c..b432d25 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -19,16 +19,12 @@ endif::git-format-patch[]
ifndef::git-format-patch[]
-p::
+-u::
Generate patch (see section on generating patches).
{git-diff? This is the default.}
endif::git-format-patch[]
--u::
- Synonym for "-p".
-
-U<n>::
- Shorthand for "--unified=<n>".
-
--unified=<n>::
Generate diffs with <n> lines of context instead of
the usual three. Implies "-p".
@@ -190,31 +186,25 @@ endif::git-format-patch[]
can name which subdirectory to make the output relative
to by giving a <path> as an argument.
+-a::
--text::
Treat all files as text.
--a::
- Shorthand for "--text".
-
--ignore-space-at-eol::
Ignore changes in whitespace at EOL.
+-b::
--ignore-space-change::
Ignore changes in amount of whitespace. This ignores whitespace
at line end, and considers all other sequences of one or
more whitespace characters to be equivalent.
--b::
- Shorthand for "--ignore-space-change".
-
+-w::
--ignore-all-space::
Ignore whitespace when comparing lines. This ignores
differences even if one line has whitespace where the other
line has none.
--w::
- Shorthand for "--ignore-all-space".
-
--exit-code::
Make the program exit with codes similar to diff(1).
That is, it exits with 1 if there were differences and
--
1.5.6.5
^ permalink raw reply related
* git-add --verbose should say when something is already indexed
From: jidanni @ 2008-12-29 6:46 UTC (permalink / raw)
To: git
git-add or at least git-add --verbose should say upon
$ git-add bla.txt
$ git-add bla.txt
bla.txt is already in the index.
The git-add man page should mention how one can see all the files
added, perhaps by git-ls-files. If so mention in SEE ALSO too.
^ permalink raw reply
* Re: user manual question
From: Dilip M @ 2008-12-29 6:33 UTC (permalink / raw)
To: Sitaram Chamarty; +Cc: git
In-Reply-To: <slrnglg90m.olt.sitaramc@sitaramc.homelinux.net>
On Mon, Dec 29, 2008 at 6:42 AM, <sitaramc@gmail.com> wrote:
> On 2008-12-29, Zorba <cr@altmore.co.uk> wrote:
>> Hi Sitaram!
>>
>> Thanks for clearing that one up.
>
> you're welcome; we've all done a bit of struggling I guess!
>
>> Also, I did wonder about HEAD and head. One can move, the other
>> doesn't! (well, acually it does - head moves "forward", as the tip
>> of the branch grows)
>
> Here's an extract from my notes/internal talks on this:
>
> === basic concepts * a branch is "an active line of
> development" * //master//: default branch in a project, by
> convention * //head//: tip of a branch * a repo can track
> many branches, but the working tree is associated with only one
> branch at a time * //HEAD//: tip of the branch associated with
> the working tree; this is where commits go ** except
> when it's "detached"
That's a nice,compact and effective note. Thanks for sharing :-)
Consider pushing the full notes to GITHUB...would be _useful_ for all of
us..(like me)...
-- dm
^ permalink raw reply
* some git-commands --help don't act like git commands --help
From: jidanni @ 2008-12-29 6:25 UTC (permalink / raw)
To: git
Hmmm, some git-commands --help act just like git commands --help,
$ git commit --help 2>&1|wc -l
336
$ git-commit --help 2>&1|wc -l
336
But others don't
$ git am --help 2>&1|wc -l
152
$ git-am --help 2>&1|wc -l
19
$ git --version
git version 1.5.6.5
on Debian sid.
^ permalink raw reply
* [PATCH] Documentation/git-config.txt: clarify order of option reading
From: jidanni @ 2008-12-29 6:13 UTC (permalink / raw)
To: git
Signed-off-by: jidanni <jidanni@jidanni.org>
---
Documentation/git-config.txt | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 19a8917..34041b1 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -176,6 +176,8 @@ $GIT_DIR/config::
$(prefix)/etc/gitconfig::
System-wide configuration file.
+Options found earlier in this sequence override those found later.
+
If no further options are given, all reading options will read all of these
files that are available. If the global or the system-wide configuration
file are not available they will be ignored. If the repository configuration
--
1.5.6.5
^ permalink raw reply related
* Re: many git sites homepages megabytes big
From: J.H. @ 2008-12-29 5:17 UTC (permalink / raw)
To: jidanni; +Cc: git
In-Reply-To: <87r63r374j.fsf@jidanni.org>
There are lots of reasons fore and against what your proposing, and
there is no good answer. Yes it sends a lot of data, but one could
argue - more data is better than less data.
- John 'Warthog9' Hawley
On Mon, 2008-12-29 at 13:03 +0800, jidanni@jidanni.org wrote:
> I notice the web interfaces to many git sites are very risky to just
> click on. E.g., just clicking http://repo.or.cz/ sends megabytes to
> the users browser. At least the homepage of such sites should be
> something lighter in weight.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* many git sites homepages megabytes big
From: jidanni @ 2008-12-29 5:03 UTC (permalink / raw)
To: git
I notice the web interfaces to many git sites are very risky to just
click on. E.g., just clicking http://repo.or.cz/ sends megabytes to
the users browser. At least the homepage of such sites should be
something lighter in weight.
^ permalink raw reply
* [PATCH] http-push: support full URI in handle_remote_ls_ctx()
From: Kirill A. Korinskiy @ 2008-12-29 2:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Kirill A. Korinskiy
In-Reply-To: <7vmyekag6p.fsf@gitster.siamese.dyndns.org>
The program calls remote_ls() to get list of files from the server
over HTTP; handle_remote_ls_ctx() is used to parse its response to
populate "struct remote_ls_ctx" that is returned from remote_ls().
The handle_remote_ls_ctx() function assumed that the server returns a
local path in href field, but RFC 4918 (14.7) demand of support full
URI (e.g. "http://localhost:8080/repo.git").
This resulted in push failure (e.g. git-http-push issues a PROPFIND
request to "/repo.git/alhost:8080/repo.git/refs/" to the server).
Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
---
http-push.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/http-push.c b/http-push.c
index 7c6460919bf3eba10c46cede11ffdd9c53fd2dd2..a4b7d08663504a57008f66a39fffe293f62c1d08 100644
--- a/http-push.c
+++ b/http-push.c
@@ -87,6 +87,7 @@ static struct object_list *objects;
struct repo
{
char *url;
+ char *path;
int path_len;
int has_info_refs;
int can_update_info_refs;
@@ -1424,9 +1425,19 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
ls->userFunc(ls);
}
} else if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
- ls->dentry_name = xmalloc(strlen(ctx->cdata) -
+ char *path = ctx->cdata;
+ if (*ctx->cdata == 'h') {
+ path = strstr(path, "//");
+ if (path) {
+ path = strchr(path+2, '/');
+ }
+ }
+ if (path) {
+ path += remote->path_len;
+ }
+ ls->dentry_name = xmalloc(strlen(path) -
remote->path_len + 1);
- strcpy(ls->dentry_name, ctx->cdata + remote->path_len);
+ strcpy(ls->dentry_name, path + remote->path_len);
} else if (!strcmp(ctx->name, DAV_PROPFIND_COLLECTION)) {
ls->dentry_flags |= IS_DIR;
}
@@ -2206,10 +2217,11 @@ int main(int argc, char **argv)
if (!remote->url) {
char *path = strstr(arg, "//");
remote->url = arg;
+ remote->path_len = strlen(arg);
if (path) {
- path = strchr(path+2, '/');
- if (path)
- remote->path_len = strlen(path);
+ remote->path = strchr(path+2, '/');
+ if (remote->path)
+ remote->path_len = strlen(remote->path);
}
continue;
}
@@ -2238,8 +2250,9 @@ int main(int argc, char **argv)
rewritten_url = xmalloc(strlen(remote->url)+2);
strcpy(rewritten_url, remote->url);
strcat(rewritten_url, "/");
+ remote->path = rewritten_url + (remote->path - remote->url);
+ remote->path_len++;
remote->url = rewritten_url;
- ++remote->path_len;
}
/* Verify DAV compliance/lock support */
--
1.5.6.5
^ permalink raw reply related
* Re: user manual question
From: Sitaram Chamarty @ 2008-12-29 1:12 UTC (permalink / raw)
To: git
In-Reply-To: <gj96pl$885$4@ger.gmane.org>
On 2008-12-29, Zorba <cr@altmore.co.uk> wrote:
> Hi Sitaram!
>
> Thanks for clearing that one up.
you're welcome; we've all done a bit of struggling I guess!
> Also, I did wonder about HEAD and head. One can move, the other doesn't!
> (well, acually it does - head moves "forward", as the tip of the branch
> grows)
Here's an extract from my notes/internal talks on this:
=== basic concepts
* a branch is "an active line of development"
* //master//: default branch in a project, by convention
* //head//: tip of a branch
* a repo can track many branches, but the working tree is associated with
only one branch at a time
* //HEAD//: tip of the branch associated with the working tree; this is
where commits go
** except when it's "detached"
> Thanks for your other post/reply too - I will be getting back to you on that
> one
Glad to be of help. I don't consider myself a guru, and am
constantly waiting for one of the real gurus to strike me
down with a thunderbolt for saying something stupid :-)
^ permalink raw reply
* Re: user manual question
From: Zorba @ 2008-12-29 0:51 UTC (permalink / raw)
To: git
In-Reply-To: <c94f8e120812280836j4acab974s5139167ac6be54ee@mail.gmail.com>
Hi Dilip,
Thanks for sharing that. It makes me feel not so stupid :-)
regards
>
> +1
>
> I was (am) was initially confused about head and HEAD and assumed that
> they are both same.
>
> -- dm
^ permalink raw reply
* [PATCH] Git.pm: let a "false" Directory parameter (such as "0") be used correctly by the constructor"
From: Philippe Bruhat (BooK) @ 2008-12-29 0:25 UTC (permalink / raw)
To: git; +Cc: Philippe Bruhat (BooK)
---
perl/Git.pm | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 8392a68..ad0f530 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -166,11 +166,12 @@ sub repository {
}
}
- if (not defined $opts{Repository} and not defined $opts{WorkingCopy}) {
- $opts{Directory} ||= '.';
+ if (not defined $opts{Repository} and not defined $opts{WorkingCopy}
+ and not defined $opts{Directory}) {
+ $opts{Directory} = '.';
}
- if ($opts{Directory}) {
+ if (defined $opts{Directory}) {
-d $opts{Directory} or throw Error::Simple("Directory not found: $!");
my $search = Git->repository(WorkingCopy => $opts{Directory});
--
1.6.0.3.517.g759a
^ permalink raw reply related
* Re: user manual question
From: Zorba @ 2008-12-29 0:48 UTC (permalink / raw)
To: git
In-Reply-To: <slrnglf3qh.c7j.sitaramc@sitaramc.homelinux.net>
Hi Sitaram!
Thanks for clearing that one up.
Also, I did wonder about HEAD and head. One can move, the other doesn't!
(well, acually it does - head moves "forward", as the tip of the branch
grows)
you gotta love it
:-)
Thanks for your other post/reply too - I will be getting back to you on that
one
Conor
"Sitaram Chamarty" <sitaramc@gmail.com> wrote in message
news:slrnglf3qh.c7j.sitaramc@sitaramc.homelinux.net...
> On 2008-12-28, Zorba <cr@altmore.co.uk> wrote:
>> Under "Examining an old version without creating a new branch" subsection
>> in
>> chapter1
>>
>> to aid my understanding, could the statement:
>>
>> "The HEAD then refers to the SHA1 of the commit instead of to a branch,
>> and
>> git branch shows that you are no longer on a branch:"
>>
>> be restated more explicitly as:
>>
>> "The HEAD then refers to the SHA1 of the commit instead of to a branch
>> head,
>> and git branch shows that you are no longer on a branch head:"
>
> Sure, but I prefer "tip"; reduces confusion between "head"
> and "HEAD" in spoken descriptions (I teach internal classes
> on git occasionally, once even on a conf call!)
>
> The git glossary makes no mention of "tip", so this is
> probably "unblessed" :-)
>
^ permalink raw reply
* Re: [PATCH] modify/delete conflict resolution overwrites untracked file
From: Clemens Buchacher @ 2008-12-28 23:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, johannes.schindelin, raa.lkml
In-Reply-To: <7v3ag89c0b.fsf@gitster.siamese.dyndns.org>
On Sun, Dec 28, 2008 at 02:21:40PM -0800, Junio C Hamano wrote:
> Clemens Buchacher <drizzd@aon.at> writes:
>
> > I've been giving this some thought and I would like to propose the following
> > solution:
> >
> > 1. Save index state.
> > 2. Merge using whichever strategy, in index only, ignoring work tree.
> > This step includes rename detection.
> > 3. Check that work tree files match original index, if index does not match
> > HEAD. Otherwise abort, restore index and leave everything unchanged.
> > 4. Checkout index, overwriting work tree files, and removing files which are
> > in HEAD, but not in the index.
> > 5. If the merge was clean, commit.
> >
> > AFAICS, this is largely the behavior right now, except that steps 3 and 4
> > are intermingled with step 2, which makes it impossible to abort the merge
> > if an untracked file is in the way after rename detection.
>
> The description of step 3 above may be a bit too sketchy and simplistic,
> but I agree, provided if you are talking about what merge-recursive
> backend does, that is how it ought to do things. The strategy should
> instead:
Actually, I was hoping to find a solution that's independent of the merge
strategy. I think the merge strategy should not have to concern itself with
the work tree at all.
Regarding my description of step 3, I worded it carefully to cover all
cases. My assumption at this stage is that the merge strategy took care not
to overwrite any staged changes, unless the merge is trivial. It is
therefore safe to overwrite the work tree file if it matches either the
original index, or HEAD.
> - have trivial merge done inside the index, likely leveraging
> unpack_trees() three-way merge mechanism we already have, and it will
> allow you to notice and abort upon seeing local modifications in the
> work tree at this stage, except for renamed paths;
Right, but why would we want to do it this early? Is there a performance
issue? If not, I argue that we don't care about the work tree at this stage.
Only the end result matters.
> - notice renames for the unmerged ones and deal with them inside the
> index, still without resolving. E.g. in a merge between A and B, if
> side A deleted "path1" and created a "path2" that is similar to deleted
> "path1", have the ancestor version at stage #1 of "path2", hoist
> "path2" of side A to stage #2, and move the version of "path1" from
> side B and have it at stage #3 of "path2", which would result in an
> index without "path1" in any stage, and "path2" in three stages.
Right. So in this case we do not abort if "path1" had unstaged
changes, because "path1" of B was moved to "path2" anyways. Conversely, if
"path2" had unstaged changes, we do abort, because it would be overwritten
by the merge (or conflict resolution). All this can be decided without any
knowledge about detected renames or the merge strategy used.
> If the other side's rename causes a path to be moved, you can/should
> check and notice local modifications to it at this stage.
>
> You can also notice D/F conflict at this phase (e.g. side B in the
> above example may have created a new path "path2/file1" and the index
> may have stage #3 entry without any other stages for "path2/file1") and
> abort.
>
> - try to resolve unmerged paths inside the index.
>
> Because you matched up possible renames and and adjusted the entries,
> you can resolve aggressively, e.g. a path with identical stage #1 and
> #3 but missing stage #2 results in delete, a path with missing stage #1
> and #2 but with stage #3 results in create, etc.
This should be done before checking for D/F conflicts. If a file ends up
getting removed, the D/F conflict is avoided.
> - notice the paths that need to be written out to the work tree. Paths
> with local changes should have been noticed already in the above, but
> while debugging your new algorithm, you may want to have a logic to
> double check so that you won't miss any. Abort if you find any local
> change that can be clobbered.
>
> - Then, finally, you commit to writing the results out, both the index
> and the work tree. The changes to the work tree may be cleanly merged,
> or an unmerged results with three-way conflict markers.
>
> This way, you will never have "merge stops in halfway because it notices
> it will clobber a local change too late after it has already written a
> partial merge results to the work tree" problem, I think.
Right. So all we have to do is keep unpack_trees() and process_entry() in
merge_trees() from writing to the work tree and delay until after
try_merge_strategy() has completed. Then we check for D/F conflicts and
dirty work tree files before finally checking out the merge result.
Thinking about this now, I wonder what happens if recursive merge has a D/F
conflict in one of its recursions. There is nothing smart it can do, so it
could continue with a D/F conflict in the index, hoping that it goes away in
the final result. So again, D/F conflicts should not matter for the merge
strategy.
> > git merge <branch>
> > # Conflicts? I don't have time for that now.
> > git reset --hard HEAD
> >
> > under all circumstances, without touching any untracked files.
>
> Even though I agree the above without the second line is a good thing to
> have, I think your description is a wrong way to present the desirable
> goal.
[...]
> The issue is about "Crap, if merge has to abort in the middle because it
> has to refrain from writing out a half-merged state out, not to overwrite
> my local changes, it shouldn't have written out anything else to the work
> tree at all. Don't abort in the middle but abort upfront without touching
> my work tree!".
Point taken.
^ permalink raw reply
* [PATCH] doc/git-send-email: mention sendemail.cc config variable
From: Markus Heidelberg @ 2008-12-28 23:37 UTC (permalink / raw)
To: gitster; +Cc: git
This variable was added in 5f8b9fc (git-send-email: add a new
sendemail.cc configuration variable, 2008-04-27), but is not yet refered
to by the documentation.
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
Documentation/git-send-email.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index b69846e..ff4aeff 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -34,6 +34,7 @@ The --bcc option must be repeated for each user you want on the bcc list.
--cc::
Specify a starting "Cc:" value for each email.
+ Default is the value of 'sendemail.cc'.
+
The --cc option must be repeated for each user you want on the cc list.
--
1.6.1.21.g0298
^ permalink raw reply related
* Re: [PATCH] modify/delete conflict resolution overwrites untracked file
From: Junio C Hamano @ 2008-12-28 22:21 UTC (permalink / raw)
To: Clemens Buchacher; +Cc: git, johannes.schindelin, raa.lkml
In-Reply-To: <20081228114445.GA8511@localhost>
Clemens Buchacher <drizzd@aon.at> writes:
> I've been giving this some thought and I would like to propose the following
> solution:
>
> 1. Save index state.
> 2. Merge using whichever strategy, in index only, ignoring work tree.
> This step includes rename detection.
> 3. Check that work tree files match original index, if index does not match
> HEAD. Otherwise abort, restore index and leave everything unchanged.
> 4. Checkout index, overwriting work tree files, and removing files which are
> in HEAD, but not in the index.
> 5. If the merge was clean, commit.
>
> AFAICS, this is largely the behavior right now, except that steps 3 and 4
> are intermingled with step 2, which makes it impossible to abort the merge
> if an untracked file is in the way after rename detection.
The description of step 3 above may be a bit too sketchy and simplistic,
but I agree, provided if you are talking about what merge-recursive
backend does, that is how it ought to do things. The strategy should
instead:
- have trivial merge done inside the index, likely leveraging
unpack_trees() three-way merge mechanism we already have, and it will
allow you to notice and abort upon seeing local modifications in the
work tree at this stage, except for renamed paths;
- notice renames for the unmerged ones and deal with them inside the
index, still without resolving. E.g. in a merge between A and B, if
side A deleted "path1" and created a "path2" that is similar to deleted
"path1", have the ancestor version at stage #1 of "path2", hoist
"path2" of side A to stage #2, and move the version of "path1" from
side B and have it at stage #3 of "path2", which would result in an
index without "path1" in any stage, and "path2" in three stages.
If the other side's rename causes a path to be moved, you can/should
check and notice local modifications to it at this stage.
You can also notice D/F conflict at this phase (e.g. side B in the
above example may have created a new path "path2/file1" and the index
may have stage #3 entry without any other stages for "path2/file1") and
abort.
- try to resolve unmerged paths inside the index.
Because you matched up possible renames and and adjusted the entries,
you can resolve aggressively, e.g. a path with identical stage #1 and
#3 but missing stage #2 results in delete, a path with missing stage #1
and #2 but with stage #3 results in create, etc.
- notice the paths that need to be written out to the work tree. Paths
with local changes should have been noticed already in the above, but
while debugging your new algorithm, you may want to have a logic to
double check so that you won't miss any. Abort if you find any local
change that can be clobbered.
- Then, finally, you commit to writing the results out, both the index
and the work tree. The changes to the work tree may be cleanly merged,
or an unmerged results with three-way conflict markers.
This way, you will never have "merge stops in halfway because it notices
it will clobber a local change too late after it has already written a
partial merge results to the work tree" problem, I think.
> git merge <branch>
> # Conflicts? I don't have time for that now.
> git reset --hard HEAD
>
> under all circumstances, without touching any untracked files.
Even though I agree the above without the second line is a good thing to
have, I think your description is a wrong way to present the desirable
goal.
"Conflicts?" is an indication that you had a lot of other things going on
inside your work tree as set of local changes that you "don't have time
for that now", and "reset --hard" is a sure way to lose them. You
shouldn't train your users to say "--hard" lightly.
The issue of unreliable D/F conflict detection and local change detection
the current merge-recursive has at its corner case is not about
"Conflicts? I don't have time for that now" at all. It is not about " I
had something precious in my work tree, but the merge turned out to be
unmanageable for me", either.
The issue is about "Crap, if merge has to abort in the middle because it
has to refrain from writing out a half-merged state out, not to overwrite
my local changes, it shouldn't have written out anything else to the work
tree at all. Don't abort in the middle but abort upfront without touching
my work tree!".
I think the correct statement of the goal is:
$ git merge ..
# Ah, I have "path2" locally modified so it cannot proceed?
# I did not lose anything, nor it did anything to my index nor
# work tree. Good.
By this, you realize that you should wrap up what you have been doing
first, because the above is an indication that other end has made some
overlapping changes. You can either (1) decide not to merge at this point
because you are not ready, keep working on what you were doing first and
later merge, or (2) stash away what you have been doing and do the merge
first, and then unstash.
^ permalink raw reply
* Re: RFE: git-import-dsc should support http-links
From: Rolf Leggewie @ 2008-12-28 21:29 UTC (permalink / raw)
To: git
In-Reply-To: <20081227114910.GA6481@bogon.ms20.nix>
Thanks, guys!
Guido Günther wrote:
>>> PS: How about some kind of official bug tracker for git?
> The Debian BTS (bugs.debian.org) is the official bugtracker for
> git-buildpackage.
http://bugs.debian.org/510036
^ permalink raw reply
* Re: [STGIT][PATCH] new: translate non word characters in patch name to '-'
From: Karl Hasselström @ 2008-12-28 20:49 UTC (permalink / raw)
To: Hannes Eder; +Cc: Catalin Marinas, git
In-Reply-To: <49562413.0437560a.287d.5133@mx.google.com>
On 2008-12-27 13:37:20 +0100, Hannes Eder wrote:
> This allows following usage:
>
> $ stg new full/path/file-fix-foobar
> Now at patch "full-path-file-fix-foobar"
>
> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
> ---
>
> I ran into as a '/' in a patch messed up stgit.
>
> I find this useful as 'stg uncommit' does the same translation.
Clearly, bad path names shouldn't mess anything up -- see
https://gna.org/bugs/?10919
But I would prefer "stg new" to quit with an error message when given
an illegal patch name, not silently mangle it. (Of course, the
commands that generate patch names from commit messages -- such as
"stg new" when not given an explicit patch name -- should mangle the
commit message as much as necessary. But when the user gives us a
patch name, we should either use that as is or fail with an
informative message.)
I think the right thing to do would be to construct a function that
validates patch names (I don't think we have one right now), and then
call it whenever we need to check if a patch name is OK. Such as when
the user gives us the name of a new patch. And when we've
auto-generated a patch name from a commit message, we should probably
assert that that the check function is OK with the name.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* [PATCH v2] diff: add option to show context between close hunks
From: René Scharfe @ 2008-12-28 18:45 UTC (permalink / raw)
To: Git Mailing List; +Cc: Jeff King, Davide Libenzi, Johannes Sixt, Junio C Hamano
Merge two hunks if there is only the specified number of otherwise unshown
context between them. For --inter-hunk-context=1, the resulting patch has
the same number of lines but shows uninterrupted context instead of a
context header line in between.
Patches generated with this option are easier to read but are also more
likely to conflict if the file to be patched contains other changes.
This patch keeps the default for this option at 0. It is intended to just
make the feature available in order to see its advantages and downsides.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
Changes: s/chunk/hunk/g, bash completion, redone test script.
Documentation/diff-options.txt | 4 ++
contrib/completion/git-completion.bash | 2 +
diff.c | 4 ++
diff.h | 1 +
t/t4032-diff-inter-hunk-context.sh | 92 ++++++++++++++++++++++++++++++++
xdiff/xdiff.h | 1 +
xdiff/xemit.c | 3 +-
7 files changed, 106 insertions(+), 1 deletions(-)
create mode 100755 t/t4032-diff-inter-hunk-context.sh
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index c62b45c..c7fcc80 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -215,6 +215,10 @@ endif::git-format-patch[]
-w::
Shorthand for "--ignore-all-space".
+--inter-hunk-context=<lines>::
+ Show the context between diff hunks, up to the specified number
+ of lines, thereby fusing hunks that are close to each other.
+
--exit-code::
Make the program exit with codes similar to diff(1).
That is, it exits with 1 if there were differences and
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e004549..a046441 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -776,6 +776,7 @@ _git_diff ()
--no-ext-diff
--no-prefix --src-prefix= --dst-prefix=
--base --ours --theirs
+ --inter-hunk-context=
"
return
;;
@@ -967,6 +968,7 @@ _git_log ()
--color-words --walk-reflogs
--parents --children --full-history
--merge
+ --inter-hunk-context=
"
return
;;
diff --git a/diff.c b/diff.c
index 0484601..56b80f9 100644
--- a/diff.c
+++ b/diff.c
@@ -1469,6 +1469,7 @@ static void builtin_diff(const char *name_a,
ecbdata.file = o->file;
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
xecfg.ctxlen = o->context;
+ xecfg.interhunkctxlen = o->interhunkcontext;
xecfg.flags = XDL_EMIT_FUNCNAMES;
if (pe)
xdiff_set_find_func(&xecfg, pe->pattern, pe->cflags);
@@ -2538,6 +2539,9 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
options->b_prefix = arg + 13;
else if (!strcmp(arg, "--no-prefix"))
options->a_prefix = options->b_prefix = "";
+ else if (opt_arg(arg, '\0', "inter-hunk-context",
+ &options->interhunkcontext))
+ ;
else if (!prefixcmp(arg, "--output=")) {
options->file = fopen(arg + strlen("--output="), "w");
options->close_file = 1;
diff --git a/diff.h b/diff.h
index 42582ed..4d5a327 100644
--- a/diff.h
+++ b/diff.h
@@ -78,6 +78,7 @@ struct diff_options {
const char *a_prefix, *b_prefix;
unsigned flags;
int context;
+ int interhunkcontext;
int break_opt;
int detect_rename;
int skip_stat_unmatch;
diff --git a/t/t4032-diff-inter-hunk-context.sh b/t/t4032-diff-inter-hunk-context.sh
new file mode 100755
index 0000000..e4e3e28
--- /dev/null
+++ b/t/t4032-diff-inter-hunk-context.sh
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+test_description='diff hunk fusing'
+
+. ./test-lib.sh
+
+f() {
+ echo $1
+ i=1
+ while test $i -le $2
+ do
+ echo $i
+ i=$(expr $i + 1)
+ done
+ echo $3
+}
+
+t() {
+ case $# in
+ 4) hunks=$4; cmd="diff -U$3";;
+ 5) hunks=$5; cmd="diff -U$3 --inter-hunk-context=$4";;
+ esac
+ label="$cmd, $1 common $2"
+ file=f$1
+ expected=expected.$file.$3.$hunks
+
+ if ! test -f $file
+ then
+ f A $1 B >$file
+ git add $file
+ git commit -q -m. $file
+ f X $1 Y >$file
+ fi
+
+ test_expect_success "$label: count hunks ($hunks)" "
+ test $(git $cmd $file | grep '^@@ ' | wc -l) = $hunks
+ "
+
+ test -f $expected &&
+ test_expect_success "$label: check output" "
+ git $cmd $file | grep -v '^index ' >actual &&
+ test_cmp $expected actual
+ "
+}
+
+cat <<EOF >expected.f1.0.1 || exit 1
+diff --git a/f1 b/f1
+--- a/f1
++++ b/f1
+@@ -1,3 +1,3 @@
+-A
++X
+ 1
+-B
++Y
+EOF
+
+cat <<EOF >expected.f1.0.2 || exit 1
+diff --git a/f1 b/f1
+--- a/f1
++++ b/f1
+@@ -1 +1 @@
+-A
++X
+@@ -3 +3 @@ A
+-B
++Y
+EOF
+
+# common lines ctx intrctx hunks
+t 1 line 0 2
+t 1 line 0 0 2
+t 1 line 0 1 1
+t 1 line 0 2 1
+t 1 line 1 1
+
+t 2 lines 0 2
+t 2 lines 0 0 2
+t 2 lines 0 1 2
+t 2 lines 0 2 1
+t 2 lines 1 1
+
+t 3 lines 1 2
+t 3 lines 1 0 2
+t 3 lines 1 1 1
+t 3 lines 1 2 1
+
+t 9 lines 3 2
+t 9 lines 3 2 2
+t 9 lines 3 3 1
+
+test_done
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index 84fff58..361f802 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -84,6 +84,7 @@ typedef long (*find_func_t)(const char *line, long line_len, char *buffer, long
typedef struct s_xdemitconf {
long ctxlen;
+ long interhunkctxlen;
unsigned long flags;
find_func_t find_func;
void *find_func_priv;
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 4625c1b..05bfa41 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -59,9 +59,10 @@ static int xdl_emit_record(xdfile_t *xdf, long ri, char const *pre, xdemitcb_t *
*/
xdchange_t *xdl_get_hunk(xdchange_t *xscr, xdemitconf_t const *xecfg) {
xdchange_t *xch, *xchp;
+ long max_common = 2 * xecfg->ctxlen + xecfg->interhunkctxlen;
for (xchp = xscr, xch = xscr->next; xch; xchp = xch, xch = xch->next)
- if (xch->i1 - (xchp->i1 + xchp->chg1) > 2 * xecfg->ctxlen)
+ if (xch->i1 - (xchp->i1 + xchp->chg1) > max_common)
break;
return xchp;
--
1.6.1
^ permalink raw reply related
* Re: getting started, happy with cmd line on windows [Scanned]
From: Daniel Barkalow @ 2008-12-28 18:39 UTC (permalink / raw)
To: Conor Rafferty; +Cc: git
In-Reply-To: <BB5F02FD3789B54E8964D38D6775E718242D07@ALTMORE-SVR.altmore.local>
On Fri, 26 Dec 2008, Conor Rafferty wrote:
> We want to use git to
> a) archive old versions of our project that have till now had no SCM
> applied
There's actually an importer for this; if you can put all of the old
versions into tar files in the same format and list them in order, you can
use "import-tars.perl", which is in contrib/fast-import in the git source
tree. Of course, using that won't teach you anything about the tools, but
it might be the best way to get the real import done with the least chance
of mistakes.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: 'Theirs' merge between branches on a binary file.
From: Tim Visher @ 2008-12-28 17:14 UTC (permalink / raw)
To: René Scharfe; +Cc: Junio C Hamano, git
In-Reply-To: <49512E9A.5040902@lsrfire.ath.cx>
On Tue, Dec 23, 2008 at 1:31 PM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> Have you seen msysgit (http://code.google.com/p/msysgit/), the easy
> route to git on Windows? It has all you need to check out and compile
> the latest version of git.
I have seen msysgit. I haven't spent too much time with it mainly
because I'm in denial that I have to work with Windows all day at
work. I'm going to have to look into it I think when I attempt to get
my team onto git in a little less than a month.
--
In Christ,
Timmy V.
http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
^ permalink raw reply
* Re: [PATCH] gitrepository-layout: No longer first two letters. Also add "down".
From: Sverre Rabbelier @ 2008-12-28 17:00 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: jidanni, git
In-Reply-To: <20081227070232.6117@nanako3.lavabit.com>
On Fri, Dec 26, 2008 at 16:02, Nanako Shiraishi <nanako3@lavabit.com> wrote:
> Quoting jidanni@jidanni.org:
>
>> Signed-off-by: jidanni <jidanni@jidanni.org>
>
> Didn't you mean "Signed-off-by: 積丹尼 <jidanni@jidanni.org>"?
Be nice, they are obviously a bit peculiar about their name/sign-off name :).
--
Cheers,
Sverre Rabbelier
^ 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