* Re: [PATCH] Modified the default git help message to be grouped by topic
From: Junio C Hamano @ 2008-12-03 0:10 UTC (permalink / raw)
To: Jeff King; +Cc: Johannes Schindelin, James Pickens, Scott Chacon, git
In-Reply-To: <20081202233004.GA22379@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Tue, Dec 02, 2008 at 11:55:03PM +0100, Johannes Schindelin wrote:
>
>> If the whole thing gets longer than 24 lines, we have to leave some things
>> out. Personally, I consider rm and mv unimportant enough that they could
>> be shown in an extended list, but be left out of the summary page.
>
> For the record, the current output is 26 lines, plus you probably want
> to account for 1 line of the user's next shell prompt. So we are 3 lines
> over already.
>
> Scott's proposal is about grouping the commands more sensibly. Many of
> the complaints are about the length of the output. Maybe we should scrap
> having a list of commands altogether and just point at section-specific
> documentation, each of which could discuss basic commands related to it.
>
> I think there has been mention of task-oriented documentation pointers
> before, and I think this is a place where we would want it.
It might not be a bad idea to make this "top page help" into an
interactive hierarchical help topic browser. You would start a page that
might look like this:
Bootstrapping -- preparing an area to work in
init, clone
Basic -- review, undo and record your changes
diff, status, checkout <path>, add, reset, commit
History -- inspect what you have now, and what happened before
log, blame, grep, show
Branching and Merging -- build and use alternate histories
branch, checkout -b, merge, rebase
Working with Others
remote, fetch, pull, push
with each of the command and the heading being a "link" (use ncurses for
that). If you choose the leaf-level command (say, 'diff'), you will get
the git-diff(1) manual page. If you pick one of the headings, say,
"Basic", you may get a more extended description of commands in the
category, that may include other basic commands not in the front page,
perhaps, like this:
(review)
diff HEAD: view what you did since the last commit
diff: view what you did since you last added
diff --cached: view what you already added
status: list what are added and changes yet to be added
(undo)
checkout path...: checkout a copy from the staging area
checkout HEAD path...: checkout a copy from the last commit
reset: undo earlier "git add" to the staging area
reset path...: do so only for the named paths
(record)
mv path1 path2: move the state of path1 to path2
rm path2: remove path2
rm --cached path2: do so without losing the copy in the working tree
add: add the contents to the staging area
add -p: do so interactively, hunk by hunk
commit: record the changes you added to the staging area
commit path...: record all the changes to the paths, ignoring
changes you added to the staging area for other paths.
and again each element can be a "link".
^ permalink raw reply
* Re: git-p4 submit, Can't clobber writable file
From: Reece Dunn @ 2008-12-02 23:51 UTC (permalink / raw)
To: garyyang6; +Cc: git
In-Reply-To: <40586.80065.qm@web37902.mail.mud.yahoo.com>
2008/12/2 Gary Yang <garyyang6@yahoo.com>:
>
> I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt
>
> But, I am not able to git-p4 submit. Any idea?
>
> git-p4 clone //build/scripts build_scripts
> cd build_scripts
> vi foo.h
> git commit foo.h
> git-p4 rebase
> git-p4 submit
>
> from sets import Set;
> Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/
> Syncronizing p4 checkout...
This will be running a `p4 sync ...` command to ensure that the files
are up-to-date.
> //build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h
> Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h
> //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c
> Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c
> ......
> command failed: p4 sync ...
Perforce will mark files as readonly when it does a checkout. When you
use `p4 edit` to say you have made changes to the file, Perforce
removes the readonly bit.
What is happening here is that the sync (checkout) command is trying
to write foo.h/c to your build_scripts directory, but because they
already exist there *and* are not readonly, Perforce is producing that
error as it does not want to overwrite any files that have changed
locally.
Not sure what is happening on the git-p4 side, though.
- Reece
^ permalink raw reply
* Re: [PATCH] Modified the default git help message to be grouped by topic
From: Scott Chacon @ 2008-12-02 23:39 UTC (permalink / raw)
To: Jeff King; +Cc: Johannes Schindelin, James Pickens, Junio C Hamano, git
In-Reply-To: <20081202233004.GA22379@coredump.intra.peff.net>
Hi,
On Tue, Dec 2, 2008 at 3:30 PM, Jeff King <peff@peff.net> wrote:
> On Tue, Dec 02, 2008 at 11:55:03PM +0100, Johannes Schindelin wrote:
>
>> If the whole thing gets longer than 24 lines, we have to leave some things
>> out. Personally, I consider rm and mv unimportant enough that they could
>> be shown in an extended list, but be left out of the summary page.
>
> For the record, the current output is 26 lines, plus you probably want
> to account for 1 line of the user's next shell prompt. So we are 3 lines
> over already.
>
> Scott's proposal is about grouping the commands more sensibly. Many of
> the complaints are about the length of the output. Maybe we should scrap
> having a list of commands altogether and just point at section-specific
> documentation, each of which could discuss basic commands related to it.
I've always felt it was helpful to newcomers to have that page there
with the couple dozen commands you might use - mostly in case you've
forgotten what the exact command name was. Hg does something like 'hg
help' which gives you more commands, but I feel like just having the
quick cheat-sheet is generally really helpful. If someone just wants
to remember what the command 'checkout' was, I wouldn't want them to
have to go to two places - one to look up what the task document was
and then another to view that.
My $0.02
> I think there has been mention of task-oriented documentation pointers
> before, and I think this is a place where we would want it.
>
> -Peff
>
Scott
^ permalink raw reply
* Re: [PATCH] gitweb: Optional grouping of projects by category
From: Jakub Narebski @ 2008-12-02 23:36 UTC (permalink / raw)
To: Sebastien Cevey
Cc: git, Junio C Hamano, Petr Baudis, Gustavo Sverzut Barbieri
In-Reply-To: <87wsei1uvp.wl%seb@cine7.net>
On Tue, 2 Dec 2008, Sebastien Cevey wrote:
> This adds the GITWEB_GROUP_CATEGORIES option which, if enabled, will
> result in grouping projects by category on the project list page.
Should this really be build time configuration (to set default value)?
> The category is specified for each project by the $GIT_DIR/category file
> or the 'category' variable in its configuration file.
>
> The feature is inspired from Sham Chukoury's patch for the XMMS2
> gitweb, but has been rewritten for the current gitweb development
> HEAD.
>
> Thanks to Florian Ragwitz for Perl tips.
>
> Signed-off-by: Sebastien Cevey <seb@cine7.net>
> ---
>
> I submitted a previous version of this patch on July 27, but was told
> to wait for the end of the feature freeze. I submitted it again on
> September 5, but didn't get any reply. Hope to be luckier this time!
Unfortunately it looks like you hit the edge of feature freeze again.
It is not announced yet, as far as I remember, but we are now at
1.6.1-pre1. I'll add this patch to my queue to resubmit after 1.6.1
is released, if it wouldn't be accepted in time.
By the way, there was alternate patch series by Gustavo Sverzut Barbieri
on 29 July 2008 adding categories support to gitweb:
http://thread.gmane.org/gmane.comp.version-control.git/90553
with live demo at http://staff.get-e.org/
> This is a new version of the patch, which has been rebased onto the
> current HEAD of the master branch.
>
> Makefile | 2 +
> gitweb/README | 11 +++
> gitweb/gitweb.css | 5 ++
> gitweb/gitweb.perl | 173 +++++++++++++++++++++++++++++++++++-----------------
> 4 files changed, 135 insertions(+), 56 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 649cfb8..a8e8bbf 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -211,6 +211,7 @@ GITWEB_EXPORT_OK =
> GITWEB_STRICT_EXPORT =
> GITWEB_BASE_URL =
> GITWEB_LIST =
> +GITWEB_GROUP_CATEGORIES =
> GITWEB_HOMETEXT = indextext.html
> GITWEB_CSS = gitweb.css
> GITWEB_LOGO = git-logo.png
> @@ -1189,6 +1190,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
> -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
> -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
> -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
> + -e 's|++GITWEB_GROUP_CATEGORIES++|$(GITWEB_GROUP_CATEGORIES)|g' \
> -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
> -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
> -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
O.K. That is just support for build time configuration of default value
(default configuration).
> diff --git a/gitweb/README b/gitweb/README
> index 825162a..a6f82c5 100644
> --- a/gitweb/README
> +++ b/gitweb/README
> @@ -38,6 +38,11 @@ You can specify the following configuration variables when building GIT:
> using gitweb" in INSTALL file for gitweb to find out how to generate
> such file from scan of a directory. [No default, which means use root
> directory for projects]
> + * GITWEB_GROUP_CATEGORIES
> + Groups projects by category on the main projects list page if set
> + to true. The category of a project is determined by the
> + $GIT_DIR/category file or the 'category' variable in its
> + configuration file. [No default / Not set]
> * GITWEB_EXPORT_OK
> Show repository only if this file exists (in repository). Only
> effective if this variable evaluates to true. [No default / Not set]
> @@ -188,6 +193,12 @@ not include variables usually directly set during build):
> full description is available as 'title' attribute (usually shown on
> mouseover). By default set to 25, which might be too small if you
> use long project descriptions.
> + * $projects_list_group_categories
> + Enables the grouping of projects by category on the project list page.
> + * $project_list_default_category
> + Default category for projects for which none is specified. If set
> + to the empty string, such projects will remain uncategorized and
> + listed at the top, above categorized projects.
> * @git_base_url_list
> List of git base URLs used for URL to where fetch project from, shown
> in project summary page. Full URL is "$git_base_url/$project".
Nice documenting it, but I think you should also update "Per-repository
gitweb configuration" section in gitweb/README and mention category
(file) or gitweb.category repository configuration variable.
> diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
> index a01eac8..2dd45d6 100644
> --- a/gitweb/gitweb.css
> +++ b/gitweb/gitweb.css
> @@ -264,6 +264,11 @@ td.current_head {
> text-decoration: underline;
> }
>
> +td.category {
> + padding-top: 1em;
> + font-weight: bold;
> +}
> +
> table.diff_tree span.file_status.new {
> color: #008000;
> }
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 933e137..c1bcd96 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -87,6 +87,13 @@ our $projects_list = "++GITWEB_LIST++";
> # the width (in characters) of the projects list "Description" column
> our $projects_list_description_width = 25;
>
> +# group projects by category on the projects list
> +our $projects_list_group_categories = "++GITWEB_GROUP_CATEGORIES++";
> +
> +# default category if none specified
> +# (leave the empty string for no category)
> +our $project_list_default_category = "";
> +
> # default order of projects list
> # valid values are none, project, descr, owner, and age
> our $default_projects_order = "project";
> @@ -2001,18 +2008,28 @@ sub git_get_path_by_hash {
> ## ......................................................................
> ## git utility functions, directly accessing git repository
>
> -sub git_get_project_description {
> - my $path = shift;
> +sub git_get_project_config_from_file {
> + my ($name, $path) = @_;
>
> $git_dir = "$projectroot/$path";
> - open my $fd, "$git_dir/description"
> - or return git_get_project_config('description');
> - my $descr = <$fd>;
> + open my $fd, "$git_dir/$name"
> + or return git_get_project_config($name);
> + my $conf = <$fd>;
> close $fd;
> - if (defined $descr) {
> - chomp $descr;
> + if (defined $conf) {
> + chomp $conf;
> }
> - return $descr;
> + return $conf;
> +}
> +
> +sub git_get_project_description {
> + my $path = shift;
> + return git_get_project_config_from_file('description', $path);
> +}
> +
> +sub git_get_project_category {
> + my $path = shift;
> + return git_get_project_config_from_file('category', $path);
> }
I see you have resurrected (?) here git_get_project_config_from_file.
But I don't think it is correct name for this subroutine: it gets
config from a file in GIT_DIR _or_ from repository config.
Nevertheless nice that you avoided code duplication here.
>
> sub git_get_project_ctags {
> @@ -3907,8 +3924,9 @@ sub git_patchset_body {
>
> # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
> -# fills project list info (age, description, owner, forks) for each
> -# project in the list, removing invalid projects from returned list
> +# fills project list info (age, description, owner, category, forks)
> +# for each project in the list, removing invalid projects from
> +# returned list
> # NOTE: modifies $projlist, but does not remove entries from it
> sub fill_project_list_info {
> my ($projlist, $check_forks) = @_;
> @@ -3931,6 +3949,11 @@ sub fill_project_list_info {
> if (!defined $pr->{'owner'}) {
> $pr->{'owner'} = git_get_project_owner("$pr->{'path'}") || "";
> }
> + if ($projects_list_group_categories && !defined $pr->{'cat'}) {
> + my $cat = git_get_project_category($pr->{'path'}) ||
> + $project_list_default_category;
> + $pr->{'cat'} = to_utf8($cat);
> + }
> if ($check_forks) {
> my $pname = $pr->{'path'};
> if (($pname =~ s/\.git$//) &&
O.K., although I wonder if we wouldn't spell key name in full, i.e as
$pr->{'category'}. But I think you follow conventions established
earlier here...
> @@ -3948,6 +3971,19 @@ sub fill_project_list_info {
> return @projects;
> }
>
> +# returns a hash of categories, containing the list of project
> +# belonging to each category
> +sub build_category_list {
I'm not sure about the name of this subroutine...
> + my ($projlist) = @_;
I would use
my $projlist = shift;
here (or even $projects).
> + my %categories;
> +
> + for my $pr (@{ $projlist }) {
I would use simpler
for my $pr (@$projlist) {
here
> + push @{$categories{ $pr->{'cat'} }}, $pr;
> + }
> +
> + return %categories;
> +}
> +
> # print 'sort by' <th> element, generating 'sort by $name' replay link
> # if that order is not selected
> sub print_sort_th {
> @@ -3964,59 +4000,17 @@ sub print_sort_th {
> }
> }
>
This chunk looks worse that it really is by accident...
> -sub git_project_list_body {
It would be nice to have description what this subroutine does.
> +sub print_project_rows {
> # actually uses global variable $project
> - my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
> -
> - my ($check_forks) = gitweb_check_feature('forks');
> - my @projects = fill_project_list_info($projlist, $check_forks);
> + my ($projects, $from, $to, $check_forks, $show_ctags) = @_;
>
> - $order ||= $default_projects_order;
> $from = 0 unless defined $from;
> - $to = $#projects if (!defined $to || $#projects < $to);
> + $to = $#$projects if (!defined $to || $#$projects < $to);
>
> - my %order_info = (
> - project => { key => 'path', type => 'str' },
> - descr => { key => 'descr_long', type => 'str' },
> - owner => { key => 'owner', type => 'str' },
> - age => { key => 'age', type => 'num' }
> - );
> - my $oi = $order_info{$order};
> - if ($oi->{'type'} eq 'str') {
> - @projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
> - } else {
> - @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
> - }
> -
> - my $show_ctags = gitweb_check_feature('ctags');
> - if ($show_ctags) {
> - my %ctags;
> - foreach my $p (@projects) {
> - foreach my $ct (keys %{$p->{'ctags'}}) {
> - $ctags{$ct} += $p->{'ctags'}->{$ct};
> - }
> - }
> - my $cloud = git_populate_project_tagcloud(\%ctags);
> - print git_show_project_tagcloud($cloud, 64);
> - }
> -
> - print "<table class=\"project_list\">\n";
> - unless ($no_header) {
> - print "<tr>\n";
> - if ($check_forks) {
> - print "<th></th>\n";
> - }
> - print_sort_th('project', $order, 'Project');
> - print_sort_th('descr', $order, 'Description');
> - print_sort_th('owner', $order, 'Owner');
> - print_sort_th('age', $order, 'Last Change');
> - print "<th></th>\n" . # for links
> - "</tr>\n";
> - }
> my $alternate = 1;
> my $tagfilter = $cgi->param('by_tag');
> for (my $i = $from; $i <= $to; $i++) {
> - my $pr = $projects[$i];
> + my $pr = $projects->[$i];
>
> next if $tagfilter and $show_ctags and not grep { lc $_ eq lc $tagfilter } keys %{$pr->{'ctags'}};
> next if $searchtext and not $pr->{'path'} =~ /$searchtext/
> @@ -4060,6 +4054,73 @@ sub git_project_list_body {
> "</td>\n" .
> "</tr>\n";
> }
> +}
> +
> +sub git_project_list_body {
> + my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
> +
> + my ($check_forks) = gitweb_check_feature('forks');
> + my @projects = fill_project_list_info($projlist, $check_forks);
> +
> + $order ||= $default_projects_order;
> +
> + my %order_info = (
> + project => { key => 'path', type => 'str' },
> + descr => { key => 'descr_long', type => 'str' },
> + owner => { key => 'owner', type => 'str' },
> + age => { key => 'age', type => 'num' }
> + );
> + my $oi = $order_info{$order};
> + if ($oi->{'type'} eq 'str') {
> + @projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
> + } else {
> + @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
> + }
> +
> + my $show_ctags = gitweb_check_feature('ctags');
> + if ($show_ctags) {
> + my %ctags;
> + foreach my $p (@projects) {
> + foreach my $ct (keys %{$p->{'ctags'}}) {
> + $ctags{$ct} += $p->{'ctags'}->{$ct};
> + }
> + }
> + my $cloud = git_populate_project_tagcloud(\%ctags);
> + print git_show_project_tagcloud($cloud, 64);
> + }
> +
> + print "<table class=\"project_list\">\n";
> + unless ($no_header) {
> + print "<tr>\n";
> + if ($check_forks) {
> + print "<th></th>\n";
> + }
> + print_sort_th('project', $order, 'Project');
> + print_sort_th('descr', $order, 'Description');
> + print_sort_th('owner', $order, 'Owner');
> + print_sort_th('age', $order, 'Last Change');
> + print "<th></th>\n" . # for links
> + "</tr>\n";
> + }
> +
> + if ($projects_list_group_categories) {
> + my %categories = build_category_list(\@projects);
> + foreach my $cat (sort keys %categories) {
> + unless ($cat eq "") {
> + print "<tr>\n";
> + if ($check_forks) {
> + print "<td></td>\n";
> + }
> + print "<td class=\"category\" colspan=\"5\">$cat</td>\n";
> + print "</tr>\n";
> + }
> +
> + print_project_rows($categories{$cat}, $from, $to, $check_forks, $show_ctags);
> + }
Here is and important issue when adding categories support: how division
into categories interplays with sorting of projects. I see that you
choose to always sort categories alphabetically, and to sort projects
by given column within categories, instead of (more complicated) sorting
categories by first project (first by given order) in a category.
This I think should be mentioned (at least briefly) in commit message.
Another issue is how categories interplay with limiting number of
projects displayed. Currently it is no issue, because projects list
page is not divided into pages, but I think you didn't address this
in your patch.
> + } else {
> + print_project_rows(\@projects, $from, $to, $check_forks, $show_ctags);
> + }
> +
> if (defined $extra) {
> print "<tr>\n";
> if ($check_forks) {
> --
> 1.5.6.5
>
>
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] Modified the default git help message to be grouped by topic
From: Jeff King @ 2008-12-02 23:30 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: James Pickens, Scott Chacon, Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0812022353410.27091@racer>
On Tue, Dec 02, 2008 at 11:55:03PM +0100, Johannes Schindelin wrote:
> If the whole thing gets longer than 24 lines, we have to leave some things
> out. Personally, I consider rm and mv unimportant enough that they could
> be shown in an extended list, but be left out of the summary page.
For the record, the current output is 26 lines, plus you probably want
to account for 1 line of the user's next shell prompt. So we are 3 lines
over already.
Scott's proposal is about grouping the commands more sensibly. Many of
the complaints are about the length of the output. Maybe we should scrap
having a list of commands altogether and just point at section-specific
documentation, each of which could discuss basic commands related to it.
I think there has been mention of task-oriented documentation pointers
before, and I think this is a place where we would want it.
-Peff
^ permalink raw reply
* Re: git-svn with multiple remote repositories?
From: Jacob Helwig @ 2008-12-02 23:07 UTC (permalink / raw)
To: Josef Wolf; +Cc: Git
In-Reply-To: <20081202213930.GD12716@raven.wolf.lan>
No branch for your checkout is correct. Try something like: git
checkout -b foo public/trunk
On Dec 2, 2008, at 13:39, Josef Wolf <jw@raven.inka.de> wrote:
> Hello,
>
> I am trying to create a git repository with two remote svn
> repositories
> so that I can merge/move patch-sets back and forth between the svn
> repositories.
>
> This is what I have tried so far:
>
> mkdir -p project
> cd project
> git-svn init -R private -s https://foo.bar/repos/private
>
> Then I go and edit .git/config too look like this:
>
> [core]
> repositoryformatversion = 0
> filemode = true
> bare = false
> logallrefupdates = true
> [svn-remote "private"]
> url = https://foo.bar/repos/private
> fetch = trunk:refs/remotes/private/trunk
> branches = branches/*:refs/remotes/private/*
> tags = tags/*:refs/remotes/private/tags/*
> [svn-remote "public"]
> url = https://foo.bar/repos/public
> fetch = trunk:refs/remotes/public/trunk
> branches = branches/*:refs/remotes/public/*
> tags = tags/*:refs/remotes/public/tags/*
>
> And finally, I do
>
> git-svn fetch -R private
> git-svn fetch -R public
>
> Both commands seem to fetch the contents from their origins. But
> git-branch shows me only the local master branch with contents from
> the "private" svn repository. When I do
>
> git checkout public/trunk
>
> the contents actually change to reflect the "public" svn repository,
> but git-branch says I am on "(no branch)" at all.
>
> As a newbie to git, I am somewhat confused now. Any hints how I can
> get a hold on the remote branches merge between them?
>
> --
> 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
* Re: [PATCH] User's Manual: remove duplicated url at the end of Appendix B
From: J. Bruce Fields @ 2008-12-02 23:06 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Junio C Hamano, git
In-Reply-To: <1228157402-10961-1-git-send-email-vmiklos@frugalware.org>
On Mon, Dec 01, 2008 at 07:50:02PM +0100, Miklos Vajna wrote:
> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Oops, clearly correct, thanks.--b.
> ---
> Documentation/user-manual.txt | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
> index da9c6b2..9f527d3 100644
> --- a/Documentation/user-manual.txt
> +++ b/Documentation/user-manual.txt
> @@ -4572,4 +4572,3 @@ Alternates, clone -reference, etc.
> More on recovery from repository corruption. See:
> http://marc.theaimsgroup.com/?l=git&m=117263864820799&w=2
> http://marc.theaimsgroup.com/?l=git&m=117147855503798&w=2
> - http://marc.theaimsgroup.com/?l=git&m=117147855503798&w=2
> --
> 1.6.0.4
>
^ permalink raw reply
* Re: [PATCH] Modified the default git help message to be grouped by topic
From: Johannes Schindelin @ 2008-12-02 22:55 UTC (permalink / raw)
To: James Pickens; +Cc: Scott Chacon, Junio C Hamano, Jeff King, git
In-Reply-To: <885649360812021211u3d547982i8e1c3070972363e8@mail.gmail.com>
Hi,
On Tue, 2 Dec 2008, James Pickens wrote:
> On Mon, Dec 1, 2008 at 11:10 PM, Scott Chacon <schacon@gmail.com> wrote:
>
> > On Mon, Dec 1, 2008 at 5:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> >> If this list is meant to show "the most commonly used" basics, then
> >> you can trim the list somewhat. For example, "rm" and "mv" can be
> >> safely discarded, "status" can be replaced with "diff", and "diff"
> >> can be removed from "History Commands".
> >
> > I sent a new patch that removes 'rm' and 'mv' and removes the
> > common-cmd.h build process. I did keep the 'status' command, since in
> > my personal experience people tend to like having that command.
>
> Even though 'rm' might not be used very often, I think it's an important
> enough command that it should not be removed from the 'basics' list.
> AFAIK, the only other way to delete a file is 'rm file' followed by 'git
> add -u' or 'git commit -a'. Imagine a git newbie trying to figure that
> out.
>
> I'm tempted to say the same thing about 'mv' as well. And FWIW, I use
> 'status' a lot more than I use 'diff', so I would vote to keep 'status'
> in the list too.
If the whole thing gets longer than 24 lines, we have to leave some things
out. Personally, I consider rm and mv unimportant enough that they could
be shown in an extended list, but be left out of the summary page.
Ciao,
Dscho
^ permalink raw reply
* git-p4 submit, Can't clobber writable file
From: Gary Yang @ 2008-12-02 22:30 UTC (permalink / raw)
To: git
I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt
But, I am not able to git-p4 submit. Any idea?
git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit
from sets import Set;
Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/
Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h
Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h
//build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c
Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c
......
command failed: p4 sync ...
Thanks.
^ permalink raw reply
* Re: [PATCH] gitweb: fixes to gitweb feature check code
From: Junio C Hamano @ 2008-12-02 21:55 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Giuseppe Bilotta, git, Petr Baudis
In-Reply-To: <200812020253.09430.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> What I like about having all this, i.e. fix, futureproof and style
> correction in one single patch is the fact that fix doesn't introduce
> strange looking (gitweb_check_feature('bool_feat'))[0]... well, except
> encapsulated in a subroutine.
>
> From all possible splits of this feature into series of up to three
> patches I think I like the one with pure subroutine rename from *check*
> to *get* least...
Well, I have to say that you have a strange taste, sense of priorities,
and perhaps aversion to logical progression. Let's explain one more
time.
The case we had at hand was that a callee has a less-than-ideal calling
convention that has caused a few bugs by callers because they did not
understand the calling convention. You can argue it is not entirely
caller's fault that they failed to follow the calling convention, but the
fact remains that there are bugs taken as a whole.
First we fix the callers, because existing bugs get highest priority.
This is a pure bugfix patch that could even go to maintenance "bugfix
only" branch.
Then we fix the calling convention because we all know that the calling
convention was less-than-ideal. A large part of the reason the calling
convention was confusing was because the wording "check" implied it was a
boolean function. Logically, s/check/get/ would be a major part of fixing
that.
After calling convention is enhanced by a new function that lets callers
"check" via a boolean function, we can have them use that, which makes
them easier to read.
But remember that it is the order I wanted the patches to be presented for
review. After people involved in review agree that the result is good, I
do not have any problem in squashing the three steps into a single patch
for things like this after the end result is verified to be good (which we
did).
^ permalink raw reply
* Re: [PATCH] git-svn: Make branch use correct svn-remote
From: Eric Wong @ 2008-12-02 21:51 UTC (permalink / raw)
To: Deskin Miller; +Cc: git, gitster
In-Reply-To: <1228185780-22938-1-git-send-email-deskinm@umich.edu>
Deskin Miller <deskinm@umich.edu> wrote:
> The 'branch' subcommand incorrectly had the svn-remote to use hardcoded
> as 'svn', the default remote name. This meant that branches derived
> from other svn-remotes would try to use the branch and tag configuration
> for the 'svn' remote, potentially copying would-be branches to the wrong
> place in SVN, into the branch namespace for another project.
>
> Fix this by using the remote name extracted from the svn info for the
> specified git ref. Add a testcase for this behaviour.
>
> Signed-off-by: Deskin Miller <deskinm@umich.edu>
Looks alright to me, thanks Deskin.
Acked-by: Eric Wong <normalperson@yhbt.net>
> ---
> Applies on v1.6.1-rc1. Apologies for not catching this when first
> writing testcases for the branch subcommand.
>
> Deskin Miller
>
> git-svn.perl | 2 +-
> t/t9128-git-svn-cmd-branch.sh | 17 +++++++++++++++++
> 2 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 914c707..e64e97b 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -558,7 +558,7 @@ sub cmd_branch {
>
> my ($src, $rev, undef, $gs) = working_head_info($head);
>
> - my $remote = Git::SVN::read_all_remotes()->{svn};
> + my $remote = Git::SVN::read_all_remotes()->{$gs->{repo_id}};
> my $glob = $remote->{ $_tag ? 'tags' : 'branches' };
> my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
> my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());
> diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh
> index 47c4d4d..e2b6696 100755
> --- a/t/t9128-git-svn-cmd-branch.sh
> +++ b/t/t9128-git-svn-cmd-branch.sh
> @@ -56,4 +56,21 @@ test_expect_success 'git svn branch tests' '
> test_must_fail git svn tag tag1
> '
>
> +test_expect_success 'branch uses correct svn-remote' '
> + (svn co "$svnrepo" svn &&
> + cd svn &&
> + mkdir mirror &&
> + svn add mirror &&
> + svn copy trunk tags branches mirror/ &&
> + svn ci -m "made mirror" ) &&
> + rm -rf svn &&
> + git svn init -s -R mirror --prefix=mirror/ "$svnrepo"/mirror &&
> + git svn fetch -R mirror &&
> + git checkout mirror/trunk &&
> + base=$(git rev-parse HEAD:) &&
> + git svn branch -m "branch in mirror" d &&
> + test $base = $(git rev-parse remotes/mirror/d:) &&
> + test_must_fail git rev-parse remotes/d
> +'
> +
> test_done
> --
> 1.6.1.rc1
^ permalink raw reply
* [JGIT PATCH 2/2 v2] Improve closing of files in error situations.
From: Robin Rosenberg @ 2008-12-02 21:41 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1228252816-5987-2-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../exttst/org/spearce/jgit/lib/SpeedTestBase.java | 12 +++++--
.../dircache/DirCacheCGitCompatabilityTest.java | 24 ++++++++++-----
.../org/spearce/jgit/lib/RepositoryTestCase.java | 27 +++++++++++------
.../src/org/spearce/jgit/lib/GitIndex.java | 2 +-
.../src/org/spearce/jgit/lib/Repository.java | 31 +++++++++++++-------
5 files changed, 63 insertions(+), 33 deletions(-)
I was a bit quick there. This is an extended version of patch 2/2.
-- robin
diff --git a/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java b/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
index 11f7439..36a5e0e 100644
--- a/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
+++ b/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
@@ -72,10 +72,14 @@
protected void prepare(String[] refcmd) throws Exception {
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("kernel.ref"));
- kernelrepo = bufferedReader.readLine();
- bufferedReader.close();
- timeNativeGit(kernelrepo, refcmd);
- nativeTime = timeNativeGit(kernelrepo, refcmd);
+ try {
+ kernelrepo = bufferedReader.readLine();
+ bufferedReader.close();
+ timeNativeGit(kernelrepo, refcmd);
+ nativeTime = timeNativeGit(kernelrepo, refcmd);
+ } finally {
+ bufferedReader.close();
+ }
} catch (Exception e) {
System.out.println("Create a file named kernel.ref and put the path to the Linux kernels repository there");
throw e;
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java
index b052686..42832fe 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java
@@ -146,10 +146,14 @@ private File pathOf(final String name) {
final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<String, CGitIndexRecord>();
final BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(pathOf("gitgit.lsfiles")), "UTF-8"));
- String line;
- while ((line = br.readLine()) != null) {
- final CGitIndexRecord cr = new CGitIndexRecord(line);
- r.put(cr.path, cr);
+ try {
+ String line;
+ while ((line = br.readLine()) != null) {
+ final CGitIndexRecord cr = new CGitIndexRecord(line);
+ r.put(cr.path, cr);
+ }
+ } finally {
+ br.close();
}
return r;
}
@@ -158,10 +162,14 @@ private File pathOf(final String name) {
final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<String, CGitLsTreeRecord>();
final BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(pathOf("gitgit.lstree")), "UTF-8"));
- String line;
- while ((line = br.readLine()) != null) {
- final CGitLsTreeRecord cr = new CGitLsTreeRecord(line);
- r.put(cr.path, cr);
+ try {
+ String line;
+ while ((line = br.readLine()) != null) {
+ final CGitLsTreeRecord cr = new CGitLsTreeRecord(line);
+ r.put(cr.path, cr);
+ }
+ } finally {
+ br.close();
}
return r;
}
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
index 22bf395..8937145 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
@@ -152,14 +152,20 @@ private static void reportDeleteFailure(final String name,
protected static void copyFile(final File src, final File dst)
throws IOException {
final FileInputStream fis = new FileInputStream(src);
- final FileOutputStream fos = new FileOutputStream(dst);
- final byte[] buf = new byte[4096];
- int r;
- while ((r = fis.read(buf)) > 0) {
- fos.write(buf, 0, r);
+ try {
+ final FileOutputStream fos = new FileOutputStream(dst);
+ try {
+ final byte[] buf = new byte[4096];
+ int r;
+ while ((r = fis.read(buf)) > 0) {
+ fos.write(buf, 0, r);
+ }
+ } finally {
+ fos.close();
+ }
+ } finally {
+ fis.close();
}
- fis.close();
- fos.close();
}
protected File writeTrashFile(final String name, final String data)
@@ -170,8 +176,11 @@ protected File writeTrashFile(final String name, final String data)
throw new Error("Could not create directory " + tf.getParentFile());
final OutputStreamWriter fw = new OutputStreamWriter(
new FileOutputStream(tf), "UTF-8");
- fw.write(data);
- fw.close();
+ try {
+ fw.write(data);
+ } finally {
+ fw.close();
+ }
return tf;
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
index bafddef..7ff6754 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
@@ -547,8 +547,8 @@ public boolean isModified(File wd, boolean forceContentCheck) {
try {
InputStream is = new FileInputStream(file);
- ObjectWriter objectWriter = new ObjectWriter(db);
try {
+ ObjectWriter objectWriter = new ObjectWriter(db);
ObjectId newId = objectWriter.computeBlobSha1(file
.length(), is);
boolean ret = !newId.equals(sha1);
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index b54afd5..da1494f 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -144,10 +144,13 @@ public Repository(final File d) throws IOException {
final File altFile = FS.resolve(objectsDir, "info/alternates");
if (altFile.exists()) {
BufferedReader ar = new BufferedReader(new FileReader(altFile));
- for (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {
- readObjectsDirs(FS.resolve(objectsDir, alt), ret);
+ try {
+ for (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {
+ readObjectsDirs(FS.resolve(objectsDir, alt), ret);
+ }
+ } catch (Exception e) {
+ ar.close();
}
- ar.close();
}
return ret;
}
@@ -1027,15 +1030,21 @@ public boolean isStGitMode() {
if (isStGitMode()) {
File patchDir = new File(new File(getDirectory(),"patches"),getBranch());
BufferedReader apr = new BufferedReader(new FileReader(new File(patchDir,"applied")));
- for (String patchName=apr.readLine(); patchName!=null; patchName=apr.readLine()) {
- File topFile = new File(new File(new File(patchDir,"patches"), patchName), "top");
- BufferedReader tfr = new BufferedReader(new FileReader(topFile));
- String objectId = tfr.readLine();
- ObjectId id = ObjectId.fromString(objectId);
- ret.put(id, new StGitPatch(patchName, id));
- tfr.close();
+ try {
+ for (String patchName=apr.readLine(); patchName!=null; patchName=apr.readLine()) {
+ File topFile = new File(new File(new File(patchDir,"patches"), patchName), "top");
+ BufferedReader tfr = new BufferedReader(new FileReader(topFile));
+ try {
+ String objectId = tfr.readLine();
+ ObjectId id = ObjectId.fromString(objectId);
+ ret.put(id, new StGitPatch(patchName, id));
+ } finally {
+ tfr.close();
+ }
+ }
+ } finally {
+ apr.close();
}
- apr.close();
}
return ret;
}
--
1.6.0.3.640.g6331a
^ permalink raw reply related
* git-svn with multiple remote repositories?
From: Josef Wolf @ 2008-12-02 21:39 UTC (permalink / raw)
To: git
Hello,
I am trying to create a git repository with two remote svn repositories
so that I can merge/move patch-sets back and forth between the svn
repositories.
This is what I have tried so far:
mkdir -p project
cd project
git-svn init -R private -s https://foo.bar/repos/private
Then I go and edit .git/config too look like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[svn-remote "private"]
url = https://foo.bar/repos/private
fetch = trunk:refs/remotes/private/trunk
branches = branches/*:refs/remotes/private/*
tags = tags/*:refs/remotes/private/tags/*
[svn-remote "public"]
url = https://foo.bar/repos/public
fetch = trunk:refs/remotes/public/trunk
branches = branches/*:refs/remotes/public/*
tags = tags/*:refs/remotes/public/tags/*
And finally, I do
git-svn fetch -R private
git-svn fetch -R public
Both commands seem to fetch the contents from their origins. But
git-branch shows me only the local master branch with contents from
the "private" svn repository. When I do
git checkout public/trunk
the contents actually change to reflect the "public" svn repository,
but git-branch says I am on "(no branch)" at all.
As a newbie to git, I am somewhat confused now. Any hints how I can
get a hold on the remote branches merge between them?
^ permalink raw reply
* Re: [PATCH] Modified the default git help message to be grouped by topic
From: Boyd Stephen Smith Jr. @ 2008-12-02 21:33 UTC (permalink / raw)
To: git; +Cc: James Pickens, Scott Chacon, Junio C Hamano, Jeff King
In-Reply-To: <885649360812021211u3d547982i8e1c3070972363e8@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]
On Tuesday 02 December 2008, "James Pickens" <jepicken@gmail.com> wrote
about 'Re: [PATCH] Modified the default git help message to be grouped by
topic':
>On Mon, Dec 1, 2008 at 11:10 PM, Scott Chacon <schacon@gmail.com> wrote:
>> I sent a new patch that removes 'rm' and 'mv' and removes the
>> common-cmd.h build process. I did keep the 'status' command, since in
>> my personal experience people tend to like having that command.
>
>Even though 'rm' might not be used very often, I think it's an important
>enough command that it should not be removed from the 'basics' list.
>AFAIK, the only other way to delete a file is 'rm file' followed by 'git
>add -u' or 'git commit -a'. Imagine a git newbie trying to figure that
>out.
>
>I'm tempted to say the same thing about 'mv' as well. And FWIW, I use
>'status' a lot more than I use 'diff', so I would vote to keep 'status'
> in the list too.
x2 to all of both paragraphs, except that I'm not just "tempted"; I do say
that mv should be kept.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss03@volumehost.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.org/ \_/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [JGIT PATCH 2/2] Improve closing of files in error situations.
From: Robin Rosenberg @ 2008-12-02 21:20 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1228252816-5987-1-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../exttst/org/spearce/jgit/lib/SpeedTestBase.java | 12 +++++--
.../src/org/spearce/jgit/lib/Repository.java | 31 +++++++++++++-------
2 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java b/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
index 11f7439..36a5e0e 100644
--- a/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
+++ b/org.spearce.jgit.test/exttst/org/spearce/jgit/lib/SpeedTestBase.java
@@ -72,10 +72,14 @@
protected void prepare(String[] refcmd) throws Exception {
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("kernel.ref"));
- kernelrepo = bufferedReader.readLine();
- bufferedReader.close();
- timeNativeGit(kernelrepo, refcmd);
- nativeTime = timeNativeGit(kernelrepo, refcmd);
+ try {
+ kernelrepo = bufferedReader.readLine();
+ bufferedReader.close();
+ timeNativeGit(kernelrepo, refcmd);
+ nativeTime = timeNativeGit(kernelrepo, refcmd);
+ } finally {
+ bufferedReader.close();
+ }
} catch (Exception e) {
System.out.println("Create a file named kernel.ref and put the path to the Linux kernels repository there");
throw e;
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index b54afd5..da1494f 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -144,10 +144,13 @@ public Repository(final File d) throws IOException {
final File altFile = FS.resolve(objectsDir, "info/alternates");
if (altFile.exists()) {
BufferedReader ar = new BufferedReader(new FileReader(altFile));
- for (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {
- readObjectsDirs(FS.resolve(objectsDir, alt), ret);
+ try {
+ for (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {
+ readObjectsDirs(FS.resolve(objectsDir, alt), ret);
+ }
+ } catch (Exception e) {
+ ar.close();
}
- ar.close();
}
return ret;
}
@@ -1027,15 +1030,21 @@ public boolean isStGitMode() {
if (isStGitMode()) {
File patchDir = new File(new File(getDirectory(),"patches"),getBranch());
BufferedReader apr = new BufferedReader(new FileReader(new File(patchDir,"applied")));
- for (String patchName=apr.readLine(); patchName!=null; patchName=apr.readLine()) {
- File topFile = new File(new File(new File(patchDir,"patches"), patchName), "top");
- BufferedReader tfr = new BufferedReader(new FileReader(topFile));
- String objectId = tfr.readLine();
- ObjectId id = ObjectId.fromString(objectId);
- ret.put(id, new StGitPatch(patchName, id));
- tfr.close();
+ try {
+ for (String patchName=apr.readLine(); patchName!=null; patchName=apr.readLine()) {
+ File topFile = new File(new File(new File(patchDir,"patches"), patchName), "top");
+ BufferedReader tfr = new BufferedReader(new FileReader(topFile));
+ try {
+ String objectId = tfr.readLine();
+ ObjectId id = ObjectId.fromString(objectId);
+ ret.put(id, new StGitPatch(patchName, id));
+ } finally {
+ tfr.close();
+ }
+ }
+ } finally {
+ apr.close();
}
- apr.close();
}
return ret;
}
--
1.6.0.3.640.g6331a
^ permalink raw reply related
* [JGIT PATCH 1/2] Close a forgotten reference to the HEAD ref.
From: Robin Rosenberg @ 2008-12-02 21:20 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/lib/Repository.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index c953531..b54afd5 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -989,9 +989,10 @@ public Ref peel(final Ref ref) {
* @return true if HEAD points to a StGit patch.
*/
public boolean isStGitMode() {
+ File file = new File(getDirectory(), "HEAD");
+ BufferedReader reader = null;
try {
- File file = new File(getDirectory(), "HEAD");
- BufferedReader reader = new BufferedReader(new FileReader(file));
+ reader = new BufferedReader(new FileReader(file));
String string = reader.readLine();
if (!string.startsWith("ref: refs/heads/"))
return false;
@@ -1007,6 +1008,13 @@ public boolean isStGitMode() {
} catch (IOException e) {
e.printStackTrace();
return false;
+ } finally {
+ try {
+ if (reader != null)
+ reader.close();
+ } catch (IOException e1) {
+ // nothing to do here
+ }
}
}
--
1.6.0.3.640.g6331a
^ permalink raw reply related
* [PATCH] gitk: Use check-buttons' -text property instead of separate labels
From: Johannes Sixt @ 2008-12-02 20:42 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Previously the check-buttons' labels in the Preferences were separate
widgets. This had the disadvantage that in order to toggle the check-button
with the mouse the check-box had to be clicked. With this change the
check-box can also be toggled by clicking the label.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
gitk | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/gitk b/gitk
index 64a873d..ee1941c 100755
--- a/gitk
+++ b/gitk
@@ -10079,15 +10079,11 @@ proc doprefs {} {
-font optionfont
spinbox $top.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct
grid x $top.maxpctl $top.maxpct -sticky w
- frame $top.showlocal
- label $top.showlocal.l -text [mc "Show local changes"] -font optionfont
- checkbutton $top.showlocal.b -variable showlocalchanges
- pack $top.showlocal.b $top.showlocal.l -side left
+ checkbutton $top.showlocal -text [mc "Show local changes"] \
+ -font optionfont -variable showlocalchanges
grid x $top.showlocal -sticky w
- frame $top.autoselect
- label $top.autoselect.l -text [mc "Auto-select SHA1"] -font optionfont
- checkbutton $top.autoselect.b -variable autoselect
- pack $top.autoselect.b $top.autoselect.l -side left
+ checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
+ -font optionfont -variable autoselect
grid x $top.autoselect -sticky w
label $top.ddisp -text [mc "Diff display options"]
@@ -10095,20 +10091,14 @@ proc doprefs {} {
label $top.tabstopl -text [mc "Tab spacing"] -font optionfont
spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $top.tabstopl $top.tabstop -sticky w
- frame $top.ntag
- label $top.ntag.l -text [mc "Display nearby tags"] -font optionfont
- checkbutton $top.ntag.b -variable showneartags
- pack $top.ntag.b $top.ntag.l -side left
+ checkbutton $top.ntag -text [mc "Display nearby tags"] \
+ -font optionfont -variable showneartags
grid x $top.ntag -sticky w
- frame $top.ldiff
- label $top.ldiff.l -text [mc "Limit diffs to listed paths"] -font optionfont
- checkbutton $top.ldiff.b -variable limitdiffs
- pack $top.ldiff.b $top.ldiff.l -side left
+ checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
+ -font optionfont -variable limitdiffs
grid x $top.ldiff -sticky w
- frame $top.lattr
- label $top.lattr.l -text [mc "Support per-file encodings"] -font optionfont
- checkbutton $top.lattr.b -variable perfile_attrs
- pack $top.lattr.b $top.lattr.l -side left
+ checkbutton $top.lattr -text [mc "Support per-file encodings"] \
+ -font optionfont -variable perfile_attrs
grid x $top.lattr -sticky w
entry $top.extdifft -textvariable extdifftool
--
1.6.0.4.763.g42102
^ permalink raw reply related
* Re: Overwrite master
From: Peter Harris @ 2008-12-02 20:28 UTC (permalink / raw)
To: Nicholas Wieland; +Cc: git
In-Reply-To: <67A24C29-12A6-43B0-95D5-70910C5F8841@gmail.com>
On Tue, Dec 2, 2008 at 3:09 PM, Nicholas Wieland wrote:
> Il giorno 02/dic/08, alle ore 17:32, Peter Harris ha scritto:
>
>> On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:
>>>
>>> Hi *,
>>> I need to overwrite my master branch with another branch. I've already
>>> created a backup branch of my master.
>>
>> While on master,
>> "git reset --hard <newbranch>"
>
> That's what I tried.
> Unfortunately I don't know where to go after:
>
> ngw@slicingupeyeballs ~/zooppa$ git commit
> # On branch master
> # Your branch and 'origin/master' have diverged,
> # and have 444 and 25 different commit(s) each, respectively.
> #
> nothing to commit (working directory clean)
That means your tracking branch is different from your local branch, by a lot.
> Do I have to push ? If I pull it tries to merge ...
If you push, it will be denied (non-fast-forward).
If you force push, your state will be as you expect. Be aware that
you're creating trouble for everyone else who uses 'origin' if you
force push. Also be aware that you will be undoing any changes that
anyone else has pushed to origin in the mean time.
Basically, history is history. If you don't want to cause problems for
the other users of 'origin', you may have to live with history as it
is. You won't be able to overwrite master, although you will probably
try to be more careful in the future.
Peter Harris
^ permalink raw reply
* Multiple SVN Repos Inside A Git Repo
From: Tim Sally @ 2008-12-02 20:22 UTC (permalink / raw)
To: git
Using git-svn, it is possible to have different parts of a git repo
correspond to a specific svn repo? From my understanding after reading
the documentation, you need one git repository per svn. My example is
that I'm trying to set up a git repo to version control everything
from my classes, but each class has a separate svn repo. Also, the
number of git repos I can create is limited, and I'd rather not
clutter everything up with many separate git-svn repos.
Example structure:
class/
.......... systems/
.......... algorithms/
.......... physics/
class is one central git repository, and systems, algorithms, and
physics contain data from three svn repositories. Ideally, you could
commit/update to/from each svn repo individually, or all at once.
Tim
^ permalink raw reply
* Re: [PATCH] Modified the default git help message to be grouped by topic
From: James Pickens @ 2008-12-02 20:11 UTC (permalink / raw)
To: Scott Chacon; +Cc: Junio C Hamano, Jeff King, git
In-Reply-To: <d411cc4a0812012210h4cb59974sbda71abd2c64f93b@mail.gmail.com>
On Mon, Dec 1, 2008 at 11:10 PM, Scott Chacon <schacon@gmail.com> wrote:
> Hi,
>
> On Mon, Dec 1, 2008 at 5:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> If this list is meant to show "the most commonly used" basics, then you
>> can trim the list somewhat. For example, "rm" and "mv" can be safely
>> discarded, "status" can be replaced with "diff", and "diff" can be removed
>> from "History Commands".
>>
>
> I sent a new patch that removes 'rm' and 'mv' and removes the
> common-cmd.h build process. I did keep the 'status' command, since in
> my personal experience people tend to like having that command.
Even though 'rm' might not be used very often, I think it's an important
enough command that it should not be removed from the 'basics' list.
AFAIK, the only other way to delete a file is 'rm file' followed by 'git
add -u' or 'git commit -a'. Imagine a git newbie trying to figure that
out.
I'm tempted to say the same thing about 'mv' as well. And FWIW, I use
'status' a lot more than I use 'diff', so I would vote to keep 'status' in
the list too.
James
^ permalink raw reply
* Re: Overwrite master
From: Nicholas Wieland @ 2008-12-02 20:09 UTC (permalink / raw)
To: Peter Harris; +Cc: git
In-Reply-To: <eaa105840812020832p395ecefdq57e62f95182a3557@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
Il giorno 02/dic/08, alle ore 17:32, Peter Harris ha scritto:
> On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:
>> Hi *,
>> I need to overwrite my master branch with another branch. I've
>> already
>> created a backup branch of my master.
>
> While on master,
> "git reset --hard <newbranch>"
>
> Or while on a different branch,
> git branch -D master
> git branch master <newbranch>
That's what I tried.
Unfortunately I don't know where to go after:
ngw@slicingupeyeballs ~/zooppa$ git commit
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 444 and 25 different commit(s) each, respectively.
#
nothing to commit (working directory clean)
Do I have to push ? If I pull it tries to merge ...
Thanks a lot for your time,
ngw
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2435 bytes --]
^ permalink raw reply
* Re: git-p4, SyntaxError: invalid syntax
From: Jason Foreman @ 2008-12-02 19:45 UTC (permalink / raw)
To: git list
In-Reply-To: <186027.87419.qm@web37901.mail.mud.yahoo.com>
On Tue, Dec 2, 2008 at 1:08 PM, Gary Yang <garyyang6@yahoo.com> wrote:
>
> /home/gyang/bin/git-p4:161: Warning: 'yield' will become a reserved keyword in the future
> File "/user/svdc/pluo/bin/git-p4", line 161
> yield pattern
> ^
> SyntaxError: invalid syntax
>
This seems to indicate that your python doesn't support the "yield"
keyword (used in generators).
Are you using Python 2.2? If so, that is a very old Python and I'd
recommend upgrading. But even with 2.2 you can fix this by adding the
following import line:
from __future__ import generators
I'm not familiar with the git-p4 file specifically but the above
should hopefully fix your problem.
Cheers,
Jason
^ permalink raw reply
* git-p4, SyntaxError: invalid syntax
From: Gary Yang @ 2008-12-02 19:08 UTC (permalink / raw)
To: git list
I got git-p4 from “git clone git://git.kernel.org/pub/scm/git/git.git git”
I copied git-p4 from contrib/fast-import/git-p4 to /home/gyang/bin
I got SyntaxError when I ran,
git-p4 clone //depot/Workshop
/home/gyang/bin/git-p4:161: Warning: 'yield' will become a reserved keyword in the future
File "/user/svdc/pluo/bin/git-p4", line 161
yield pattern
^
SyntaxError: invalid syntax
I opened the file, git-p4. There are three import lines. I am not python programmer. Maybe I missed something in python? I have python installed at /usr/local/bin/python
which python
/usr/local/bin/python
vi git-p4
import optparse, sys, os, marshal, popen2, subprocess, shelve
import tempfile, getopt, sha, os.path, time, platform
import re
Can someone tell me what I missed?
Thanks.
^ permalink raw reply
* Re: Managing websites with git
From: Junio C Hamano @ 2008-12-02 19:07 UTC (permalink / raw)
To: Jeff King; +Cc: Jason Riedy, git
In-Reply-To: <20081202165507.GA15826@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Tue, Dec 02, 2008 at 10:55:34AM -0500, Jason Riedy wrote:
>
>> Ah, ok, thanks! Issuing a warning makes sense. I'm not sure if
>> denying such a push by default does...
> ...
> It shouldn't make you change how you work. At most, it will break an
> existing setup until you set receive.denycurrentbranch to false (again,
> if and when the default value changes). You can prepare for any such
> change now by pre-emptively setting the config value.
True.
But "pre-emptively" is a bit misleading. Please realize that the warning
is not about "this is a risky thing to do, you've been warned", but is
about "the behaviour to allow this may change in the future; if you rely
on it please set this config before that happens". We may end up not
flipping the default for a long time, but setting the config also has the
side effect of squelching the warning, so it never hurts to set it now.
^ permalink raw reply
* Re: Grafting mis-aligned trees.
From: Boyd Stephen Smith Jr. @ 2008-12-02 18:28 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
In-Reply-To: <493572A3.4070205@drmicha.warpmail.net>
[-- Attachment #1: Type: text/plain, Size: 2327 bytes --]
On Tuesday 02 December 2008, Michael J Gruber <git@drmicha.warpmail.net>
wrote about 'Re: Grafting mis-aligned trees.':
>Boyd Stephen Smith Jr. venit, vidit, dixit 02.12.2008 18:19:
>> I can't help thinking that rebase -ip might have helped. I wasn't
>> aware of -p when I was initially working on this problem. (It doesn't
>> help that I generally use Debian stable, and git 1.4 did not have -p.)
>
>rebase rebases one branch at a time, but you need to rebase/rewrite
>several, and the merge info between depends on rewritten sha1s.
Yes. I guess that's why I employed filter-branch to begin with.
>> I probably don't need the -f. If there are files that should be
>> ignored (and thus shouldn't be in the repo), I'll filter-branch to cut
>> them out of the history at some point.
>
>'-f' is about not having to clean out refs/original from a previous
>filter-branch run.
Okay, I misread your command line. For some reason I thought "-f" was an
option to add.
>> What *exactly* is the subtree merge. The documentation I've read
>> sounds like this case, sort of, but it's rather unclear to me.
>
>I think 'subtree' does what you want, but 'merge' doesn't!
*giggle* I'm not quite sure what makes this funny to me, but it made me
laugh.
>'subtree'
>saves you the rewriting (putting TI into project/web), but you want a
>one-time conversion anyway. 'subtree' allows you to repeatedly merge
>branches with a different root. What it does is it looks for subdir,
>'rewrites' the incoming tree automatically and merges the result.
>
>But you don't want a merge, do you? Or else your whole TI history would
>be tacked onto FT's head "to the left": a new (subtree) merge commit
>would have FT's and TI's head as parents. This is one way of storing TI
>history in the full repo, but not the one you said you wanted.
You are right; that's not what I want. But, it is a good second-place
result that I'll keep in mind. Sometimes keeping the history at all is
more important that keeping the history orderly.
Again, thanks for the help.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss03@volumehost.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.org/ \_/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ 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