* Re: [PATCH/RFC 2/2] Make path-limiting be incremental when possible.
From: Junio C Hamano @ 2006-04-02 3:11 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0604011628500.3684@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> What ends up not working very well at all is the combination of
> "--topo-order" and the output filter in get_revision. It will return NULL
> when we see the first commit out of date-order, even if we have other
> commits coming.
>
> So we really should do the "past the date order" thing in get_revision()
> only if we have _not_ done it already in limit_list().
Right now --max-age causes "limited" so there should not be a
difference, if I am not mistaken. But I've been meaning to
change that, so the patch makes sense. Similarly,...
-- >8 --
[PATCH] revision: --topo-order and --unpacked
Now, using --unpacked without limit_list() does not make much
sense, but this is parallel to the earlier --max-age fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
revision.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
22c31bf183bff576c7807f9d67abfc11ee8e1fa4
diff --git a/revision.c b/revision.c
index 558ed01..07cc86f 100644
--- a/revision.c
+++ b/revision.c
@@ -787,7 +787,10 @@ struct commit *get_revision(struct rev_i
* that we'd otherwise have done in limit_list().
*/
if (!revs->limited) {
- if (revs->max_age != -1 && (commit->date < revs->max_age))
+ if ((revs->unpacked &&
+ has_sha1_pack(commit->object.sha1)) ||
+ (revs->max_age != -1 &&
+ (commit->date < revs->max_age)))
continue;
add_parents_to_list(revs, commit, &revs->commits);
}
--
1.3.0.rc1.gf385
^ permalink raw reply related
* [PATCH] contrib/git-svn: accept configuration via repo-config
From: Eric Wong @ 2006-04-02 2:25 UTC (permalink / raw)
To: junkio, git; +Cc: Eric Wong
repo-config keys are any of the long option names minus the '-'
characters
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
contrib/git-svn/git-svn.perl | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
2eb11880066977d65ed7e51b04c2bfa97d217752
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 59dd504..edfb19c 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -67,6 +67,23 @@ for (my $i = 0; $i < @ARGV; $i++) {
my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
+# convert GetOpt::Long specs for use by git-repo-config
+foreach my $o (keys %opts) {
+ my $v = $opts{$o};
+ my ($key) = ($o =~ /^([a-z\-]+)/);
+ $key =~ s/-//g;
+ my $arg = 'git-repo-config';
+ $arg .= ' --int' if ($o =~ /=i$/);
+ $arg .= ' --bool' if ($o !~ /=[sfi]$/);
+ $arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe
+ if (ref $v eq 'ARRAY') {
+ chomp(@$v = `$arg`);
+ } else {
+ chomp($$v = `$arg`);
+ $$v = 0 if $$v eq 'false';
+ }
+}
+
GetOptions(%opts, 'help|H|h' => \$_help,
'version|V' => \$_version,
'id|i=s' => \$GIT_SVN) or exit 1;
--
1.3.0.rc1.g709a5
^ permalink raw reply related
* [PATCH] contrib/git-svn: documentation updates
From: Eric Wong @ 2006-04-02 2:25 UTC (permalink / raw)
To: junkio, git; +Cc: Eric Wong
In-Reply-To: <11439447031422-git-send-email-normalperson@yhbt.net>
contrib/git-svn/git-svn.txt:
added git-repo-config key names for options
fixed quoting of "git-svn-HEAD" in the manpage
use preformatted text for examples
contrib/git-svn/Makefile:
add target to generate HTML:
http://git-svn.yhbt.net/git-svn.html
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
contrib/git-svn/Makefile | 3 +++
contrib/git-svn/git-svn.txt | 41 ++++++++++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 13 deletions(-)
f8198e0b9da68024f7194067eb120bbf256a6111
diff --git a/contrib/git-svn/Makefile b/contrib/git-svn/Makefile
index a330c61..d7f1643 100644
--- a/contrib/git-svn/Makefile
+++ b/contrib/git-svn/Makefile
@@ -25,6 +25,9 @@ git-svn.1 : git-svn.xml
git-svn.xml : git-svn.txt
asciidoc -b docbook -d manpage \
-f ../../Documentation/asciidoc.conf $<
+git-svn.html : git-svn.txt
+ asciidoc -b xhtml11 -d manpage \
+ -f ../../Documentation/asciidoc.conf $<
test:
cd t && $(SHELL) ./t0000-contrib-git-svn.sh
diff --git a/contrib/git-svn/git-svn.txt b/contrib/git-svn/git-svn.txt
index 7a6e0c4..e18fcaf 100644
--- a/contrib/git-svn/git-svn.txt
+++ b/contrib/git-svn/git-svn.txt
@@ -101,6 +101,8 @@ OPTIONS
cannot version empty directories. Enabling this flag will make
the commit to SVN act like git.
+ repo-config key: svn.rmdir
+
-e::
--edit::
Only used with the 'commit' command.
@@ -108,6 +110,8 @@ OPTIONS
Edit the commit message before committing to SVN. This is off by
default for objects that are commits, and forced on when committing
tree objects.
+
+ repo-config key: svn.edit
-l<num>::
--find-copies-harder::
@@ -115,6 +119,9 @@ OPTIONS
They are both passed directly to git-diff-tree see
git-diff-tree(1) for more information.
+
+ repo-config key: svn.l
+ repo-config key: svn.findcopiesharder
ADVANCED OPTIONS
----------------
@@ -133,6 +140,8 @@ ADVANCED OPTIONS
This option may be specified multiple times, once for each
branch.
+ repo-config key: svn.branch
+
-i<GIT_SVN_ID>::
--id <GIT_SVN_ID>::
This sets GIT_SVN_ID (instead of using the environment). See
@@ -145,7 +154,7 @@ COMPATIBILITY OPTIONS
Only used with the 'rebuild' command.
Run this if you used an old version of git-svn that used
- 'git-svn-HEAD' instead of 'remotes/git-svn' as the branch
+ "git-svn-HEAD" instead of "remotes/git-svn" as the branch
for tracking the remote.
--no-ignore-externals::
@@ -161,26 +170,30 @@ COMPATIBILITY OPTIONS
Otherwise, do not enable this flag unless you know what you're
doing.
+
+ repo-config key: svn.noignoreexternals
Basic Examples
~~~~~~~~~~~~~~
Tracking and contributing to an Subversion managed-project:
-# Initialize a tree (like git init-db)::
+------------------------------------------------------------------------
+# Initialize a tree (like git init-db):
git-svn init http://svn.foo.org/project/trunk
-# Fetch remote revisions::
+# Fetch remote revisions:
git-svn fetch
-# Create your own branch to hack on::
+# Create your own branch to hack on:
git checkout -b my-branch remotes/git-svn
-# Commit only the git commits you want to SVN::
+# Commit only the git commits you want to SVN:
git-svn commit <tree-ish> [<tree-ish_2> ...]
-# Commit all the git commits from my-branch that don't exist in SVN::
+# Commit all the git commits from my-branch that don't exist in SVN:
git-svn commit remotes/git-svn..my-branch
-# Something is committed to SVN, pull the latest into your branch::
+# Something is committed to SVN, pull the latest into your branch:
git-svn fetch && git pull . remotes/git-svn
-# Append svn:ignore settings to the default git exclude file::
+# Append svn:ignore settings to the default git exclude file:
git-svn show-ignore >> .git/info/exclude
+------------------------------------------------------------------------
DESIGN PHILOSOPHY
-----------------
@@ -219,7 +232,7 @@ git commits with the following syntax:
This allows you to tie unfetched SVN revision 375 to your current HEAD::
- git-svn fetch 375=$(git-rev-parse HEAD)
+ `git-svn fetch 375=$(git-rev-parse HEAD)`
Advanced Example: Tracking a Reorganized Repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,22 +245,24 @@ This is how Yann Dirson tracked the trun
the /trunk directory of his repository was moved to /ufoai/trunk and
he needed to continue tracking /ufoai/trunk where /trunk left off.
- # This log message shows when the repository was reorganized::
+------------------------------------------------------------------------
+ # This log message shows when the repository was reorganized:
r166 | ydirson | 2006-03-02 01:36:55 +0100 (Thu, 02 Mar 2006) | 1 line
Changed paths:
D /trunk
A /ufoai/trunk (from /trunk:165)
- # First we start tracking the old revisions::
+ # First we start tracking the old revisions:
GIT_SVN_ID=git-oldsvn git-svn init \
- https://svn.sourceforge.net/svnroot/ufoai/trunk
+ https://svn.sourceforge.net/svnroot/ufoai/trunk
GIT_SVN_ID=git-oldsvn git-svn fetch -r1:165
- # And now, we continue tracking the new revisions::
+ # And now, we continue tracking the new revisions:
GIT_SVN_ID=git-newsvn git-svn init \
https://svn.sourceforge.net/svnroot/ufoai/ufoai/trunk
GIT_SVN_ID=git-newsvn git-svn fetch \
166=`git-rev-parse refs/remotes/git-oldsvn`
+------------------------------------------------------------------------
BUGS
----
--
1.3.0.rc1.g709a5
^ permalink raw reply related
* Re: [PATCH/RFC 2/2] Make path-limiting be incremental when possible.
From: Linus Torvalds @ 2006-04-02 0:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vr74jw0zj.fsf@assigned-by-dhcp.cox.net>
On Thu, 30 Mar 2006, Junio C Hamano wrote:
>
> OK, so let's say I agree with you that --unpacked and --since
> are "stop early" rules. I fully agree with that from usability
> and implementation point of view, but I now wonder if the
> "output filter" in get_revision() and "stop early" in limit_list()
> would do the same thing.
They don't.
What ends up not working very well at all is the combination of
"--topo-order" and the output filter in get_revision. It will return NULL
when we see the first commit out of date-order, even if we have other
commits coming.
So we really should do the "past the date order" thing in get_revision()
only if we have _not_ done it already in limit_list().
Something like this.
The easiest way to test this is with just
gitk --since=3.days.ago
on the kernel tree. Without this patch, it tends to be pretty obviously
broken.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus
---
diff --git a/revision.c b/revision.c
index a8a54b6..558ed01 100644
--- a/revision.c
+++ b/revision.c
@@ -783,10 +783,14 @@ struct commit *get_revision(struct rev_i
/*
* If we haven't done the list limiting, we need to look at
- * the parents here
+ * the parents here. We also need to do the date-based limiting
+ * that we'd otherwise have done in limit_list().
*/
- if (!revs->limited)
+ if (!revs->limited) {
+ if (revs->max_age != -1 && (commit->date < revs->max_age))
+ continue;
add_parents_to_list(revs, commit, &revs->commits);
+ }
if (commit->object.flags & SHOWN)
continue;
if (!(commit->object.flags & BOUNDARY) &&
@@ -794,8 +798,6 @@ struct commit *get_revision(struct rev_i
continue;
if (revs->min_age != -1 && (commit->date > revs->min_age))
continue;
- if (revs->max_age != -1 && (commit->date < revs->max_age))
- return NULL;
if (revs->no_merges &&
commit->parents && commit->parents->next)
continue;
^ permalink raw reply related
* [Patch] Key help for gitk
From: Paul Schulz @ 2006-04-02 0:21 UTC (permalink / raw)
To: paulus; +Cc: git
In-Reply-To: <cc9bf44d0604011616w18b9a7c3nc55a393f30a2b55a@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
Greetings,
gitk has a few more key options than I was aware (font
increase/decrease for example). The following patch adds some details
to the 'About' dialog.
(These need to be reviewed for sanity, as I can't work out how the
search keys are ment to work.)
Paul Schulz
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-gitk-20060402.diff --]
[-- Type: text/x-patch; name=patch-gitk-20060402.diff; charset=ANSI_X3.4-1968, Size: 1121 bytes --]
diff --git a/gitk b/gitk
index fa1e83c..85d70d9 100755
--- a/gitk
+++ b/gitk
@@ -722,7 +722,41 @@ Gitk - a commit viewer for git
Copyright © 2005-2006 Paul Mackerras
-Use and redistribute under the terms of the GNU General Public License} \
+Use and redistribute under the terms of the GNU General Public License
+
+Keys
+----
+<Down> - Move down a line
+<Up> - Move up a line
+<Right> -
+<Left> -
+<Delete> -
+<BackSpace> -
+<Space> - Scroll Diff
+p - Previous commit
+n - Next commit
+z - Go back (?)
+x - Go forward (?)
+i - Previuos line
+k - Next line
+j - Go back
+l - Go forward
+b - ?
+d - ?
+u - ?
+/ - Next find result (?)
+<Return> - Find result
+? - Previous find result
+f - Next file
+<Ctl-q> - Quit
+<Ctl-f> - Find
+<Ctl-g> - Find next
+<Ctl-r> - Find previous
+<Ctl-equal> - Incrument font size
+<Ctl-KP_Add> - Incrument font size
+<Ctl-minus> - Decrement font size
+<Ctl-KP_Subtract> - Decrement font size
+} \
-justify center -aspect 400
pack $w.m -side top -fill x -padx 20 -pady 20
button $w.ok -text Close -command "destroy $w"
^ permalink raw reply related
* Re: Moving a file back to an earlier revision.
From: Petr Baudis @ 2006-04-01 23:01 UTC (permalink / raw)
To: David Ho; +Cc: git
In-Reply-To: <4dd15d180603311332p60fa1867nc303bd92d515b4e0@mail.gmail.com>
Dear diary, on Fri, Mar 31, 2006 at 11:32:16PM CEST, I got a letter
where David Ho <davidkwho@gmail.com> said that...
> Sorry I might already have found it.
>
> File revisions
>
> +----+----+
> 1 2 3
>
> git diff commit(3)..commit(1) filename | git-apply
Note that it might be more convenient to just say "restore the file to
the contents as of commit X" - in pure Git this would involve dances
with git-ls-tree and git-cat-file, I'm not sure if the core Git
porcelain has an interface for doing this easily.
In Cogito, you can just do:
cg-restore -f -r commitid filename
--
Petr "Pasky on a dialup" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time. I think
I have forgotten this before.
^ permalink raw reply
* Re: Default remote branch for local branch
From: Jakub Narebski @ 2006-04-01 19:57 UTC (permalink / raw)
To: git
In-Reply-To: <e0l3l0$v4e$1@sea.gmane.org>
> You might want to read "Efficient cloning" thread where
> --use-separate-remote and --reference options were introduced:
> http://marc.theaimsgroup.com/?l=git&m=114280442802681&w=2
> http://www.gelato.unsw.edu.au/archives/git/0603/18113.html
> http://thread.gmane.org/gmane.comp.version-control.git/17724
> and which had discussion on similar subjects (somewhere).
See also
Message-ID: <200603011814.43573.Josef.Weidendorfer@gmx.de>
--
Jakub Narebski
Warsaw, Poland
^ permalink raw reply
* Re: Moving to BK
From: Jakub Narebski @ 2006-04-01 7:13 UTC (permalink / raw)
To: git; +Cc: linux-kernel
In-Reply-To: <Pine.LNX.4.64.0603312030060.27203@g5.osdl.org>
Linus Torvalds wrote:
> On Fri, 31 Mar 2006, David S. Miller wrote:
>>
>> April 1st is upon us again.
>
> I really like the new slashdot look. "OMG!!! Ponies!!!"
>
> I hope they keep it after Apr 1st.
Apr 1st begins at Mar 31st (some of Fool's Day articles on slashdot are from
Mar 31st localtime), and for some it would continue at lest to Apr 2nd ;-)
--
Jakub Narebski
Warsaw, Poland
^ permalink raw reply
* Re: Moving to BK
From: Randy.Dunlap @ 2006-04-01 6:42 UTC (permalink / raw)
To: Linus Torvalds; +Cc: davem, pasky, junio, linux-kernel, git
In-Reply-To: <Pine.LNX.4.64.0603312030060.27203@g5.osdl.org>
On Fri, 31 Mar 2006 20:30:40 -0800 (PST) Linus Torvalds wrote:
>
>
> On Fri, 31 Mar 2006, David S. Miller wrote:
> >
> > April 1st is upon us again.
>
> I really like the new slashdot look. "OMG!!! Ponies!!!"
Goes with the sandals and pony tails.
> I hope they keep it after Apr 1st.
---
~Randy
^ permalink raw reply
* Re: Default remote branch for local branch
From: Jakub Narebski @ 2006-04-01 5:38 UTC (permalink / raw)
To: git
In-Reply-To: <1143856098.3555.48.camel@dv>
Pavel Roskin wrote:
> I'm sorry, reading this mailing list is beyond my capabilities, so
> certain overlaps with other postings may be expected, unless I'm
> suggesting something totally off-base :-)
You might want to read "Efficient cloning" thread where
--use-separate-remote and --reference options were introduced:
http://marc.theaimsgroup.com/?l=git&m=114280442802681&w=2
http://www.gelato.unsw.edu.au/archives/git/0603/18113.html
http://thread.gmane.org/gmane.comp.version-control.git/17724
and which had discussion on similar subjects (somewhere).
--
Jakub Narebski
Warsaw, Poland
^ permalink raw reply
* Re: Moving to BK
From: Linus Torvalds @ 2006-04-01 4:30 UTC (permalink / raw)
To: David S. Miller; +Cc: pasky, junio, linux-kernel, git
In-Reply-To: <20060331.191416.108058500.davem@davemloft.net>
On Fri, 31 Mar 2006, David S. Miller wrote:
>
> April 1st is upon us again.
I really like the new slashdot look. "OMG!!! Ponies!!!"
I hope they keep it after Apr 1st.
Linus
^ permalink raw reply
* Re: Default remote branch for local branch
From: Pavel Roskin @ 2006-04-01 4:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vodzmngfp.fsf@assigned-by-dhcp.cox.net>
Hello, Junio!
On Fri, 2006-03-31 at 19:05 -0800, Junio C Hamano wrote:
> - Multiple subsystem maintainer trees tracked in the same local
> repository. Most generally, two local branches per each
> remote head can be used (one tracking branch to fetch into,
> another to build your changes based on it). Alternatively,
> you can use one local branch per each remote head without
> using any tracking branch.
>
> Your proposal to give default branch to pull from per the local
> branch would help only the last case.
Exactly. I tried to track the main Linus repository and Jeff Garzik's
netdev in one place. Then I discovered that my repository if full of
unintended merges made by "stg pull".
> The first one you do not
> switch between local branches at all and pull from many
> different places; the second is to merge from different topic
> branches from time to time and does not benefit from fixed
> configuration; the third does not even need configuration.
>
> Maybe you would want something like this.
>
> In $GIT_DIR/config:
>
> [pull]
> origin = linus for master
> origin = irq-pio of libata for ata-irq-pio
> origin = pata-drivers of libata for ata-pata
First of all, using "origin" on every line carries to little
information.
Secondly, I think the relationship should be between a local development
branch and a local tracking branch. After all, all remote data is
placed on a local tracking branch first. It's better not to jump over
layers of abstraction. Suppose I want to update "masterB". I tell git
to sync "originB" first. git already has rules what to do if it should
sync "originB". Let's not supersede those rules.
I would write the config like this:
[branch-upstream]
master = linus
ata-irq-pio = irq-pio
ata-pata = pata-drivers
> While we are on the topic, it _might_ be worthwhile to think
> about revamping the syntax of $GIT_DIR/remotes file, maybe even
> breaking backward compatibility. The Pull: lines can be
> independently specified which gives flexibility, but I suspect
> local tracking branches from the same remote tend to live in the
> same place; IOW, you would probably not do something like:
>
> URL: git://git.kernel.org/.../jgarzik/libata-dev.git
> Pull: refs/heads/irq-pio:refs/remotes/libata/irq-pio
> Pull: refs/heads/pata-drivers:refs/heads/pata-drivers
>
> in practice.
Sorry, I don't understand this part.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: Moving to BK
From: Alexander Litvinov @ 2006-04-01 3:17 UTC (permalink / raw)
To: David S. Miller; +Cc: pasky, junio, linux-kernel, git
In-Reply-To: <20060331.191416.108058500.davem@davemloft.net>
> April 1st is upon us again.
Damn, I have forgot about this. Good joke !
^ permalink raw reply
* Re: Moving to BK
From: David S. Miller @ 2006-04-01 3:14 UTC (permalink / raw)
To: pasky, junio; +Cc: linux-kernel, git
In-Reply-To: <200604010311.k313BYeS026266@hera.kernel.org>
April 1st is upon us again.
^ permalink raw reply
* Moving to BK
From: Petr Baudis, Junio C Hamano @ 2006-04-01 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: git
We are pleased to announce that both of us will be working for
BitMover Inc., starting this month.
Petr, the author of the popular Cogito front-end for git, will
be modifying Cogito so that it natively works on BK
repositories. The superior Cogito user interface will
extensively increase added business value of BK by enabling a
variety of innovative workflows for smooth and economical
developer cooperation.
Junio, the current maintainer of git "stupid content tracker",
will first be working on a gateway to import development
histories stored in git into BK. This move adds value to BK by
freeing the data so far locked in git repositories and making
them available to the BK users. He may later work on
reimplementing some parts of the git for BK, but it is expected
that there aren't that many. For example, the "rename
detection" part is not necessary -- BK natively supports rename
tracking, which is a far superiour approach.
There currently is no plan for either of us to be working on the
conversion from BK to git. There is no technical reason to do
so, and it does not make business sense for BitMover Inc.
either.
- 30 -
^ permalink raw reply
* Re: Default remote branch for local branch
From: Junio C Hamano @ 2006-04-01 3:05 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1143856098.3555.48.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
> This is not a ready-to-use proposal, but I think my message can prompt
> useful changes in GIT or in the "porcelain".
>...
> I think it would be convenient to have git remember the remote branch
> for the given local branch. git should know that if HEAD points to
> "local-B", "git-fetch" should fetch from "remote-B", not from "origin".
I am in favor of the general direction this is going. Something
like this was mentioned on the list in the past twice (I think
Johannes was involved in the discussion but I do not remember
the details offhand).
My understanding is that Cogito uses $GIT_DIR/branches/$name
file as a configuration file per branch - currently it only
records which remote repository's what remote branch the local
branch $name interfaces with.
The $GIT_DIR/remotes/$name file is to describe each remote
repository, and it _wants_ to be able to describe all the
branches we are interested in, primarily because uploading and
downloading multiple, related heads at once is more efficient.
How remote branches are kept track of with the local tracking
branch, and how remote branches are updated from the local
branch heads, are described by Push/Pull lines there.
As you pointed out, we do not have a convenient way to tell git
where you typically merge things from per local branch. There
are different patterns I've seen:
- Promiscous. For example, "master" branch of Linus repository
pulls from many subsystem maintainers. Linus could have one
"remotes" file per subsystem maintainer he often pulls from
(and "for-linus" branch name in each remote repository tends
to stay the same), and unlike the rest of us he does not seem
to pull into many local branches. The current "remotes"
setup is really optimized for this mode of usage (you can use
"remotes" without having local tracking branches).
- Merging topic branches into "master" (or "release") branch
and "next" (or "testing") branch -- inside local repository.
- CVS-like remote tracking. A single "primary" remote branch
is tracked using local "origin", merged into local "master"
and pushed back to the remote. Both Cogito-like branches/
setup and having a single $GIT_DIR/remotes/origin file with
single Push/Pull line would work equally well.
- Multiple subsystem maintainer trees tracked in the same local
repository. Most generally, two local branches per each
remote head can be used (one tracking branch to fetch into,
another to build your changes based on it). Alternatively,
you can use one local branch per each remote head without
using any tracking branch.
Your proposal to give default branch to pull from per the local
branch would help only the last case. The first one you do not
switch between local branches at all and pull from many
different places; the second is to merge from different topic
branches from time to time and does not benefit from fixed
configuration; the third does not even need configuration.
Maybe you would want something like this.
In $GIT_DIR/config:
[pull]
origin = linus for master
origin = irq-pio of libata for ata-irq-pio
origin = pata-drivers of libata for ata-pata
In $GIT_DIR/remotes/linus:
URL: git://git.kernel.org/.../torvalds/linux-2.6.git
Pull: refs/heads/master:refs/heads/linus
In $GIT_DIR/remotes/libata
URL: git://git.kernel.org/.../jgarzik/libata-dev.git
Pull: refs/heads/irq-pio:refs/remotes/libata/irq-pio
Pull: refs/heads/pata-drivers:refs/remotes/libata/pata-drivers
This is to maintain three local branches: master, ata-irq-pio
and ata-pata.
You are obviously interested in the mainline Linus kernel, so
while you are on your "master" branch, we will look for
"pull.origin .* for master" and find out you would want
remotes/linus file to be used. His "master" is copied to your
local "linus" branch, and merged into your "master" branch.
$ git pull
becomes equivalent to:
$ git pull linus
You are also interested in the libata work by Jeff, and while
you are on your ata-pata branch
$ git pull
becomes roughly equivalent to:
$ git pull libata pata-drivers
While we are on the topic, it _might_ be worthwhile to think
about revamping the syntax of $GIT_DIR/remotes file, maybe even
breaking backward compatibility. The Pull: lines can be
independently specified which gives flexibility, but I suspect
local tracking branches from the same remote tend to live in the
same place; IOW, you would probably not do something like:
URL: git://git.kernel.org/.../jgarzik/libata-dev.git
Pull: refs/heads/irq-pio:refs/remotes/libata/irq-pio
Pull: refs/heads/pata-drivers:refs/heads/pata-drivers
in practice.
^ permalink raw reply
* Default remote branch for local branch
From: Pavel Roskin @ 2006-04-01 1:48 UTC (permalink / raw)
To: git
Hello!
This is not a ready-to-use proposal, but I think my message can prompt
useful changes in GIT or in the "porcelain".
Let's see how remote changes end up in the head branch of the local
repository (sorry for possible mistakes in terminology):
branch in "remote" local index,
a remote -------> branch -------> branch ------> tree
repository (e.g. origin) (e.g. master)
Brought in sync by:
fetch merge checkout
Relationship stored in:
.git/remotes nowhere!!! .git/HEAD
If I fetch a remote branch, git knows where to get changes. If I change
the current branch, git remembers that. But git doesn't remember the
relationship between branches mirroring the remote branches and branches
used for local development.
There are situations when I want to work for a significant time on a
certain branch. Significant time means that changes are made by
others, and I'm supposed to integrate them and make more changes. Yet I
may want to take advantage of some patches from another team that uses
the other repository.
I want GIT and porcelains work the same way if I'm working with
repository 1 or repository 2. As it stands now, git gives preferential
treatment to the "origin" branch. Whatever branch I'm on, "git-pull"
will pull from "origin". I believe the special role of the "origin"
branch should be reduced to cg-clone and similar commands.
I think it would be convenient to have git remember the remote branch
for the given local branch. git should know that if HEAD points to
"local-B", "git-fetch" should fetch from "remote-B", not from "origin".
To implement this, git would have to implement attributes for local
branches (other ideas are welcome). Currently, there are no attributes
for local branches other than the top SHA1 in .git/refs/heads/
Once at the topic of branch attributes, let's see what else could be
useful? I think that would be the creator of the branch and the comment
(e.g. "this is for tested commits only, to be merged tomorrow" etc).
Where can this data be stored? Probably in blobs pointed to by refs in
e.g. .git/refs/branch-data/ or just in plain files e.g.
under .git/branch-data/
I know, it sounds like a lot of work to save a few keystrokes. But I
think it may be worth it. Working on different branches should have the
same "look and feel". Otherwise, git would repeat a design error of
CVS, where the head branch was given preference e.g. for date based
updates.
I'm sorry, reading this mailing list is beyond my capabilities, so
certain overlaps with other postings may be expected, unless I'm
suggesting something totally off-base :-)
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: Moving a file back to an earlier revision.
From: David Ho @ 2006-03-31 22:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vacb6thc7.fsf@assigned-by-dhcp.cox.net>
> Remember, a branch in git is very cheap, and is a powerful way
> to keep track of things while you decide which alternate
> universe to take. And even after you decide, you could always
> look at and even build on the other universe.
I feel embarrassed to say this but in my branch there are commits to
the driver and other commits for the board so it looks more like
---0---D1---B1---B2---D2---B3---B4---
D* - driver changes
B* - board changes
So to go back to the 0 state I lose my board changes. But I hope what
I did (in my reply to Linus) is very close to your idea of having
separate branches.
David
^ permalink raw reply
* Re: Moving a file back to an earlier revision.
From: David Ho @ 2006-03-31 22:03 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0603311324040.27203@g5.osdl.org>
On 3/31/06, Linus Torvalds <torvalds@osdl.org> wrote:
> Don't revert.
>
> Just pick the point you want to start testing his patch at (with gitk, for
> example, just cut-and-paste the sha1), and do
>
> git checkout -b test-better-fix <sha1>
>
> which creates a new branch ("test-better-fix") that starts at that point,
> and checks it out.
I forget to mention I have also in my branch changes necessary to run
on my board. So what I did was
git-branch test-better-fix my-branch
git-checkout test-better-fix
git-diff commit(my-fixes)..commit(original) filename | git-apply
git-commit
>
> Then, just apply the patch, and off you go. You now have _both_ his patch
> and your own series in separate branches, so you can cherry-pick and do
> other things (like do a "diff" between branches - which can sometimes be
> useful too to verify that the two branches end up fixing all the same
> problems).
>
Yes, good point.
Thanks, David
^ permalink raw reply
* Re: Moving a file back to an earlier revision.
From: Junio C Hamano @ 2006-03-31 21:49 UTC (permalink / raw)
To: David Ho; +Cc: git
In-Reply-To: <4dd15d180603311332p60fa1867nc303bd92d515b4e0@mail.gmail.com>
"David Ho" <davidkwho@gmail.com> writes:
>> I am working on a board port on a separate branch. The branch has
>> accumulated several revision of changes to a driver I worked on. Now,
>> someone has come along with a better fix so I want to help test his
>> patch. To do that I have to revert my changes to that driver (several
>> revisions back) before I can apply his patch.
>>
>> What would be a convenient way to do that with git?
>
> Sorry I might already have found it.
>
> File revisions
>
> +----+----+
> 1 2 3
>
> git diff commit(3)..commit(1) filename | git-apply
[please do not top-post].
That lets you go back to the state before 1, so what you are
doing is to start from here:
---0---1---2---3
and
---0---1---2---3---*
where * has the same tree as 0, and then on top of that you
apply his patch:
---0---1---2---3---X
But what if you find a room for further improvements in his
patch? You could commit X (which is revert of 321 *and* his
patch) and then build on top of it, like this:
---0---1---2---3---X---Y
and feed him "diff X..Y" back.
However.
What Linus said is more natural in git. Starting from the same
picture, you do this:
X (side branch to test his patch on)
/
---0---1---2---3 (your original branch)
You apply his patch to a new branch. You could even make
further improvements like this:
X---Y
/
---0---1---2---3
And if you decide Y is better than your version 3 after all, you
can switch to his branch and then pick up anything important
from your development track between 0..3 on top of Y by
cherry-picking, and you can even later discard your original
development track. On the other hand, if you end up deciding 3
is better than Y after all, you can just discard the whole side
branch.
Remember, a branch in git is very cheap, and is a powerful way
to keep track of things while you decide which alternate
universe to take. And even after you decide, you could always
look at and even build on the other universe.
^ permalink raw reply
* Re: Moving a file back to an earlier revision.
From: David Ho @ 2006-03-31 21:32 UTC (permalink / raw)
To: git
In-Reply-To: <4dd15d180603311313t7781f2ebk616276e9134f6472@mail.gmail.com>
Sorry I might already have found it.
File revisions
+----+----+
1 2 3
git diff commit(3)..commit(1) filename | git-apply
David
On 3/31/06, David Ho <davidkwho@gmail.com> wrote:
> Hi,
>
> Another user question. Other may actually have similar needs.
>
> I am working on a board port on a separate branch. The branch has
> accumulated several revision of changes to a driver I worked on. Now,
> someone has come along with a better fix so I want to help test his
> patch. To do that I have to revert my changes to that driver (several
> revisions back) before I can apply his patch.
>
> What would be a convenient way to do that with git?
>
> TIA, David
>
^ permalink raw reply
* Re: Moving a file back to an earlier revision.
From: Linus Torvalds @ 2006-03-31 21:26 UTC (permalink / raw)
To: David Ho; +Cc: git
In-Reply-To: <4dd15d180603311313t7781f2ebk616276e9134f6472@mail.gmail.com>
On Fri, 31 Mar 2006, David Ho wrote:
>
> I am working on a board port on a separate branch. The branch has
> accumulated several revision of changes to a driver I worked on. Now,
> someone has come along with a better fix so I want to help test his
> patch. To do that I have to revert my changes to that driver (several
> revisions back) before I can apply his patch.
>
> What would be a convenient way to do that with git?
Don't revert.
Just pick the point you want to start testing his patch at (with gitk, for
example, just cut-and-paste the sha1), and do
git checkout -b test-better-fix <sha1>
which creates a new branch ("test-better-fix") that starts at that point,
and checks it out.
Then, just apply the patch, and off you go. You now have _both_ his patch
and your own series in separate branches, so you can cherry-pick and do
other things (like do a "diff" between branches - which can sometimes be
useful too to verify that the two branches end up fixing all the same
problems).
Linus
^ permalink raw reply
* Moving a file back to an earlier revision.
From: David Ho @ 2006-03-31 21:13 UTC (permalink / raw)
To: git
Hi,
Another user question. Other may actually have similar needs.
I am working on a board port on a separate branch. The branch has
accumulated several revision of changes to a driver I worked on. Now,
someone has come along with a better fix so I want to help test his
patch. To do that I have to revert my changes to that driver (several
revisions back) before I can apply his patch.
What would be a convenient way to do that with git?
TIA, David
^ permalink raw reply
* Re: [PATCH/RFC 2/2] Make path-limiting be incremental when possible.
From: Linus Torvalds @ 2006-03-31 20:50 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vfykyuzc2.fsf@assigned-by-dhcp.cox.net>
On Fri, 31 Mar 2006, Junio C Hamano wrote:
>
> Yes, that is exactly the fix I have in "pu" -- I suspect you
> replied before getting to my response last night.
No, I just get too much email, and hadn't read your response carefully
enough, so I just missed the fact that you had already found the problem.
Linus
^ permalink raw reply
* Re: [PATCH/RFC 2/2] Make path-limiting be incremental when possible.
From: Junio C Hamano @ 2006-03-31 20:35 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0603311135290.27203@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> The fix is trivial - with the new get_revision() organization, the
> BOUNDARY case special-case actually goes away entirely, and this trivial
> patch (on top of my 2/2 patch) should just fix it.
Yes, that is exactly the fix I have in "pu" -- I suspect you
replied before getting to my response last night.
^ 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