* Re: [PATCH] glossary: add 'reflog'
From: Junio C Hamano @ 2007-07-04 5:10 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0707032128020.4071@racer.site>
Thanks.
^ permalink raw reply
* Re: Pingback/Trackback for Git?
From: Junio C Hamano @ 2007-07-04 5:10 UTC (permalink / raw)
To: Thomas Perl; +Cc: git
In-Reply-To: <372f54da0707030512k79e2dc74m98bf0a690abffc4a@mail.gmail.com>
"Thomas Perl" <th.perl@gmail.com> writes:
> I've outlined some ideas here, feel free to suggest implementations or
> point out problems:
>
> http://tperl.blogspot.com/2007/07/pingbacktrackback-for-git.html
It was unclear to me who does what and when in the overall
picture you envision after reading that page. You seem to
assume there is a prominent ping/trackback repository that
everybody who is interested looks at. Who updates it? When?
With what? How does the namespace inside that repository
managed, if managed in any way? Given a project name, how does
one learn which pick/grackback repository (and perhaps which
branch) to go to to learn the current status about it?
^ permalink raw reply
* Re: [PATCH] gitweb: prefer git_get_project_owner() over get_file_owner()
From: Junio C Hamano @ 2007-07-04 5:10 UTC (permalink / raw)
To: Miklos Vajna; +Cc: git, Petr Baudis, Jakub Narebski, Luben Tuikov
In-Reply-To: <20070703221122.GI32766@genesis.frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
> This way if $projects_list exists, it'll be used, otherwise get_file_owner()
> will be used as before.
>
> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
The patch looks good to me.
HOWEVER.
It strikes me that repeated call to git_get_project_owner()
would be way too inefficient. Not caller's fault.
How about doing something like this on top of your patch?
gitweb/gitweb.perl | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index dbfb044..f114585 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1465,12 +1465,12 @@ sub git_get_projects_list {
return @list;
}
-sub git_get_project_owner {
- my $project = shift;
- my $owner;
+our $gitweb_project_owner = undef;
+sub git_get_project_list_from_file {
- return undef unless $project;
+ return if (defined $gitweb_project_owner);
+ $gitweb_project_owner = {};
# read from file (url-encoded):
# 'git%2Fgit.git Linus+Torvalds'
# 'libs%2Fklibc%2Fklibc.git H.+Peter+Anvin'
@@ -1482,13 +1482,25 @@ sub git_get_project_owner {
my ($pr, $ow) = split ' ', $line;
$pr = unescape($pr);
$ow = unescape($ow);
- if ($pr eq $project) {
- $owner = to_utf8($ow);
- last;
- }
+ $gitweb_project_owner->{$project} = to_utf8($ow);
}
close $fd;
}
+}
+
+sub git_get_project_owner {
+ my $project = shift;
+ my $owner;
+
+ return undef unless $project;
+
+ if (!defined $gitweb_project_owner) {
+ git_get_project_list_from_file();
+ }
+
+ if (exists $gitweb_project_owner->{$project}) {
+ $owner = $gitweb_project_owner->{$project};
+ }
if (!defined $owner) {
$owner = get_file_owner("$projectroot/$project");
}
^ permalink raw reply related
* Re: [PATCH] Add core.pager config variable.
From: Junio C Hamano @ 2007-07-04 5:10 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: git, Johannes Schindelin
In-Reply-To: <20070703181811.GA17966@Hermes.local>
Looks good, thanks.
^ permalink raw reply
* Re: [PATCH] stash: end commit log with a newline
From: Junio C Hamano @ 2007-07-04 5:10 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Git Mailing List, nanako3
In-Reply-To: <20070703085906.GA4963@lala>
Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> writes:
> If I do
>
> git cat-file commit $commitid
>
> for a commit created by stash, the next prompt starts directly after the
> shortlog of HEAD.
Thanks.
I noticed another thing. The entries shown in "git stash list"
look like this:
stash@{0}: js/stash: e1d32c1... Teach git-stash to "apply --index"
stash@{1}: master: 5be6007... Rewrite "git-frotz" to "git frotz"
stash@{2}: master: 36e5e70... Start deprecating "git-command" in favor of "git command"
stash@{3}: master: 3b0d999... Merge branch 'jo/init'
But each of the stash is _not_ about these commits, but is about
some change that happens to be on top of them.
So risking to make it a tad longer, how about doing this on top?
---
git-stash.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index 9deda44..dd721d2 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -71,7 +71,7 @@ save_stash () {
git commit-tree $w_tree -p $b_commit -p $i_commit) ||
die "Cannot record working tree state"
- git update-ref -m "$msg" $ref_stash $w_commit ||
+ git update-ref -m "WIP on $msg" $ref_stash $w_commit ||
die "Cannot save the current status"
printf >&2 'Saved WIP on %s\n' "$msg"
}
^ permalink raw reply related
* Re: [PATCH] stash: end commit log with a newline
From: しらいしななこ @ 2007-07-04 5:10 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Git
In-Reply-To: <20070703085906.GA4963@lala>
Quoting Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>:
> If I do
>
> git cat-file commit $commitid
>
> for a commit created by stash, the next prompt starts directly after the
> shortlog of HEAD.
Thank you for fixing my bug.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
----------------------------------------------------------------------
Free pop3 email with a spam filter.
http://www.bluebottle.com/tag/5
^ permalink raw reply
* Re: [PATCH] git-repack: generational repacking (and example hook script)
From: Sam Vilain @ 2007-07-04 6:16 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Nicolas Pitre, Junio C Hamano, git
In-Reply-To: <Pine.LNX.4.64.0707040155240.4071@racer.site>
Johannes Schindelin wrote:
>>>> 1. Do you agree that some users would want their git repositories to be
>>>> "maintenance free"?
>>> I'm not so sure.
>> Well, no offence, but I think you should withhold from voicing a
>> fundamental concern as this, because you're not one of its target users.
> Let's put it this way. A lot of car drivers would probably agree that it
> is a Good Thing (tm) if their car automatically went to get gas, before it
> ran out of it. Less hassle, right?
>
> Yes, except if your car decides to get gas when you are already late,
> speeding, trying to catch your plane.
Ok, but if you're only packing a few hundred objects it usually won't
matter because it is fast enough that you hardly notice.
And if you don't like it, you turn it off, or don't turn it on.
Sam.
^ permalink raw reply
* Re: [PATCH] git-repack: generational repacking (and example hook script)
From: Alex Riesen @ 2007-07-04 7:02 UTC (permalink / raw)
To: Sam Vilain; +Cc: Johannes Schindelin, Nicolas Pitre, Junio C Hamano, git
In-Reply-To: <468B3B42.2040103@vilain.net>
On 7/4/07, Sam Vilain <sam@vilain.net> wrote:
> Johannes Schindelin wrote:
> >>>> 1. Do you agree that some users would want their git repositories to be
> >>>> "maintenance free"?
> >>> I'm not so sure.
> >> Well, no offence, but I think you should withhold from voicing a
> >> fundamental concern as this, because you're not one of its target users.
> > Let's put it this way. A lot of car drivers would probably agree that it
> > is a Good Thing (tm) if their car automatically went to get gas, before it
> > ran out of it. Less hassle, right?
> >
> > Yes, except if your car decides to get gas when you are already late,
> > speeding, trying to catch your plane.
>
> Ok, but if you're only packing a few hundred objects it usually won't
> matter because it is fast enough that you hardly notice.
Unless you are on Windows, MacOSX, a notebook with P233, or unless
it is your home server in cellar built out of decommissioned desktop
(trusty old P133 with reasonable (for such a thing) 256Mb).
^ permalink raw reply
* [PATCH] filter-branch documentation: some more touch-ups.
From: Johannes Sixt @ 2007-07-04 7:32 UTC (permalink / raw)
To: Johannes Schindelin
Cc: git, gitster, Frank Lichtenheld, j.sixt, Johannes Sixt
In-Reply-To: <20070703220540.GN12721@planck.djpig.de>
- The map function used to fail, but no longer does (since 3520e1e8687.)
- Fix the "edge-graft" example.
- Show the same using .git/info/grafts.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
I think that "edge-graft" makes more sense than "etch-graft".
Native speakers, please?
I tried the example, and its quoting was incorrect. The reason is that
the shell removes the single quotes even if they are in the middle of
a word; so they didn't end up in the eval'd script and made sed barf.
-- Hannes
Documentation/git-filter-branch.txt | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index ee60a1a..528ccc8 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -57,8 +57,9 @@ variables are set before the first filter is run.
A 'map' function is available that takes an "original sha1 id" argument
and outputs a "rewritten sha1 id" if the commit has been already
-rewritten, fails otherwise; the 'map' function can return several
-ids on separate lines if your commit filter emitted multiple commits.
+rewritten, and "original sha1 id" otherwise; the 'map' function can
+return several ids on separate lines if your commit filter emitted
+multiple commits.
OPTIONS
@@ -164,12 +165,12 @@ git filter-branch --index-filter 'git update-index --remove filename' newbranch
Now, you will get the rewritten history saved in the branch 'newbranch'
(your current branch is left untouched).
-To "etch-graft" a commit to the revision history (set a commit to be
+To "edge-graft" a commit to the revision history (set a commit to be
the parent of the current initial commit and propagate that):
-----------------------------------------------------------------------
-git filter-branch --parent-filter sed\ 's/^$/-p <graft-id>/' newbranch
-----------------------------------------------------------------------
+------------------------------------------------------------------------
+git filter-branch --parent-filter 'sed "s/^\$/-p <graft-id>/"' newbranch
+------------------------------------------------------------------------
(if the parent string is empty - therefore we are dealing with the
initial commit - add graftcommit as a parent). Note that this assumes
@@ -181,6 +182,13 @@ git filter-branch --parent-filter \
'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' newbranch
-------------------------------------------------------------------------------
+or even simpler:
+
+-----------------------------------------------
+echo "$commit-id $graft-id" >> .git/info/grafts
+git filter-branch newbranch $graft-id..
+-----------------------------------------------
+
To remove commits authored by "Darl McBribe" from the history:
------------------------------------------------------------------------------
--
1.5.3.rc0.5.g7cd9
^ permalink raw reply related
* Re: [PATCH] gitk: fix for "gitk <ambiguous-name> --"
From: Gerrit Pape @ 2007-07-04 7:37 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.64.0707032353330.4071@racer.site>
On Tue, Jul 03, 2007 at 11:55:24PM +0100, Johannes Schindelin wrote:
> If you have an ambiguous ref, i.e. a file in the working directory bears
> the same name, you have to use "--" at the end to disambiguate ref from
> file. This works with "git rev-list". Make it work with gitk, too.
>
> Noticed by Uwe Kleine-K??nig.
Not sure anymore why, but I patched differently
http://article.gmane.org/gmane.comp.version-control.git/48102
Regards, Gerrit.
^ permalink raw reply
* Re: [PATCH] stash: end commit log with a newline
From: Uwe Kleine-König @ 2007-07-04 7:44 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, nanako3
In-Reply-To: <7vodiskb3d.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> I noticed another thing. The entries shown in "git stash list"
> look like this:
>
> stash@{0}: js/stash: e1d32c1... Teach git-stash to "apply --index"
> stash@{1}: master: 5be6007... Rewrite "git-frotz" to "git frotz"
> stash@{2}: master: 36e5e70... Start deprecating "git-command" in favor of "git command"
> stash@{3}: master: 3b0d999... Merge branch 'jo/init'
>
> But each of the stash is _not_ about these commits, but is about
> some change that happens to be on top of them.
>
> So risking to make it a tad longer, how about doing this on top?
>
> - git update-ref -m "$msg" $ref_stash $w_commit ||
> + git update-ref -m "WIP on $msg" $ref_stash $w_commit ||
I like that. I already wondered about that, too. But not as much as
thinking about an alternative.
So:
Acked-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Best regards
Uwe
--
Uwe Kleine-König
http://www.google.com/search?q=gravity+on+earth%3D
^ permalink raw reply
* [PATCH] filter-branch: Avoid an error message in the map function.
From: Johannes Sixt @ 2007-07-04 7:54 UTC (permalink / raw)
To: gitster; +Cc: git, Johannes Schindelin, j.sixt, Johannes Sixt
When the map function didn't find the rewritten commit of the passed in
original id, it printed the original id, but it still fell through to
the 'cat', which failed with an error message.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
Is the sequence of && and || ok, or do you prefer if-then-else-fi?
-- Hannes
git-filter-branch.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 22fb5bf..ff1cbcf 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -16,8 +16,9 @@ USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] DESTBRANCH [REV-RANGE]"
map()
{
# if it was not rewritten, take the original
- test -r "$workdir/../map/$1" || echo "$1"
- cat "$workdir/../map/$1"
+ test -r "$workdir/../map/$1" &&
+ cat "$workdir/../map/$1" ||
+ echo "$1"
}
# When piped a commit, output a script to set the ident of either
--
1.5.3.rc0.5.g7cd9
^ permalink raw reply related
* Re: git-svn: libsvn-perl_1.4.4 and do_switch()
From: Gerrit Pape @ 2007-07-04 8:04 UTC (permalink / raw)
To: git
In-Reply-To: <20070626133704.24521.qmail@a4f750d1ddce1f.315fe32.mid.smarden.org>
On Tue, Jun 26, 2007 at 01:37:04PM +0000, Gerrit Pape wrote:
> Hi, on Debian unstable the current version of libsvn-perl is 1.4.4dfsg1.
> With this version git-svn uses do_switch instead of do_update, which
> seems to not work properly, please see
>
> http://bugs.debian.org/430091
>
> on how to reproduce the problem.
Hi, more people ran into this problem, and reported through
http://bugs.debian.org/430091
Can anyone confirm that this is a bug in subversion 1.4.4, or is it a
bug in git-svn?
Thanks, Gerrit.
^ permalink raw reply
* efficient way to filter several branches with common history?
From: Steffen Prohaska @ 2007-07-04 8:11 UTC (permalink / raw)
To: Git Mailing List
Is there an efficient way to filter several branches at once
through git-filter-branch? Often several branches have a lot
of common history. Therefore, I suspect it would be much more
efficient to filter them with one call to git-filter-branch.
For example how can I efficiently filter all origin/* branches
to filtered/* branches?
Steffen
^ permalink raw reply
* Alter git-checkout reflog message to include "from" branch
From: Sean @ 2007-07-04 8:33 UTC (permalink / raw)
To: git
As suggested by Junio, adding the current branch name to the
reflog message for git-checkout would be helpful. For example:
"checkout: moving from next to master"
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
diff --git a/git-checkout.sh b/git-checkout.sh
index e00b697..17f4392 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -259,7 +259,8 @@ if [ "$?" -eq 0 ]; then
fi
if test -n "$branch"
then
- GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving to $branch" HEAD "refs/heads/$branch"
+ old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+ GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from $old_branch_name to $branch" HEAD "refs/heads/$branch"
if test -n "$quiet"
then
true # nothing
^ permalink raw reply related
* [PATCH] filter-branch: added missing warn function
From: Steffen Prohaska @ 2007-07-04 8:36 UTC (permalink / raw)
To: git; +Cc: Steffen Prohaska
--tag-name-filter may have failed before because
warn is used for reporting but was not available.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
git-filter-branch.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index a2fcebc..958f28e 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -194,6 +194,10 @@ set -e
USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] DESTBRANCH [REV-RANGE]"
. git-sh-setup
+warn () {
+ echo "$*" >&2
+}
+
map()
{
# if it was not rewritten, take the original
--
1.5.2.2.647.g75b2fc
^ permalink raw reply related
* Re: efficient way to filter several branches with common history?
From: Johannes Sixt @ 2007-07-04 8:37 UTC (permalink / raw)
To: git
In-Reply-To: <652B0F85-D0E4-4BF0-8DFC-212B6C0650AF@zib.de>
Steffen Prohaska wrote:
>
> Is there an efficient way to filter several branches at once
> through git-filter-branch? Often several branches have a lot
> of common history. Therefore, I suspect it would be much more
> efficient to filter them with one call to git-filter-branch.
> For example how can I efficiently filter all origin/* branches
> to filtered/* branches?
That feature is not yet implemented.
In the meantime do it this way:
Make an octopus merge of the branches onto a new branch. (If you have
more than a dozen or so, you better make a hierarchy of octopusses.) You
don't need to resolve conflicts (you are not interested in the merge
result), or use -s ours to avoid them in the first place.
Then filter that new branch.
Then create new refs at the rewritten commits:
$ git update-ref refs/filtered/b1 $id-of-rewritten-origin/b1
$ ...
Use gitk to find the $ids-of-rewritten-origin/*
-- Hannes
^ permalink raw reply
* Re: [PATCH] gitk: fix for "gitk <ambiguous-name> --"
From: Uwe Kleine-König @ 2007-07-04 8:38 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Paul Mackerras, Linus Torvalds, git
In-Reply-To: <Pine.LNX.4.64.0707032353330.4071@racer.site>
Hello Johannes,
> If you have an ambiguous ref, i.e. a file in the working directory bears
> the same name, you have to use "--" at the end to disambiguate ref from
> file. This works with "git rev-list". Make it work with gitk, too.
This fixes only one half of the problem. Now
gitk fixes ^linus/master --
works fine, but
gitk fixes ^linus/master
still hangs.
I didn't try Gerrits patch yet.
BTW, I don't use a range, because originally I used something like:
git branch | cut -b3- | grep -v ^attic/ | xargs gitk ^linus/master
Now I have to think how I can add the ending "--" ...
Best regards
Uwe
--
Uwe Kleine-König
5 out of 4 people have trouble with fractions.
^ permalink raw reply
* Re: [PATCH] git-init: set core.worktree if GIT_WORK_TREE is specified
From: Matthias Lederhofer @ 2007-07-04 9:29 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Linus Torvalds
In-Reply-To: <20070703224919.GA22578@moooo.ath.cx>
> + if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/')
> + die("Unable to read current working directory");
Dscho just pointed out that this causes problems on windows. The same
is also in setup_git_directory_gently and was there before I touched
it, introduced by Linus in d288a700. What was the original reason to
do this? Are there implementations of getcwd which return a relative
path?
Additionally there are other places which need to check if some user
supplied path is absolute. Should we have a macro/function for that
which depends on the os and checks for path[0] = '/' on unix and
perhaps path[1] = ':' on windows?
^ permalink raw reply
* git-svn dcommit fail
From: Dongsheng Song @ 2007-07-04 9:56 UTC (permalink / raw)
To: Git Mailing List
After some merge operation,
$ git-svn rebase
Current branch master is up to date.
$ git-svn dcommit
Unable to extract revision information from commit
f10ff0772f96ec434b27d47efaee082190bb8516~1
Thanks for some help.
---
Dongsheng
^ permalink raw reply
* Re: Pingback/Trackback for Git?
From: Thomas Perl @ 2007-07-04 9:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vbqeslpnz.fsf@assigned-by-dhcp.cox.net>
Hello, Junio!
2007/7/4, Junio C Hamano <gitster@pobox.com>:
> It was unclear to me who does what and when in the overall
> picture you envision after reading that page. You seem to
> assume there is a prominent ping/trackback repository that
> everybody who is interested looks at. Who updates it? When?
> With what? How does the namespace inside that repository
> managed, if managed in any way? Given a project name, how does
> one learn which pick/grackback repository (and perhaps which
> branch) to go to to learn the current status about it?
Every repository keeps track of the pingbacks it receives. The
simplest way of storing all pingbacks would be a simple text file that
lists one repository per line in a URL, i.e.
http://git.server.com/repos/game.git
git://mirrors.git-hosting.com/ga/game.git
http://johnny.org/my-projects/game.git
http://universityx.edu/~bob/src/game.git
If a user clones a repository, it can copy this trackback list. Git
can also optionally use this list to fetch objects from multiple
servers to increase performance (imagine an upstream git:// repository
with a forked http:// repository that has packs, the client could use
the git:// repository for fetching as much single object as possible
and only using the forked repository for all objects not yet found in
the upstream repository).
Sending a pingback should append the pinging repository URL to the
pinged repository's list (see above). Before appending the URL, the
pinged repository should check if the URL exists and if there is a Git
repository at the given URL and if the pinging repository is based on
the pinged repository.
There is not a single repository with pingbacks/trackbacks, but every
repository has its own list of "related" repositories. So when I'm
interested in the repository from project at URL "X", I can fetch its
repository or only its mirror list and get a list of URLs that also
carry (derived) versions of the project at URL "X".
Of course, your idea with having a centralized repository (that only
stores URLs) would be nice when an upstream Git repository dies to
find some other repository where the data is still available:
1) Clone repository from URL "X"
2) 404 -- not found
3) Get list of mirrors from URL repository
4) Download repository from other URL
But that defeats some gains from a truly distributed vcs, so just
keeping track of a list of URLs that cloned from this repository
should be enough.
^ permalink raw reply
* Re: [PATCH] format-patch: Add format.subjectprefix config option
From: Alex Riesen @ 2007-07-04 10:00 UTC (permalink / raw)
To: Adam Roben; +Cc: git, Junio C Hamano
In-Reply-To: <1183337339745-git-send-email-aroben@apple.com>
On 7/2/07, Adam Roben <aroben@apple.com> wrote:
> This change lets you use the format.subjectprefix config option to override the
> default subject prefix.
It is incomplete. The patch make git show --pretty=email produce subject
lines like "Subject: [(null)] ..." because revlist argument parser
will not setup
the prefix. Besides git-show also git-log (and rev-list and maybe
something else)
accept --pretty=email option which supposed to produce the same output as
git-format-patch.
^ permalink raw reply
* Re: [PATCH] git-init: set core.worktree if GIT_WORK_TREE is specified
From: Johannes Sixt @ 2007-07-04 10:41 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Linus Torvalds
In-Reply-To: <20070704092915.GA18597@moooo.ath.cx>
Matthias Lederhofer wrote:
>
> > + if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/')
> > + die("Unable to read current working directory");
>
> Dscho just pointed out that this causes problems on windows. The same
> is also in setup_git_directory_gently and was there before I touched
> it, introduced by Linus in d288a700. What was the original reason to
> do this? Are there implementations of getcwd which return a relative
> path?
>
> Additionally there are other places which need to check if some user
> supplied path is absolute. Should we have a macro/function for that
> which depends on the os and checks for path[0] = '/' on unix and
> perhaps path[1] = ':' on windows?
I've modified some places (that check for an absolute path) in the MinGW
port to read (path[0] == '/' || path[1] == ':'). I don't think that it's
necessary that you cater for this case in your code - I'll take care of
it in the MinGW port. Of course, a hint that there is another place to
watch out for, or even better a test case in t/, is most appreciated.
I still hope to find some time to rework the MinGW port. Then such
details will be hidden behind a is_path_absolute() function. Or maybe
getcwd_or_die() ;)
-- Hannes
^ permalink raw reply
* [PATCH] Handle missing prefix for "Subject:" as if no prefix given
From: Alex Riesen @ 2007-07-04 10:41 UTC (permalink / raw)
To: Adam Roben; +Cc: git, Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
log-tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
[-- Attachment #2: 0001-Handle-missing-prefix-for-Subject-as-if-no-prefix.txt --]
[-- Type: text/plain, Size: 791 bytes --]
From afd3d7d62607fcdd9866c22641c8623711ab6147 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa@limbo.localdomain>
Date: Wed, 4 Jul 2007 12:33:46 +0200
Subject: [PATCH] Handle missing prefix for "Subject:" as if no prefix given
---
log-tree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/log-tree.c b/log-tree.c
index ced3f33..8624d5a 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -200,7 +200,7 @@ void show_log(struct rev_info *opt, const char *sep)
digits_in_number(opt->total),
opt->nr, opt->total);
subject = buffer;
- } else if (opt->total == 0) {
+ } else if (opt->total == 0 && opt->subject_prefix && *opt->subject_prefix) {
static char buffer[256];
snprintf(buffer, sizeof(buffer),
"Subject: [%s] ",
--
1.5.2.2.669.gad316
^ permalink raw reply related
* [PATCH] Handle format.subjectprefix for every command which accepts --pretty
From: Alex Riesen @ 2007-07-04 10:42 UTC (permalink / raw)
To: Adam Roben; +Cc: git, Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
Because the --pretty can be given as --pretty=email which historically produced
mails with patches. IOW, exactly what git-format-patch does.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
builtin-log.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
[-- Attachment #2: 0002-Handle-format.subjectprefix-for-every-command-which.txt --]
[-- Type: text/plain, Size: 2286 bytes --]
From 3c8b524c775a96eb0e9b638e3c0b194d8743594a Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa@limbo.localdomain>
Date: Wed, 4 Jul 2007 12:37:27 +0200
Subject: [PATCH] Handle format.subjectprefix for every command which accepts --pretty
Because the --pretty can be given as --pretty=email which historically produced
mails with patches. IOW, exactly what git-format-patch does.
---
builtin-log.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 5dc2c1c..13bae31 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -16,6 +16,7 @@
#include "refs.h"
static int default_show_root = 1;
+static const char *fmt_patch_subject_prefix = "PATCH";
/* this is in builtin-diff.c */
void add_head(struct rev_info *revs);
@@ -55,6 +56,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
rev->commit_format = CMIT_FMT_DEFAULT;
rev->verbose_header = 1;
rev->show_root_diff = default_show_root;
+ rev->subject_prefix = fmt_patch_subject_prefix;
argc = setup_revisions(argc, argv, rev, "HEAD");
if (rev->diffopt.pickaxe || rev->diffopt.filter)
rev->always_show_header = 0;
@@ -94,6 +96,12 @@ static int cmd_log_walk(struct rev_info *rev)
static int git_log_config(const char *var, const char *value)
{
+ if (!strcmp(var, "format.subjectprefix")) {
+ if (!value)
+ die("format.subjectprefix without value");
+ fmt_patch_subject_prefix = xstrdup(value);
+ return 0;
+ }
if (!strcmp(var, "log.showroot")) {
default_show_root = git_config_bool(var, value);
return 0;
@@ -265,7 +273,6 @@ static int istitlechar(char c)
static char *extra_headers = NULL;
static int extra_headers_size = 0;
-static const char *fmt_patch_subject_prefix = "PATCH";
static const char *fmt_patch_suffix = ".patch";
static int git_format_config(const char *var, const char *value)
@@ -291,12 +298,6 @@ static int git_format_config(const char *var, const char *value)
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
return 0;
}
- if (!strcmp(var, "format.subjectprefix")) {
- if (!value)
- die("format.subjectprefix without value");
- fmt_patch_subject_prefix = xstrdup(value);
- return 0;
- }
return git_log_config(var, value);
}
--
1.5.2.2.669.gad316
^ 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