* [FILE] GNU BIT
@ 2005-04-25 6:24 Andreas Gal
2005-04-25 15:37 ` Daniel Barkalow
2005-04-25 20:52 ` Petr Baudis
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Gal @ 2005-04-25 6:24 UTC (permalink / raw)
To: Git Mailing List
[-- Attachment #1: Type: TEXT/PLAIN, Size: 6002 bytes --]
BIT - a little bit like SCM
BIT is a training exercise in shell programming and is the result of
my attempts to wrap my head around GIT's inner working. BIT's
command line interface should be very familiar to anyone who worked
with other(tm) SCM tools before. I try to not depend on custom
GIT features. BIT uses the off-the-shelf GIT core tools distributed
by Linus. This means that BIT has about 2% of the features of
Cogito. Also, it has about 0.1% of the user base of Cogito, so its
probably very broken and I really don't recommend using it.
You can obtain BIT from the following GIT repository:
http://nil.ics.uci.edu/~gal/public/bit
You can use the GIT core utilities to pull and check-out BIT:
init-db
curl http://nil.ics.uci.edu/~gal/public/bit/HEAD > .git/HEAD
http-pull -a `cat .git/HEAD` \
http://nil.ics.uci.edu/~gal/public/bit
read-tree `cat .git/HEAD`
checkout-cache -f -a
Naturally, you can also use BIT to pull the current sources, which
is much simpler:
bit clone http://nil.ics.uci.edu/~gal/public/bit
This will create a directory "bit", pull the latest sources and perform
a check-out for you.
INSTALLATION
Put "bit" anywhere in your search path. Its only a single bash script. It
requires a link "bit-resolve" to itself and the (soft) link should reside
in the same directory as "bit" itself. "bit" acts as merge script when
invoked through that link.
At this point, BIT's functionality is minimal. It does what I need it for.
I will obviously add more commands as we go along, but I won't touch
things like tags and stuff like that until Linus' makes up his mind how to
do it *RIGHT*.
BASIC CONCEPTS
- BIT always checks out all files in your repository and it does so
automatically. In other words, there is no "bit co" command. Not
everyone will like this, but I do.
- You can't seek around in a repository. Checked-out files always
match the HEAD revision. You can diff files against older versions,
but if you want to check out an older version, you will have to
clone the repository (see below).
TRACKING SOMEONE ELSE'S TREE
$ bit clone http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
(Note: Don't forget the '/' at the end, otherwise http-pull won't work.)
This command pulls Linus' latest GIT tree to a local repository "git.git".
You can change the latter by giving clone an additional argument.
$ bit clone http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/ \
git-trunk
Once you have a copy of the remote repository, you can check whether there
are new changesets in the remote repository that you haven't seen yet:
$ bit changes -R \
http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
If you see any changes, you can merge them into your own tree:
$ bit pull http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
BRANCHING
Now lets assume you want to work on an extension to GIT. For this, we will
clone the repository:
$ bit clone git-trunk git-bit
This will create a copy of the git-trunk repository and name it "git-bit".
The object directory is shared (using a soft link), which has the nice
benefit that once you run "bit pull" on one of the repositories, the
other one will be able to merge changes without any network traffic
(except for reading the current HEAD).
Lets say we make some changes to sha1_file.c and want to commit it to
our local repository "git-bit":
... edit sha1_file.c ...
In case we already forgot what file we edited, "bit pending" will tells us:
$ bit pending
sha1_file.c
Just in case we still can remember what we changed, there is "bit diffs",
which shows a diff to the current HEAD or any other version of our
tree.
$ bit diffs
--- 28ad1598e54200ca8ee1261ed7beb4e31e20b2f1/sha1_file.c
+++ sha1_file.c
@@ -70,6 +70,7 @@
int i;
static char *name, *base;
+ /* added a cool new feature here */
if (!base) {
char *sha1_file_directory = getenv(DB_ENVIRONMENT) ? : ...
int len = strlen(sha1_file_directory);
To commit our changes, we use "bit commit". It will fire up "vi" to ask for
a commit message.
$ bit commit
... enter commit message in vi ...
MERGING
Lets assume Linus' put out a new version of GIT, so we want to update both of
our repositories. First lets do this for "git-trunk".
$ cd bit-trunk
$ bit pull http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
(Note: You have to specify the URL explicitly every time because there is no
consensus yet where to store this information. Once thats sorted out, this
will be automatic, of course.)
As this repository only tracks Linus' sources, there should be no conflicts.
Now lets go to our "git-bit" repository and do the same there:
$ cd git-bit
$ bit pull http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
Because both repositories share the object directory, you will get away
with minimal network traffic. Conflicts are resolved using RCS merge. If
that fails, you have to edit the offending files yourself.
PUSHING PATCHES UPSTREAM
Lets assume we want to send our improvements to Linus. For this, we can
ask changes to show us all local changes in our repository:
$ bit changes -L \
http://www.kernel.org/pub/linux/kernel/people/torvalds/git.git/
There is currently no mechanism in BIT to generate patches automatically,
but I will add one shortly. What is working already is that you can
push your repository to a remote location:
$ bit push ssh://gal@sam.ics.uci.edu/.nfs/public_html/public/git/
This will update the remote repository via SSH and set HEAD to point
to your latest version. Please note that you have to create a
repository at the remote location using "init-db".
HELP
Try "bit --help" to get some simple instructions how to use BIT. All
commands have builtin help as well. Try "bit commit --help". Not all
options are always implemented. Feel free to send me a patch.
[-- Attachment #2: Type: APPLICATION/x-gzip, Size: 5057 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [FILE] GNU BIT
2005-04-25 6:24 [FILE] GNU BIT Andreas Gal
@ 2005-04-25 15:37 ` Daniel Barkalow
2005-04-25 20:03 ` Andreas Gal
2005-04-25 20:52 ` Petr Baudis
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Barkalow @ 2005-04-25 15:37 UTC (permalink / raw)
To: Andreas Gal; +Cc: Git Mailing List
On Sun, 24 Apr 2005, Andreas Gal wrote:
> http-pull -a `cat .git/HEAD` \
> http://nil.ics.uci.edu/~gal/public/bit
Don't forget the slash at the end... (one of us should probably fix that
at some point; just stick a slash at the end of any URL without one)
Also, it has become customary to have URLs like .../public/bit.git/, since
the contents match a .git directory.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FILE] GNU BIT
2005-04-25 15:37 ` Daniel Barkalow
@ 2005-04-25 20:03 ` Andreas Gal
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Gal @ 2005-04-25 20:03 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Git Mailing List
I fixed this bug and another nasty one in "bit pull". The new version is
up in its usual place:
bit clone http://nil.ics.uci.edu/~gal/public/bit
(You can't use pull because it was broken in the previous version.)
Another unrelated note: to add files to your repository, do "bit commit
filename". To remove a file, delete it and then do "bit commit
deleted-filename" (yes, I will add "bit add" and "bit rm" at some point).
Andreas
On Mon, 25 Apr 2005, Daniel Barkalow wrote:
> On Sun, 24 Apr 2005, Andreas Gal wrote:
>
> > http-pull -a `cat .git/HEAD` \
> > http://nil.ics.uci.edu/~gal/public/bit
>
> Don't forget the slash at the end... (one of us should probably fix that
> at some point; just stick a slash at the end of any URL without one)
>
> Also, it has become customary to have URLs like .../public/bit.git/, since
> the contents match a .git directory.
>
> -Daniel
> *This .sig left intentionally blank*
>
> -
> 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 [flat|nested] 6+ messages in thread
* Re: [FILE] GNU BIT
2005-04-25 6:24 [FILE] GNU BIT Andreas Gal
2005-04-25 15:37 ` Daniel Barkalow
@ 2005-04-25 20:52 ` Petr Baudis
2005-04-25 21:33 ` Andreas Gal
1 sibling, 1 reply; 6+ messages in thread
From: Petr Baudis @ 2005-04-25 20:52 UTC (permalink / raw)
To: Andreas Gal; +Cc: Git Mailing List
Dear diary, on Mon, Apr 25, 2005 at 08:24:24AM CEST, I got a letter
where Andreas Gal <gal@uci.edu> told me that...
> HELP
>
> Try "bit --help" to get some simple instructions how to use BIT. All
> commands have builtin help as well. Try "bit commit --help". Not all
> options are always implemented. Feel free to send me a patch.
Do you intend to licence it as free software? Also, you call it "GNU
BIT". Does that mean it is part of the GNU project?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FILE] GNU BIT
2005-04-25 20:52 ` Petr Baudis
@ 2005-04-25 21:33 ` Andreas Gal
2005-04-25 21:46 ` Petr Baudis
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Gal @ 2005-04-25 21:33 UTC (permalink / raw)
To: Petr Baudis; +Cc: Git Mailing List
bit contains various pieces and snippets from Linus' and your scripts and
thus automatically falls under GPL. Maybe I should have stated that
somewhere explicitly, but its a 800 lines bash script for crying out loud.
The "GNU" part was actually more like a joke. If you feel offended by it,
I am happy to remove it. Are there any trademark issues involved in using
"GNU"?
Andreas
PS: Unrelated note. There is a GNU GIT project (some graphical file
manager thing or so).
On Mon, 25 Apr 2005, Petr Baudis wrote:
> Dear diary, on Mon, Apr 25, 2005 at 08:24:24AM CEST, I got a letter
> where Andreas Gal <gal@uci.edu> told me that...
> > HELP
> >
> > Try "bit --help" to get some simple instructions how to use BIT. All
> > commands have builtin help as well. Try "bit commit --help". Not all
> > options are always implemented. Feel free to send me a patch.
>
> Do you intend to licence it as free software? Also, you call it "GNU
> BIT". Does that mean it is part of the GNU project?
>
> --
> Petr "Pasky" Baudis
> Stuff: http://pasky.or.cz/
> C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FILE] GNU BIT
2005-04-25 21:33 ` Andreas Gal
@ 2005-04-25 21:46 ` Petr Baudis
0 siblings, 0 replies; 6+ messages in thread
From: Petr Baudis @ 2005-04-25 21:46 UTC (permalink / raw)
To: Andreas Gal; +Cc: Git Mailing List
Dear diary, on Mon, Apr 25, 2005 at 11:33:12PM CEST, I got a letter
where Andreas Gal <gal@uci.edu> told me that...
> bit contains various pieces and snippets from Linus' and your scripts and
> thus automatically falls under GPL. Maybe I should have stated that
> somewhere explicitly, but its a 800 lines bash script for crying out loud.
I skimmed over it briefly and admitelly didn't find anything
*obviously* borrowed from my scripts, so I wanted to ask. It is worth
noting explicitly, I think.
> The "GNU" part was actually more like a joke. If you feel offended by it,
> I am happy to remove it. Are there any trademark issues involved in using
> "GNU"?
I was not offended, just confused. :-) I think it's better not to use
"GNU" in the name if it's not part of the GNU project.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-25 21:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-25 6:24 [FILE] GNU BIT Andreas Gal
2005-04-25 15:37 ` Daniel Barkalow
2005-04-25 20:03 ` Andreas Gal
2005-04-25 20:52 ` Petr Baudis
2005-04-25 21:33 ` Andreas Gal
2005-04-25 21:46 ` Petr Baudis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox