Skip to content

Commit

Permalink
Merge part of np/delta
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed Feb 22, 2006
2 parents 77e56ac + 8e1454b commit 882e4dc
Show file tree
Hide file tree
Showing 16 changed files with 322 additions and 264 deletions.
7 changes: 6 additions & 1 deletion Documentation/git-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git-add - Add files to the index file.

SYNOPSIS
--------
'git-add' [-n] [-v] <file>...
'git-add' [-n] [-v] [--] <file>...

DESCRIPTION
-----------
Expand All @@ -26,6 +26,11 @@ OPTIONS
-v::
Be verbose.

--::
This option can be used to separate command-line options from
the list of files, (useful when filenames might be mistaken
for command-line options).


DISCUSSION
----------
Expand Down
5 changes: 5 additions & 0 deletions Documentation/git-ls-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SYNOPSIS
[-x <pattern>|--exclude=<pattern>]
[-X <file>|--exclude-from=<file>]
[--exclude-per-directory=<file>]
[--error-unmatch]
[--full-name] [--] [<file>]\*

DESCRIPTION
Expand Down Expand Up @@ -73,6 +74,10 @@ OPTIONS
read additional exclude patterns that apply only to the
directory and its subdirectories in <file>.

--error-unmatch::
If any <file> does not appear in the index, treat this as an
error (return 1).

-t::
Identify the file status with the following tags (followed by
a space) at the start of each line:
Expand Down
6 changes: 6 additions & 0 deletions Documentation/git-push.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ to fast forward the remote ref that matches <dst>. If
the optional plus `+` is used, the remote ref is updated
even if it does not result in a fast forward update.
+
Note: If no explicit refspec is found, (that is neither
on the command line nor in any Push line of the
corresponding remotes file---see below), then all the
refs that exist both on the local side and on the remote
side are updated.
+
Some short-cut notations are also supported.
+
* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
Expand Down
44 changes: 42 additions & 2 deletions Documentation/git-rebase.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,54 @@ git-rebase - Rebase local commits to new upstream head.

SYNOPSIS
--------
'git-rebase' <upstream> [<head>]
'git-rebase' [--onto <newbase>] <upstream> [<branch>]

DESCRIPTION
-----------
Rebases local commits to the new head of the upstream tree.
git-rebase applies to <upstream> (or optionally to <newbase>) commits
from <branch> that do not appear in <upstream>. When <branch> is not
specified it defaults to the current branch (HEAD).

When git-rebase is complete, <branch> will be updated to point to the
newly created line of commit objects, so the previous line will not be
accessible unless there are other references to it already.

Assume the following history exists and the current branch is "topic":

A---B---C topic
/
D---E---F---G master

From this point, the result of the following commands:

git-rebase master
git-rebase master topic

would be:

A'--B'--C' topic
/
D---E---F---G master

While, starting from the same point, the result of the following
commands:

git-rebase --onto master~1 master
git-rebase --onto master~1 master topic

would be:

A'--B'--C' topic
/
D---E---F---G master

OPTIONS
-------
<newbase>::
Starting point at which to create the new commits. If the
--onto option is not specified, the starting point is
<upstream>.

<upstream>::
Upstream branch to compare against.

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,15 @@ git-ssh-upload$X: rsh.o
git-ssh-pull$X: rsh.o fetch.o
git-ssh-push$X: rsh.o

git-http-fetch$X: fetch.o http.o http-fetch.o
git-http-fetch$X: fetch.o http.o http-fetch.o $(LIB_FILE)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL)

git-http-push$X: http.o http-push.o
git-http-push$X: http.o http-push.o $(LIB_FILE)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)

git-rev-list$X: rev-list.o
git-rev-list$X: rev-list.o $(LIB_FILE)
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(OPENSSL_LIBSSL)

Expand Down
60 changes: 20 additions & 40 deletions contrib/gitview/gitview
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ def show_date(epoch, tz):

return time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(secs))

def get_sha1_from_tags(line):
fp = os.popen("git cat-file -t " + line)
entry = string.strip(fp.readline())
fp.close()
if (entry == "commit"):
return line
elif (entry == "tag"):
fp = os.popen("git cat-file tag "+ line)
entry = string.strip(fp.readline())
fp.close()
obj = re.split(" ", entry)
if (obj[0] == "object"):
return obj[1]
return None

class CellRendererGraph(gtk.GenericCellRenderer):
"""Cell renderer for directed graph.
Expand Down Expand Up @@ -174,9 +160,9 @@ class CellRendererGraph(gtk.GenericCellRenderer):
names_len = 0
if (len(names) != 0):
for item in names:
names_len += len(item)/3
names_len += len(item)

width = box_size * (cols + 1 + names_len )
width = box_size * (cols + 1 ) + names_len
height = box_size

# FIXME I have no idea how to use cell_area properly
Expand Down Expand Up @@ -258,6 +244,8 @@ class CellRendererGraph(gtk.GenericCellRenderer):
for item in names:
name = name + item + " "

ctx.select_font_face("Monospace")
ctx.set_font_size(13)
ctx.text_path(name)

self.set_colour(ctx, colour, 0.0, 0.5)
Expand Down Expand Up @@ -465,32 +453,24 @@ class GitView:
respective sha1 details """

self.bt_sha1 = { }
ls_remote = re.compile('^(.{40})\trefs/([^^]+)(?:\\^(..))?$');
git_dir = os.getenv("GIT_DIR")
if (git_dir == None):
git_dir = ".git"

#FIXME the path seperator
ref_files = os.listdir(git_dir + "/refs/tags")
for file in ref_files:
fp = open(git_dir + "/refs/tags/"+file)
sha1 = get_sha1_from_tags(string.strip(fp.readline()))
try:
self.bt_sha1[sha1].append(file)
except KeyError:
self.bt_sha1[sha1] = [file]
fp.close()


#FIXME the path seperator
ref_files = os.listdir(git_dir + "/refs/heads")
for file in ref_files:
fp = open(git_dir + "/refs/heads/" + file)
sha1 = get_sha1_from_tags(string.strip(fp.readline()))
try:
self.bt_sha1[sha1].append(file)
except KeyError:
self.bt_sha1[sha1] = [file]
fp.close()
fp = os.popen('git ls-remote ' + git_dir)
while 1:
line = string.strip(fp.readline())
if line == '':
break
m = ls_remote.match(line)
if not m:
continue
(sha1, name) = (m.group(1), m.group(2))
if not self.bt_sha1.has_key(sha1):
self.bt_sha1[sha1] = []
self.bt_sha1[sha1].append(name)
fp.close()


def construct(self):
Expand Down Expand Up @@ -537,8 +517,8 @@ class GitView:

cell = CellRendererGraph()
column = gtk.TreeViewColumn()
column.set_resizable(False)
column.pack_start(cell, expand=False)
column.set_resizable(True)
column.pack_start(cell, expand=True)
column.add_attribute(cell, "node", 1)
column.add_attribute(cell, "in-lines", 2)
column.add_attribute(cell, "out-lines", 3)
Expand Down
Loading

0 comments on commit 882e4dc

Please sign in to comment.