1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 15:28:21 +01:00
Commit graph

9354 commits

Author SHA1 Message Date
Jakub Narebski
52c813f22f gitweb: Add example of config file and how to generate projects list to gitweb/INSTALL
Add simple example of config file (turning on and allowing override of
a few %features). Also example config file and script to generate list
of projects in a format that can be used as GITWEB_LIST / $projects_list.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 22:22:33 -07:00
Junio C Hamano
b6da18b1d1 GIT 1.5.1-rc2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 18:01:50 -07:00
Eric Wong
0b59451c1b git-svn: fix rel_path() when not connected to the repository root
This should fix fetching for people who did not use
"git svn --minimize" or cannot connect to the repository root
due to the lack of permissions.

I'm not sure what I was on when I made the change to the
rel_path() function in 4e9f6cc78e
that made it die() when we weren't connected to the repository
root :x

Thanks to Sven Verdoolaege for reporting this bug.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 18:01:28 -07:00
James Bowes
3301521a25 use xmalloc in git.c and help.c
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 18:00:23 -07:00
Junio C Hamano
3a81b9f571 Merge branch 'jc/fpl'
* jc/fpl:
  git-log --first-parent: show only the first parent log
2007-03-25 17:47:07 -07:00
Junio C Hamano
620d3f4216 Update README to point at a few key periodical messages to the list
They give a good starting point to new people who want to get
involved.  This owes suggestions by Martin Langhoff and Steven
Grimm.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25 17:42:32 -07:00
Junio C Hamano
2603fa5fb3 Merge branch 'maint'
* maint:
  user-manual: introduce "branch" and "branch head" differently
  glossary: clean up cross-references
  glossary: stop generating automatically
  user-manual: Use def_ instead of ref_ for glossary references.
  user-manual.txt: fix a tiny typo.
  user-manual: run xsltproc without --nonet option
2007-03-25 15:08:11 -07:00
Junio C Hamano
fd2a75972e Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
* 'maint' of git://linux-nfs.org/~bfields/git:
  user-manual: introduce "branch" and "branch head" differently
  glossary: clean up cross-references
  glossary: stop generating automatically
  user-manual: Use def_ instead of ref_ for glossary references.
  user-manual.txt: fix a tiny typo.
  user-manual: run xsltproc without --nonet option
2007-03-25 15:07:27 -07:00
Junio C Hamano
c5a07b3b4f Merge branch 'js/remote-show-push'
* js/remote-show-push:
  Teach git-remote to list pushed branches.
2007-03-25 01:45:06 -07:00
Junio C Hamano
12d6697f3a Merge branch 'maint'
* maint:
  gitweb: Add some installation notes in gitweb/INSTALL
  gitweb: Fix not marking signoff lines in "log" view
  gitweb: Don't escape attributes in CGI.pm HTML methods
  gitweb: Change to use explicitly function call cgi->escapHTML()
2007-03-25 00:21:40 -07:00
Alex Riesen
06aff47b22 Use diff* with --exit-code in git-am, git-rebase and git-merge-ours
This simplifies the shell code, reduces its memory footprint, and
speeds things up. The performance improvements should be noticable
when git-rebase works on big commits.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 23:01:36 -07:00
Alex Riesen
2a18c266d0 Document --quiet option to git-diff
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:32:55 -07:00
Nicolas Pitre
b5b8d8141a write_sha1_from_fd() should make new objects read-only
... like it is done everywhere else.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:32:41 -07:00
Nicolas Pitre
0e55181f29 make it more obvious that temporary files are temporary files
When some operations are interrupted (or "die()'d" or crashed) then the
partial object/pack/index file may remain around.  Make it more obvious
in their name that those files are temporary stuff and can be cleaned up
if no operation is in progress.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:32:39 -07:00
Andy Parkins
46d409d0bf update-hook: remove e-mail sending hook.
The update hook's only job is to decide is a particular update
is allowed or not.  It was not the right place to send out
update notification e-mails from to begin with, as the final
stage of updating refs can fail after this hook runs.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:30:53 -07:00
Jakub Narebski
cd67c8e0bc gitweb: Add some installation notes in gitweb/INSTALL
Add some installation and configuration notes for gitweb in
gitweb/INSTALL. Make use of filling gitweb configuration by
Makefile.

It does not cover (yet?) all the configuration variables and
options.

Some of contents duplicates information in gitweb/README file
(it is referred from gitweb/INSTALL).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:26:33 -07:00
Jakub Narebski
4ae89b7625 gitweb: Fix not marking signoff lines in "log" view
The CSS selector for signoff lines style was too strict: in the "log"
view the commit message is not encompassed in container "page_body"
div.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:25:55 -07:00
Jakub Narebski
346d5e1835 gitweb: Don't escape attributes in CGI.pm HTML methods
There is no need to escape HTML tag's attributes in CGI.pm
HTML methods (like CGI::a()), because CGI.pm does attribute
escaping automatically.

  $cgi->a({ ... -attribute => atribute_value }, tag_contents)

is translated to

  <a ... attribute="attribute_value">tag_contents</a>

The rules for escaping attribute values (which are string contents) are
different. For example you have to take care about escaping embedded '"'
and "'" characters; CGI::a() does that for us automatically.

CGI::a() does not HTML escape tag_contents; we would need to write

  <a href="URL">some <b>bold</b> text</a>

for example. So we use esc_html (or esc_path) to escape tag_contents
as needed.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:25:47 -07:00
Li Yang
290b1467a3 gitweb: Change to use explicitly function call cgi->escapHTML()
Change to use explicitly function call cgi->escapHTML().
This fix the problem on some systems that escapeHTML() is not
functioning, as default CGI is not setting 'escape' parameter.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 22:25:40 -07:00
Junio C Hamano
2499857b0b git-am documentation: describe what is taken from where.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 03:08:54 -07:00
Johannes Schindelin
e43b010582 git-revert: Revert revert message to old behaviour
When converting from the shell script, based on a misreading of the
sed invocation, the builtin included the abbreviated commit name,
and did _not_ include the quotes around the oneline message.

This fixes it.

[jc: with a fix for the typo/thinko spotted by Linus, and also
 removing the unwanted abbrev at the beginning.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-24 02:50:22 -07:00
Junio C Hamano
1daa09d9a8 make the previous optimization work also on path-limited rev-list --bisect
The trick is to give a child commit that is not tree-changing
the same depth as its parent, so that the depth is propagated
properly along strand of pearls.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:38:32 -07:00
Junio C Hamano
2a4646904a rev-list --bisect: Fix "halfway" optimization.
If you have 5 commits in the set, commits that reach 2 or 3
commits are at halfway.  If you have 6 commits, only commits
that reach exactly 3 commits are at halfway.  The earlier one is
completely botched the math.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:38:32 -07:00
Junio C Hamano
1c2c6112a4 Merge branch 'master' into jc/bisect
This is to merge in the fix for path-limited bisection
from the 'master' branch.
2007-03-23 23:38:04 -07:00
Junio C Hamano
b08bbae7e1 Merge branch 'maint'
* maint:
  gitweb: Fix "next" link in commit view
2007-03-23 23:29:37 -07:00
Christian Couder
6cea055547 Documentation: bisect: make a comment fit better in the man page.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:29:29 -07:00
Christian Couder
1207f9e705 Documentation: bisect: add some titles to some paragraphs.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:29:09 -07:00
Christian Couder
fed820ad56 Documentation: bisect: reformat more paragraphs.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:26:11 -07:00
Christian Couder
cc070d1f79 Documentation: bisect: reword one paragraph.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:26:02 -07:00
Christian Couder
7891a2811d Documentation: bisect: reformat some paragraphs.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 23:25:54 -07:00
Junio C Hamano
a4e9d71edb Fix path-limited "rev-list --bisect" termination condition.
In a path-limited bisection, when the $bad commit is not
changing the limited path, and the number of suspects is 1, the
code miscounted and returned $bad from find_bisection(), which
is not marked with TREECHANGE.  This is of course filtered by
the output routine, resulting in an empty output, in turn
causing git-bisect driver to say "$bad was both good and bad".

Illustration.  Suppose you have these four commits, and only C
changes path P.  You know D is bad and A is good.

	A---B---C*--D

git-bisect driver runs this to find a bisection point:

	$ git rev-list --bisect A..D -- P

which calls find_bisection() with B, C and D.  The set of
commits that is given to this function is the same set of
commits as rev-list without --bisect option and pathspec
returns.  Among them, only C is marked with TREECHANGE.  Let's
call the set of commits given to find_bisection() that are
marked with TREECHANGE (or all of them if no path limiter is in
effect) "the bisect set".  In the above example, the size of the
bisect set is 1 (contains only "C").

For each commit in its input, find_bisection() computes the
number of commits it can reach in the bisect set.  For a commit
in the bisect set, this number includes itself, so the number is
1 or more.  This number is called "depth", and computed by
count_distance() function.

When you have a bisect set of N commits, and a commit has depth
D, how good is your bisection if you returned that commit?  How
good this bisection is can be measured by how many commits are
effectively tested "together" by testing one commit.

Currently you have (N-1) untested commits (the tip of the bisect
set, although it is included in the bisect set, is already known
to be bad).  If the commit with depth D turns out to be bad,
then your next bisect set will have D commits and you will have
(D-1) untested commits left, which means you tested (N-1)-(D-1)
= (N-D) commits with this bisection.  If it turns out to be good, then
your next bisect set will have (N-D) commits, and you will have
(N-D-1) untested commits left, which means you tested
(N-1)-(N-D-1) = D commits with this bisection.

Therefore, the goodness of this bisection is is min(N-D, D), and
find_bisection() function tries to find a commit that maximizes
this, by initializing "closest" variable to 0 and whenever a
commit with the goodness that is larger than the current
"closest" is found, that commit and its goodness are remembered
by updating "closest" variable.  The "the commit with the best
goodness so far" is kept in "best" variable, and is initialized
to a commit that happens to be at the beginning of the list of
commits given to this function (which may or may not be in the
bisect set when path-limit is in use).

However, when N is 1, then the sole tree-changing commit has
depth of 1, and min(N-D, D) evaluates to 0.  This is not larger
than the initial value of "closest", and the "so far the best
one" commit is never replaced in the loop.

When path-limit is not in use, this is not a problem, as any
commit in the input set is tree-changing.  But when path-limit
is in use, and when the starting "bad" commit does not change
the specified path, it is not correct to return it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 17:20:43 -07:00
Jakub Narebski
f9308a182e gitweb: Fix "next" link in commit view
Fix copy'n'paste error in commit c9d193df which caused that "next"
link for merge commits in "commit" view
  (merge: _commit_ _commit_ ...)
was to "commitdiff" view instead of being to "commit" view.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 14:54:52 -07:00
Junio C Hamano
12cb813733 git-bisect.sh: properly dq $GIT_DIR
Otherwise you would be in trouble if your GIT_DIR has IFS letters in it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 13:29:55 -07:00
Junio C Hamano
673e58389f git-bisect: typofix
The branch you are on while bisecting is always "bisect", and
checking for "refs/heads/bisect*" is wrong.  Only check if it is
exactly "refs/heads/bisect".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 13:15:21 -07:00
Junio C Hamano
abba9dbbf4 checkout: report where the new HEAD is upon detaching HEAD
After "git reset" moves the HEAD around, it reports which commit
you are on, which gives the user a warm fuzzy feeling of
assurance.  Give the same assurance from git-checkout when
moving the detached HEAD around.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 02:48:09 -07:00
Junio C Hamano
bab36bf57d t6004: add a bit more path optimization test.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 02:32:26 -07:00
Christian Couder
a17c410100 Bisect: implement "git bisect run <cmd>..." to automatically bisect.
This idea was suggested by Bill Lear
(Message-ID: <17920.38942.364466.642979@lisa.zopyra.com>)
and I think it is a very good one.

This patch adds a new test file for "git bisect run", but there
is currently only one basic test.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 01:54:47 -07:00
Uwe Kleine-König
cc65343a84 Bisect: convert revs given to good and bad to commits
Without this the rev could be (e.g.) a tag and then the condition to end the
bisect might fail and you have to check the already known to be bad revision
once more.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-23 01:48:29 -07:00
Johannes Schindelin
3007a78033 t4118: be nice to non-GNU sed
Elias Pipping:
> I'm on a mac, hence /usr/bin/sed is not gnu sed, which makes
> t4118 fail.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Ack'd-by: Elias Pipping <pipping@macports.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 18:08:37 -07:00
Junio C Hamano
cc96fd092a git-apply: Do not free the wrong buffer when we convert the data for writeout
When we write out the result of patch application, we sometimes
need to munge the data (e.g. under core.autocrlf).  After doing
so, what we should free is the temporary buffer that holds the
converted data returned from convert_to_working_tree(), not the
original one.

This patch also moves the call to open() up in the function, as
the caller expects us to fail cheaply if leading directories
need to be created (and then the caller creates them and calls
us again).  For that calling pattern, attempting conversion
before opening the file adds unnecessary overhead.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 17:32:51 -07:00
Junio C Hamano
00cec846f1 Merge git://git2.kernel.org/pub/scm/gitk/gitk
* git://git2.kernel.org/pub/scm/gitk/gitk:
  [PATCH] prefer "git COMMAND" over "git-COMMAND" in gitk
2007-03-22 03:05:34 -07:00
Junio C Hamano
aa576e6b47 Merge branch 'maint'
* maint:
  Documentation/pack-format.txt: Clear up description of types.
  fix typo in git-am manpage
2007-03-22 03:05:25 -07:00
Peter Eriksen
979ea5856c Documentation/pack-format.txt: Clear up description of types.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 03:05:19 -07:00
Nicolas Pitre
605fac8b5b update HEAD reflog when branch pointed to by HEAD is directly modified
The HEAD reflog is updated as well as the reflog for the branch pointed
to by HEAD whenever it is referenced with "HEAD".

There are some cases where a specific branch may be modified directly.
In those cases, the HEAD reflog should be updated as well if it is a
symref to that branch in order to be consistent.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 03:02:48 -07:00
Andy Parkins
0a0d080bdc update-hook: abort early if the project description is unset
It was annoying to always have the first email from a project be from
the "Unnamed repository; edit this file to name it for gitweb project";
just because it's so easy to forget to set it.

This patch checks to see if the description file is still default (or
empty) and aborts if so - allowing you to fix the problem before sending
out silly looking emails to every developer.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 03:02:31 -07:00
Michael S. Tsirkin
85295a52e6 git-merge: Put FETCH_HEAD data in merge commit message
This makes git-fetch <URL> && git-merge FETCH_HEAD produce the
same merge message as git-pull <URL>.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 03:01:43 -07:00
Junio C Hamano
a1bf91e081 git-rebase: make 'rebase HEAD branch' work as expected.
When you want to amend the commit message of 3 commits before
the tip of the current branch, say 'master',

	A--B--C--D--E(master)

it is sometimes handy to make your head detached at that commit
with:

	$ git checkout HEAD~3 ;# check out B
	$ git commit --amend ;# without modifying contents...

to create:

          .B'(HEAD)
         /
	A--B--C--D--E(master)

and then rebase 'master' branch onto HEAD with this:

	$ git rebase HEAD master

to result in:

          .B'-C'-D'-E(master=HEAD)
         /
	A--B--C--D--E

However, the current code interprets HEAD after it switches to
the branch 'master', which means the rebase will not do
anything.  You have to say something unwieldly like this
instead:

	$ git rebase $(git rev-parse HEAD) master

This fixes it by expanding the $onto commit name before
switching to the target branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 02:56:53 -07:00
Junio C Hamano
1c4fea3a40 git-rev-list --bisect: optimization
This improves the performance of revision bisection.

The idea is to avoid rather expensive count_distance() function,
which counts the number of commits that are reachable from any
given commit (including itself) in the set.  When a commit has
only one relevant parent commit, the number of commits the
commit can reach is exactly the number of commits that the
parent can reach plus one; instead of running count_distance()
on commits that are on straight single strand of pearls, we can
just add one to the parents' count.

On the other hand, for a merge commit, because the commits
reachable from one parent can be reachable from another parent,
you cannot just add the parents' counts up plus one for the
commit itself; that would overcount ancestors that are reachable
from more than one parents.

The algorithm used in the patch runs count_distance() on merge
commits, and uses the util field of commit objects to remember
them.  After that, the number of commits reachable from each of
the remaining commits is counted by finding a commit whose count
is not yet known but the count for its (sole) parent is known,
and adding one to the parent's count, until we assign numbers to
everybody.

Another small optimization is whenever we find a half-way commit
(that is, a commit that can reach exactly half of the commits),
we stop giving counts to remaining commits, as we will not find
any better commit than we just found.

The performance to bisect between v1.0.0 and v1.5.0 in git.git
repository was improved by saying good and bad in turns from
3.68 seconds down to 1.26 seconds.  Bisecting the kernel between
v2.6.18 and v2.6.20 was sped up from 21.84 seconds down to 4.22
seconds.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 01:44:17 -07:00
Junio C Hamano
457f08a030 git-rev-list: add --bisect-vars option.
This adds --bisect-vars option to rev-list.  The output is suitable
for `eval` in shell and defines five variables:

 - bisect_rev is the next revision to test.
 - bisect_nr is the expected number of commits to test after
   bisect_rev is tested.
 - bisect_good is the expected number of commits to test
   if bisect_rev turns out to be good.
 - bisect_bad is the expected number of commits to test
   if bisect_rev turns out to be bad.
 - bisect_all is the number of commits we are bisecting right now.

The documentation text was partly stolen from Johannes
Schindelin's patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 01:32:31 -07:00
Junio C Hamano
7054b6089d t6002: minor spelling fix.
The test expects --bisect option can be configured with by setting
$_bisect_option.  So let's allow that uniformly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-22 01:00:12 -07:00