* Re: [PATCH] shell: Document that 'cvs server' is a valid command
From: Johannes Schindelin @ 2009-01-19 17:49 UTC (permalink / raw)
To: Lars Noschinski; +Cc: git, gitster
In-Reply-To: <1232384803-29373-1-git-send-email-lars@public.noschinski.de>
Hi,
On Mon, 19 Jan 2009, Lars Noschinski wrote:
> git-shell's man page explicitly lists all allowed commands, but 'cvs
> server' was missing. Add it.
Oops (has been there since Oct 7 _2007_). Thank you,
Dscho
^ permalink raw reply
* Re: [JGIT PATCH 8/8] Define a basic merge API, and a two-way tree merge strategy
From: Shawn O. Pearce @ 2009-01-19 17:42 UTC (permalink / raw)
To: tomi.pakarinen; +Cc: Robin Rosenberg, git
In-Reply-To: <f299b4f30901171116y216835c9jc11df2d424ee0377@mail.gmail.com>
Tomi Pakarinen <tomi.pakarinen@gmail.com> wrote:
> testTrivialTwoWay_disjointhistories() failed because merge strategy
> didn't handle missing base
> version. Am'i right?
I don't think so.
> @@ -119,13 +120,26 @@ protected boolean mergeImpl() throws IOException {
> }
>
> final int modeB = tw.getRawMode(T_BASE);
Under a missing base condition modeB == 0. So,
> - if (modeB == modeO && tw.idEqual(T_BASE, T_OURS))
> - add(T_THEIRS, DirCacheEntry.STAGE_0);
If modeB == 0 and modeO == 0 its not in the base and its not in ours.
Both SHA-1s will be 0{40} and are thus idEqual, so we should enter
this add(T_THEIRS) block. Which is what you tried to write below in
your else block, isn't it?.
> - else if (modeB == modeT && tw.idEqual(T_BASE, T_THEIRS))
> - add(T_OURS, DirCacheEntry.STAGE_0);
Again, if modeB == 0 and modeT == 0 both SHA-1s will be 0{40} and
are idEqual, so we should enter this add(T_OURS) block if both base
and theirs are missing. Which again is what you tried to write in
your else block.
If that isn't coming out right then perhaps tw.idEqual() is busted
for when FileMode is FileMode.MISSING (aka 0). Granted, doing
idEqual on FileMode.MISSING is pointless and just wastes clock
cycles, but it shouldn't harm the algorithm's correctness.
> - else {
> - conflict();
> - hasConflict = true;
> + if (!FileMode.MISSING.equals(modeB)) {
> + if (modeB == modeO && tw.idEqual(T_BASE, T_OURS))
> + add(T_THEIRS, DirCacheEntry.STAGE_0);
> + else if (modeB == modeT && tw.idEqual(T_BASE, T_THEIRS))
> + add(T_OURS, DirCacheEntry.STAGE_0);
> + else {
> + conflict();
> + hasConflict = true;
> + }
> + } else {
> + if (!FileMode.MISSING.equals(modeO)
> + && FileMode.MISSING.equals(modeT))
> + add(T_OURS, DirCacheEntry.STAGE_0);
> + else if (FileMode.MISSING.equals(modeO)
> + && !FileMode.MISSING.equals(modeT))
> + add(T_THEIRS, DirCacheEntry.STAGE_0);
> + else {
> + conflict();
> + hasConflict = true;
> + }
> }
> }
> builder.finish();
> --
> 1.6.0.4
--
Shawn.
^ permalink raw reply
* Re: [PATCH 6/7 v2] Compute prefix at runtime if RUNTIME_PREFIX is set
From: Johannes Schindelin @ 2009-01-19 17:41 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Junio C Hamano, git, Johannes Sixt
In-Reply-To: <1232280015-8144-7-git-send-email-prohaska@zib.de>
Hi,
On Sun, 18 Jan 2009, Steffen Prohaska wrote:
> + if (!prefix) {
> + const char *strip[] = {
> + GIT_EXEC_PATH,
> + BINDIR,
> + 0
> + };
> + const char **s;
> +
> + for (s = strip; *s; s++) {
> + const char *sargv = argv0_path + strlen(argv0_path);
This does not need to be recomputed all the time, right?
> + const char *ss = *s + strlen(*s);
> + while (argv0_path < sargv && *s < ss
> + && (*sargv == *ss ||
> + (is_dir_sep(*sargv) && is_dir_sep(*ss)))) {
> + sargv--;
> + ss--;
> + }
> + if (*s == ss) {
> + struct strbuf d = STRBUF_INIT;
> + /* We also skip the trailing directory separator. */
> + assert(sargv - argv0_path - 1 >= 0);
> + strbuf_add(&d, argv0_path, sargv - argv0_path - 1);
> + prefix = strbuf_detach(&d, NULL);
> + break;
> + }
> + }
> + }
I have a definite feeling that this code would be easier to read if it
resembled this:
/* sets prefix if the suffix matches (modulo separator changes) */
static int strip_path_suffix(const char *path, const char *suffix,
char **prefix)
{
int path_len = strlen(path), suffix_len = strlen(suffix);
while (suffix_len) {
if (!path_len)
return 1;
path_len--; suffix_len--;
/* strip arbitrary amount of directory separators */
if (is_dir_sep(path[path_len]) &&
is_dir_sep(suffix[suffix_len])) {
while (path_len && is_dir_sep(path[path_len]))
path_len--;
while (suffix_len && is_dir_sep(suffix[suffix_len]))
suffix_len--;
}
else if (path[path_len] != suffix[suffix_len])
return 1;
}
while (path_len && is_dir_sep(path[path_len - 1]))
path_len--;
prefix = xstrndup(path, path_len);
return 0;
}
...
if (!prefix && strip_path_suffix(argv0_path, GIT_EXEC_PATH) &&
strip_path_suffix(argv0_path, BINDIR)) {
prefix = PREFIX;
...
Note: this function could be exported in path.c, as it also handles the
"a//bin" vs "a/bin" case.
Ciao,
Dscho
^ permalink raw reply
* Re: how to omit rename file when commit
From: Boyd Stephen Smith Jr. @ 2009-01-19 17:41 UTC (permalink / raw)
To: Frank Li; +Cc: git
In-Reply-To: <1976ea660901190135k71087673p85e995878e539a8f@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]
On Monday 2009 January 19 03:35:41 you wrote:
>For example:
>there are 2 file. a.c and e.c
>I modify e.c.
>and git mv a.c b.c
>
>git update-index e.c
>
>I just want to commit e.c and don't commit rename(a.c -> b.c)
Here, it looks like all you need to do is follow the instructions given by git
status--use "git reset HEAD" on each file you want unstaged:
$ rm -rf test && mkdir test
$ cd test
/home/bss/test
$ git init
Initialized empty Git repository in /home/bss/test/.git/
$ echo b > a.c; echo d > e.c
$ git add a.c b.c e.c
$ git commit -m 'Setup'
Created initial commit fc9d26e: Setup
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 a.c
create mode 100644 e.c
$ git mv a.c b.c
$ echo e > e.c
$ git add e.c
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: a.c -> b.c
# modified: e.c
#
$ git reset HEAD -- a.c b.c
a.c: locally modified
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: e.c
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
#
# deleted: a.c
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b.c
$ git commit -m 'e.c: Fix typo'
Created commit c23b226: e.c: Fix typo
1 files changed, 1 insertions(+), 1 deletions(-)
$ git status
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
#
# deleted: a.c
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b.c
no changes added to commit (use "git add" and/or "git commit -a")
HTH.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [PATCH] shell: Document that 'cvs server' is a valid command
From: Lars Noschinski @ 2009-01-19 17:06 UTC (permalink / raw)
To: git; +Cc: gitster, Lars Noschinski
git-shell's man page explicitly lists all allowed commands, but 'cvs
server' was missing. Add it.
Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
---
Documentation/git-shell.txt | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt
index ff420f8..3f8d973 100644
--- a/Documentation/git-shell.txt
+++ b/Documentation/git-shell.txt
@@ -18,8 +18,9 @@ of server-side GIT commands implementing the pull/push functionality.
The commands can be executed only by the '-c' option; the shell is not
interactive.
-Currently, only the 'git-receive-pack' and 'git-upload-pack' commands
-are permitted to be called, with a single required argument.
+Currently, only three commands are permitted to be called, 'git-receive-pack'
+'git-upload-pack' with a single required argument or 'cvs server' (to invoke
+'git-cvsserver').
Author
------
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH next resend] bash completion: refactor diff options
From: Shawn O. Pearce @ 2009-01-19 17:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git
In-Reply-To: <7vtz7xytdo.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Thomas Rast <trast@student.ethz.ch> writes:
>
> > +__git_diff_common_options="--stat --numstat --shortstat --summary
> > --patch-with-stat --name-only --name-status --color
> > --no-color --color-words --no-renames --check
> > --full-index --binary --abbrev --diff-filter=
> > - --find-copies-harder --pickaxe-all --pickaxe-regex
> > + --find-copies-harder
>
> The changes around pickaxe made me "Huh?". For log pickaxe makes very
> good sense but for a single diff it doesn't, yet the original seems to
> have had them only on "git diff" and not on "git log", which feels wrong.
>
> Other than that, I think the patch tries to achieve a great thing in the
> longer term---we do not have to worry about common parts going out of sync
> between diff and log family of commands.
I agree completely. The pickaxe stuff in current completion is
just plain wrong. I'd like to see it fixed with this cleanup.
Maybe do it in two parts; fix the pickaxe options to be on log
and not diff, and then do the cleanup for the common options.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] bash: offer to show (un)staged changes
From: Shawn O. Pearce @ 2009-01-19 17:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git
In-Reply-To: <7vwsct2xd1.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Thomas Rast <trast@student.ethz.ch> writes:
>
> > + if test ! -z "$GIT_PS1_EXPENSIVE"; then
> > + git update-index --refresh >/dev/null 2>&1 || w="*"
>
> This makes the feature unavailable for people who care about the stat
> dirtiness and explicitly set diff.autorefreshindex to false, doesn't it?
Yup, and I'm one of those people who sets autorefresindex to false
in my ~/.gitconfig, usually before I even have user.{name,email} set.
I do like the idea of what Thomas is trying to do here, but its
so bloody expensive to compute dirty state on every prompt in
some repositories that I'd shoot myself. E.g. WebKit is huge,
computing the dirty state inside of the WebKit repository on each
prompt would absolutely kill CLI performance to a point of it not
being usuable. But git.git is small enough its OK on pretty much
everything except Cygwin.
So as much as I'd like to use this without the update-index --refresh
bit, I'm not sure its viable in every project out there. If we had
an inotify sort of daemon to keep the data current so the prompt
doesn't have to stat every source file on every display it would
be reasonable, but we don't have such a thing yet for Git.
--
Shawn.
^ permalink raw reply
* Shallow submodule update/clone?
From: Chas Emerick @ 2009-01-19 16:59 UTC (permalink / raw)
To: git
Is there a way to cause 'git submodule update' to perform a shallow
clone of some or all of a repo's submodules?
Ideally, I'd like to be able to specify that particular submodules be
shallowly cloned all the time (perhaps by specifying a default --depth
when doing 'git submodule add ...'). Just an idea, there.
Cheers,
- Chas
^ permalink raw reply
* Re: how to track multiple upstreams in one repository
From: Julian Phillips @ 2009-01-19 16:29 UTC (permalink / raw)
To: david; +Cc: git
In-Reply-To: <alpine.DEB.1.10.0901181855400.20741@asgard.lang.hm>
On Sun, 18 Jan 2009, david@lang.hm wrote:
> for linux I want to track both the linus tree and the -stable tree. Ideally I
> want to be able to do a checkout of tags from either tree from the same
> directory (along with diffs between items in both trees, etc)
>
> I have found documentation on how to clone from each of them, but I haven't
> found any simple documentation on how to work with both of them.
You could always just use
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6-stable.git
? It already contains both the linus tree and all the stable trees ...
>
> David Lang
> --
> 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
>
>
--
Julian
---
Flattery is like cologne -- to be smelled, but not swallowed.
-- Josh Billings
^ permalink raw reply
* Re: gitk doesn't work w/o sudo.
From: Dilip M @ 2009-01-19 15:35 UTC (permalink / raw)
To: Jing Xue; +Cc: git list
In-Reply-To: <20090119144836.GD5625@jabba.hq.digizenstudio.com>
On Mon, Jan 19, 2009 at 8:18 PM, Jing Xue <jingxue@digizenstudio.com> wrote:
> On Mon, Jan 19, 2009 at 03:46:41PM +0530, Dilip M wrote:
>> Hi,
>>
>> ..I recently install GIT on Ubuntu (hardy) box....I am able to use
>> 'gitk' only If I do 'sudo'. Without 'sudo' it complains 'repository
>> not found'
>
> Do you have a 0027 umask?
>
> http://www.digizenstudio.com/blog/2008/11/09/weird-git-gui-startup-problem/
Mine is dm-laptop:~> umask
22
So, that's not a issue.
-- DM
^ permalink raw reply
* Re: gitk doesn't work w/o sudo.
From: Dilip M @ 2009-01-19 14:37 UTC (permalink / raw)
To: Reece Dunn; +Cc: git list
In-Reply-To: <3f4fd2640901190359w39ded50ds246903808e94246c@mail.gmail.com>
On Mon, Jan 19, 2009 at 5:29 PM, Reece Dunn <msclrhd@googlemail.com> wrote:
> 2009/1/19 Dilip M <dilipm79@gmail.com>:
>> Hi,
>>
>> ..I recently install GIT on Ubuntu (hardy) box....I am able to use
>> 'gitk' only If I do 'sudo'. Without 'sudo' it complains 'repository
>> not found'
>
> Who is the owner of the repository directory (and the .git directory)
> and what are the permissions on the directory? You can run (on the
> command line from the Terminal program):
>
> ls -lh directory
>
> to find this out (where directory is the directory you are interested
> in) and run:
>
> sudo chown user -R directory
>
> to change ownership of that directory (and all of its content) to the
> specified user (i.e. the one you are currently logged in as). This
> will make it so that you own that directory and can make changes to
> it. This should allow you to run gitk without using sudo.
Even I suspected that it may be related to some permission and checked
them...But I couldn't find the actual cause.
dm-laptop:~/repos/atria> id -a
uid=1000(dm) gid=1000(dm)
groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),107(fuse),109(lpadmin),115(admin),1000(dm)
dm-laptop:~/repos/atria> ls -lh .git/
total 44K
drwxr-xr-x 2 dm dm 4.0K 2009-01-18 23:24 branches
-rw-r--r-- 1 dm dm 256 2009-01-18 23:28 config
-rw-r--r-- 1 dm dm 58 2009-01-18 23:24 description
-rw-r--r-- 1 dm dm 23 2009-01-18 23:28 HEAD
drwxr-xr-x 2 dm dm 4.0K 2009-01-18 23:24 hooks
-rw-r--r-- 1 dm dm 3.8K 2009-01-18 23:28 index
drwxr-xr-x 2 dm dm 4.0K 2009-01-18 23:24 info
drwxr-xr-x 3 dm dm 4.0K 2009-01-18 23:28 logs
drwxr-xr-x 4 dm dm 4.0K 2009-01-18 23:24 objects
-rw-r--r-- 1 dm dm 94 2009-01-18 23:28 packed-refs
drwxr-xr-x 5 dm dm 4.0K 2009-01-18 23:28 refs
'dm' is a user I created while installing Ubuntu.
dm-laptop:~/repos/atria> ls -l `which gitk`
-rwxr-xr-x 1 root root 237778 2008-04-08 22:31 /usr/bin/gitk
dm-laptop:~/repos/atria>
-- DM
^ permalink raw reply
* Re: [PATCH] @{-<n>}: avoid crash with corrupt reflog
From: Johannes Schindelin @ 2009-01-19 14:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git, Johannes Sixt, Johan Herland
In-Reply-To: <alpine.DEB.1.00.0901191338470.3586@pacific.mpi-cbg.de>
Hi,
On Mon, 19 Jan 2009, Johannes Schindelin wrote:
> diff --git a/sha1_name.c b/sha1_name.c
> index 9e5f444..853bac6 100644
> --- a/sha1_name.c
> +++ b/sha1_name.c
> @@ -705,18 +705,18 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
> size_t len;
> int nth;
>
> - if (!prefixcmp(message, "checkout: moving from ")) {
> - match = message + strlen("checkout: moving from ");
> - if ((target = strstr(match, " to ")) != NULL)
> - target += 4;
> - }
> -
> - if (!match)
> + if (prefixcmp(message, "checkout: moving from "))
> return 0;
>
> - len = target - match - 4;
> - if (target[len] == '\n' && !strncmp(match, target, len))
> - return 0;
> + match = message + strlen("checkout: moving from ");
> + if ((target = strstr(match, " to ")) != NULL) {
> + len = target - match - 4;
Aargh, the "- 4" is wrong, of course.
> + target += 4;
> + if (target[len] == '\n' && !strncmp(match, target, len))
> + return 0;
> + }
> + else
> + len = strchrnul(match, ' ') - match;
>
> nth = cb->cnt++ % cb->alloc;
> strbuf_reset(&cb->buf[nth]);
Sorry for the noise,
Dscho
^ permalink raw reply
* Re: gitk doesn't work w/o sudo.
From: Jing Xue @ 2009-01-19 14:48 UTC (permalink / raw)
To: Dilip M; +Cc: git list
In-Reply-To: <c94f8e120901190216x246589ebwc4a44dd85bb655d2@mail.gmail.com>
On Mon, Jan 19, 2009 at 03:46:41PM +0530, Dilip M wrote:
> Hi,
>
> ..I recently install GIT on Ubuntu (hardy) box....I am able to use
> 'gitk' only If I do 'sudo'. Without 'sudo' it complains 'repository
> not found'
Do you have a 0027 umask?
http://www.digizenstudio.com/blog/2008/11/09/weird-git-gui-startup-problem/
HTH.
--
Jing Xue
^ permalink raw reply
* Re: [PATCH/RFC] shortlog: add option to group together different names/emails of an author
From: Johannes Schindelin @ 2009-01-19 14:29 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git
In-Reply-To: <20090119141107.GA27992@chistera.yi.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1129 bytes --]
Hi,
On Mon, 19 Jan 2009, Adeodato Simó wrote:
> * Johannes Schindelin [Mon, 19 Jan 2009 14:49:39 +0100]:
>
> > > Ping? I realize this may be seen as a big patch dropped out of the blue,
> > > but I would very much like to hear some comments on at least the feature
> > > itself, which should not take more than reading the commit message.
>
> > And you could just as well write a script that takes the output of
>
> > $ git log --pretty=format:%an\ %ae --all | sort | uniq
>
> > and constructs a valid .mailmap. That would also have the advantage that
> > you do not need to perform the analysis each time you call Git.
>
> No, not really. As mentioned in the commit message, .mailmap files don't
> help when you invoke shortlog with -e, and different email addresses for
> an author are involved.
Well, the whole point of -e is that you want to see the email addresses,
too. So I am not really convinced it would be a good idea to mangle them.
But hey, I only expressed a personal opinion; If you can convince others,
you still might bring that feature in. You'll have to convince them,
though.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH/RFC] shortlog: add option to group together different names/emails of an author
From: Adeodato Simó @ 2009-01-19 14:11 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0901191445340.3586@pacific.mpi-cbg.de>
* Johannes Schindelin [Mon, 19 Jan 2009 14:49:39 +0100]:
> > Ping? I realize this may be seen as a big patch dropped out of the blue,
> > but I would very much like to hear some comments on at least the feature
> > itself, which should not take more than reading the commit message.
> This is such a huge change, for something that not many people want.
> Actually, you seem to be the first.
That's, uhm, sad. (I don't really buy the "not many people want it,
hence we should not include it" argument, unless by people you mean
"people who could do a review". No hard feelings, though.)
> And you could just as well write a script that takes the output of
> $ git log --pretty=format:%an\ %ae --all | sort | uniq
> and constructs a valid .mailmap. That would also have the advantage that
> you do not need to perform the analysis each time you call Git.
No, not really. As mentioned in the commit message, .mailmap files don't
help when you invoke shortlog with -e, and different email addresses for
an author are involved.
> All these reasons make me believe that your patch should not be applied.
Okay, I'll let go.
Cheers,
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Mankind are very odd creatures: one half censure what they practice, the
other half practice what they censure; the rest always say and do as
they ought.
-- Michel de Montaigne
^ permalink raw reply
* Re: [PATCH/RFC] shortlog: add option to group together different names/emails of an author
From: Johannes Schindelin @ 2009-01-19 13:49 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git
In-Reply-To: <20090119134346.GA27509@chistera.yi.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 730 bytes --]
Hi,
On Mon, 19 Jan 2009, Adeodato Simó wrote:
> Ping? I realize this may be seen as a big patch dropped out of the blue,
> but I would very much like to hear some comments on at least the feature
> itself, which should not take more than reading the commit message.
This is such a huge change, for something that not many people want.
Actually, you seem to be the first.
And you could just as well write a script that takes the output of
$ git log --pretty=format:%an\ %ae --all | sort | uniq
and constructs a valid .mailmap. That would also have the advantage that
you do not need to perform the analysis each time you call Git.
All these reasons make me believe that your patch should not be applied.
Sorry,
Dscho
^ permalink raw reply
* Re: [PATCH/RFC] shortlog: add option to group together different names/emails of an author
From: Adeodato Simó @ 2009-01-19 13:43 UTC (permalink / raw)
To: git
In-Reply-To: <1231600589-11811-1-git-send-email-dato@net.com.org.es>
Ping? I realize this may be seen as a big patch dropped out of the blue,
but I would very much like to hear some comments on at least the feature
itself, which should not take more than reading the commit message.
(Hints as to what to do to get people to comment on the code also
welcome, of course.)
--- Adeodato Simó [Sat, 10 Jan 2009 16:16:29 +0100]:
> It's common for repositories to contain commits with different spellings of
> an author name, or different email addresses. The shortlog command tries to
> alleviate this by using .mailmap files. However, maintaining a .mailmap file
> up to date is a manual process, and it does not help when shortlog is
> invoked with the -e option and different email addresses for an author are
> involved.
> This commit introduces a -j/--join-uids option that uses a very dumb logic
> to detect different spellings and addresses of a same author. In particular,
> it just joins commits when either the name or the address had been
> previously seen, attaching the commit to that previous id. In other words,
> these three ids will be joined:
> Author: Joe Developer <joe@example.com>
> Author: Joe R. Developer <joe_r@example.com>
> Author: Joe R. Developer <joe@example.com>
> but only because of the third spelling. The first two alone would be left
> separate. When the names and addresses are printed, the most common spelling
> and address are used.
> Incidentally, there is f817546 in git.git which has this author information:
> Author: Wincent Colaiuta <gitster@pobox.com>
> Which makes all of Wincent's commits to be assigned to Junio with -j. This
> is easily fixed with an entry for gitster@pobox.com in .mailmap, which this
> commit includes. (And then, only f817546 is be assigned to Junio.)
> Signed-off-by: Adeodato Simó <dato@net.com.org.es>
> ---
> This is my scratching of my own itch: I was used to `bzr author-stats`,
> which is equivalent to `git shortlog -jsne`. I realize -sn comes close,
> but I like having the email address listed. Please let me know what you
> think.
> Tests and a mention in git-shortlog.txt are missing. That'll come next
> when/if I'm told this has a chance of inclusion. :-)
> The code is valgrind'ed. I'm not completely confident, though, bugs will
> not be hiding in corner cases. Also, I don't see any appreciable
> slowdown with this version in git.git, particularly not between the
> current git-shortlog and this new when run without -j (not when run with
> -j either, but that's less critical).
> This patch applies on top of my as/maint-shortlog-cleanup branch.
> .mailmap | 1 +
> builtin-shortlog.c | 280 +++++++++++++++++++++++++++++++++++++++++++++-------
> shortlog.h | 14 ++-
> 3 files changed, 256 insertions(+), 39 deletions(-)
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Don't be irreplaceable, if you can't be replaced, you can't be promoted.
^ permalink raw reply
* Re: [PATCH] parsecvs: produce tagger fields acceptable to newer git versions
From: Lennert Buytenhek @ 2009-01-19 13:39 UTC (permalink / raw)
To: Jim Meyering; +Cc: keithp, git, jay, kedars
In-Reply-To: <87ab9nbh49.fsf@meyering.net>
On Mon, Jan 19, 2009 at 01:44:06PM +0100, Jim Meyering wrote:
> > Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
> >
> > diff --git a/git.c b/git.c
> > index da320d1..8f94d1b 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -371,11 +371,13 @@ git_mktag (rev_commit *commit, char *name)
> > "object %s\n"
> > "type commit\n"
> > "tag %s\n"
> > - "tagger %s\n"
> > + "tagger %s <%s> %lu +0000\n"
> > "\n",
> > commit->sha1,
> > name,
> > - author ? author->full : commit->author);
> > + author ? author->full : commit->author,
> > + author ? author->email : commit->author,
> > + commit->date);
> > if (rv < 1) {
> > fprintf (stderr, "%s: %s\n", filename, strerror (errno));
> > fclose (f);
>
> Hi Lennert,
Hey Jim,
> I posted the same patch a while back.
>
> http://markmail.org/message/cebh7suc7ejpayos
>
> However, I never heard back.
> You'll also need the patch below, if you're building
> against a newer version of git.
Can you make your parsecvs repository available somewhere?
thanks,
Lennert
^ permalink raw reply
* Re: after first git clone of linux kernel repository there are changed files in working dir
From: Hannu Koivisto @ 2009-01-19 13:36 UTC (permalink / raw)
To: rdkrsr; +Cc: git
In-Reply-To: <d304880b0812101022u2abe5d68ub3bda68ed39f830b@mail.gmail.com>
rdkrsr <rdkrsr@googlemail.com> writes:
> I just fetched the sources without changing anything, but git diff
> shows, that there are changes that are not yet updated (changed but not
> updated: use git add to ...). Why is it like that?
>
> I use msysgit on windows, maybe that is one reason?
Kernel source contains pairs of files whose names differ only by
case. Windows cannot store such pairs (at least by default) and
apparently there is no support for such a situation in git so
you'll only get one file from each pair to your workspace and the
other file is shown as modified.
--
Hannu
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2009, #04; Mon, 19)
From: Johannes Schindelin @ 2009-01-19 13:09 UTC (permalink / raw)
To: Kjetil Barvik; +Cc: git, Junio C Hamano
In-Reply-To: <864ozvv7d3.fsf@broadpark.no>
Hi,
On Mon, 19 Jan 2009, Kjetil Barvik wrote:
> How long is the 'merge window' in Linux Kernel terms for this round
> (to the next release of GIT)?
There is no "merge window", but rather an "-rc" period for 1.x versions.
Which has been largely ignored :-)
Ciao,
Dscho
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2009, #04; Mon, 19)
From: Johannes Schindelin @ 2009-01-19 13:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vbpu3r745.fsf@gitster.siamese.dyndns.org>
Hi,
On Mon, 19 Jan 2009, Junio C Hamano wrote:
> * js/diff-color-words (Sat Jan 17 17:29:48 2009 +0100) 7 commits
> - color-words: make regex configurable via attributes
> - color-words: expand docs with precise semantics
> - color-words: enable REG_NEWLINE to help user
> - color-words: take an optional regular expression describing words
> - color-words: change algorithm to allow for 0-character word
> boundaries
> - color-words: refactor word splitting and use ALLOC_GROW()
> - Add color_fwrite_lines(), a function coloring each line
> individually
>
> Dscho's series that was done in response to Thomas's original; two agreed
> to work together on this codebase.
I am actually pretty comfortable with this series now.
> * jk/valgrind (Thu Oct 23 04:30:45 2008 +0000) 2 commits
> . valgrind: ignore ldso errors
> . add valgrind support in test scripts
Could you put this in pu, at least, please?
Thanks,
Dscho
^ permalink raw reply
* Re: [PATCH] parsecvs: produce tagger fields acceptable to newer git versions
From: Jim Meyering @ 2009-01-19 12:44 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: keithp, git, jay, kedars
In-Reply-To: <20090119120217.GD4390@xi.wantstofly.org>
Lennert Buytenhek <buytenh@wantstofly.org> wrote:
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
>
> diff --git a/git.c b/git.c
> index da320d1..8f94d1b 100644
> --- a/git.c
> +++ b/git.c
> @@ -371,11 +371,13 @@ git_mktag (rev_commit *commit, char *name)
> "object %s\n"
> "type commit\n"
> "tag %s\n"
> - "tagger %s\n"
> + "tagger %s <%s> %lu +0000\n"
> "\n",
> commit->sha1,
> name,
> - author ? author->full : commit->author);
> + author ? author->full : commit->author,
> + author ? author->email : commit->author,
> + commit->date);
> if (rv < 1) {
> fprintf (stderr, "%s: %s\n", filename, strerror (errno));
> fclose (f);
Hi Lennert,
I posted the same patch a while back.
http://markmail.org/message/cebh7suc7ejpayos
However, I never heard back.
You'll also need the patch below, if you're building
against a newer version of git.
>From 93bc277dff113f1133ef25b8bb985af80f1fbe0e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 6 Nov 2008 11:35:09 +0100
Subject: [PATCH 2/2] * tree.c (init_tree): Adapt to new git_config API.
---
tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tree.c b/tree.c
index a76f27c..e2a041c 100644
--- a/tree.c
+++ b/tree.c
@@ -177,7 +177,7 @@ rev_commit *create_tree(rev_commit *leader)
void init_tree(int n)
{
- git_config(git_default_config);
+ git_config(git_default_config, NULL);
strip = n;
}
--
1.6.1.331.g9c367
^ permalink raw reply related
* [PATCH] @{-<n>}: avoid crash with corrupt reflog
From: Johannes Schindelin @ 2009-01-19 12:41 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git, Johannes Sixt, Johan Herland
In-Reply-To: <7vljt7r9mq.fsf@gitster.siamese.dyndns.org>
The earlier code checked if a " to " was found after "checkout: Moving
from ". However, it then went on to access the pointer to " to ",
regardless if it was still NULL (if no " to " was found) or not.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
You might want to squash this into "sha1_name: tweak @{-N}
lookup", just as a safety belt.
sha1_name.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/sha1_name.c b/sha1_name.c
index 9e5f444..853bac6 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -705,18 +705,18 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
size_t len;
int nth;
- if (!prefixcmp(message, "checkout: moving from ")) {
- match = message + strlen("checkout: moving from ");
- if ((target = strstr(match, " to ")) != NULL)
- target += 4;
- }
-
- if (!match)
+ if (prefixcmp(message, "checkout: moving from "))
return 0;
- len = target - match - 4;
- if (target[len] == '\n' && !strncmp(match, target, len))
- return 0;
+ match = message + strlen("checkout: moving from ");
+ if ((target = strstr(match, " to ")) != NULL) {
+ len = target - match - 4;
+ target += 4;
+ if (target[len] == '\n' && !strncmp(match, target, len))
+ return 0;
+ }
+ else
+ len = strchrnul(match, ' ') - match;
nth = cb->cnt++ % cb->alloc;
strbuf_reset(&cb->buf[nth]);
--
1.6.1.347.g7b62749
^ permalink raw reply related
* Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice
From: Johannes Schindelin @ 2009-01-19 12:33 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git, Johannes Sixt, Johan Herland
In-Reply-To: <7vljt7r9mq.fsf@gitster.siamese.dyndns.org>
Hi,
On Mon, 19 Jan 2009, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> > Well, I would rather be in favor of something like this.
> >
> > -- >8 --
> > Subject: interpret_nth_last_branch(): avoid traversing the reflog twice
> >
> > You can have quite a many reflog entries, but you typically won't recall
> > which branch you were on after switching branches for more than several
> > times.
> >
> > Instead of reading the reflog twice, this reads the branch switching event
> > and keeps the latest 16 (which is an arbitrary limitation that should be
> > plenty) such entry, to switch back to the branch we were recently on.
> >
> > Signed-off-by: Junio C Hamano <gitster@pobox.com>
> > ---
> > sha1_name.c | 48 +++++++++++++++++++++------------------------
> > t/t2012-checkout-last.sh | 44 ++++++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 66 insertions(+), 26 deletions(-)
> >
> > diff --git a/sha1_name.c b/sha1_name.c
> > index 9e1538e..d6622f2 100644
> > --- a/sha1_name.c
> > +++ b/sha1_name.c
> > @@ -750,19 +746,19 @@ int interpret_nth_last_branch(const char *name, struct strbuf *buf)
> > nth = strtol(name+3, &num_end, 10);
> > if (num_end != brace)
> > return -1;
> > ...
> > - if (cb.nth < nth)
> > - return 0;
> > ...
> > + if (cb.cnt < nth)
> > + return -1;
>
> This should (obviously) be "return 0".
This, together with a removal of the hard-coded limit of 16 could be
squashed with this patch:
-- snipsnap --
diff --git a/sha1_name.c b/sha1_name.c
index 2c5461e..9e5f444 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -691,11 +691,9 @@ static int get_sha1_oneline(const char *prefix, unsigned char *sha1)
return retval;
}
-#define MAX_PREVIOUS_BRANCH 16
-
struct grab_nth_branch_switch_cbdata {
- long cnt;
- struct strbuf buf[MAX_PREVIOUS_BRANCH];
+ long cnt, alloc;
+ struct strbuf *buf;
};
static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
@@ -720,7 +718,7 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
if (target[len] == '\n' && !strncmp(match, target, len))
return 0;
- nth = cb->cnt++ % MAX_PREVIOUS_BRANCH;
+ nth = cb->cnt++ % cb->alloc;
strbuf_reset(&cb->buf[nth]);
strbuf_add(&cb->buf[nth], match, len);
return 0;
@@ -753,19 +751,22 @@ int interpret_nth_last_branch(const char *name, struct strbuf *buf)
nth = strtol(name+3, &num_end, 10);
if (num_end != brace)
return -1;
- if (nth <= 0 || MAX_PREVIOUS_BRANCH < nth)
+ if (nth <= 0)
return -1;
- for (i = 0; i < MAX_PREVIOUS_BRANCH; i++)
+ cb.alloc = nth;
+ cb.buf = xmalloc(nth * sizeof(struct strbuf));
+ for (i = 0; i < nth; i++)
strbuf_init(&cb.buf[i], 20);
cb.cnt = 0;
for_each_reflog_ent("HEAD", grab_nth_branch_switch, &cb);
if (cb.cnt < nth)
- return -1;
- i = (cb.cnt + MAX_PREVIOUS_BRANCH - nth) % MAX_PREVIOUS_BRANCH;
+ return 0;
+ i = cb.cnt % nth;
strbuf_reset(buf);
strbuf_add(buf, cb.buf[i].buf, cb.buf[i].len);
- for (i = 0; i < MAX_PREVIOUS_BRANCH; i++)
+ for (i = 0; i < nth; i++)
strbuf_release(&cb.buf[i]);
+ free(cb.buf);
return brace-name+1;
}
--
1.6.1.347.g7b62749
^ permalink raw reply related
* [PATCH] parsecvs: produce tagger fields acceptable to newer git versions
From: Lennert Buytenhek @ 2009-01-19 12:02 UTC (permalink / raw)
To: keithp; +Cc: git, jay, jim, kedars
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
diff --git a/git.c b/git.c
index da320d1..8f94d1b 100644
--- a/git.c
+++ b/git.c
@@ -371,11 +371,13 @@ git_mktag (rev_commit *commit, char *name)
"object %s\n"
"type commit\n"
"tag %s\n"
- "tagger %s\n"
+ "tagger %s <%s> %lu +0000\n"
"\n",
commit->sha1,
name,
- author ? author->full : commit->author);
+ author ? author->full : commit->author,
+ author ? author->email : commit->author,
+ commit->date);
if (rv < 1) {
fprintf (stderr, "%s: %s\n", filename, strerror (errno));
fclose (f);
^ 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