1
0
mirror of https://github.com/git/git.git synced 2024-10-05 02:11:43 +02:00
Commit Graph

7320 Commits

Author SHA1 Message Date
Quy Tonthat
7dda22e317 Documentation/git-branch: new -r to delete remote-tracking branches.
Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 20:36:42 -08:00
Terje Sten Bjerkseth
c902c9a608 Fix system header problems on Mac OS X
For Mac OS X 10.4, _XOPEN_SOURCE defines _POSIX_C_SOURCE which
hides many symbols from the program.

Breakage noticed and initial analysis provided by Randal
L. Schwartz.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 17:59:22 -08:00
Junio C Hamano
5b85143ba5 Merge branch 'ew/svn-pm'
* ew/svn-pm:
  git-svn: rename 'commit' command to 'set-tree'
  git-svn: remove support for the svn command-line client
  git-svn: convert to using Git.pm
2006-12-20 17:20:45 -08:00
Junio C Hamano
ce0545455a diff documentation: mostly talk about <commit>
This corrects minor remaining bits that still talked about <tree-ish>;
the Porcelain users (as opposed to plumbers) are mostly interested in
commits so use <commit> consistently and keep a sentence that mentions
that <tree-ish> can be used in place of them.
2006-12-20 14:41:54 -08:00
Junio C Hamano
63c4b4c5c1 Merge branch 'jc/leftright'
* jc/leftright:
  Revert "Make left-right automatic."
  Make left-right automatic.
  Teach all of log family --left-right output.
  rev-list --left-right
2006-12-20 14:20:17 -08:00
Junio C Hamano
e035ce939d Merge branch 'jc/blame'
* jc/blame:
  blame: -b (blame.blankboundary) and --root (blame.showroot)
2006-12-20 13:58:10 -08:00
Junio C Hamano
55e268e7ed Merge branch 'jc/branch-remove-remote'
* jc/branch-remove-remote:
  git-branch -d: do not stop at the first failure.
  Teach git-branch to delete tracking branches with -r -d
2006-12-20 13:57:59 -08:00
Junio C Hamano
aa1cef54a2 Merge branch 'jc/clone'
* jc/clone:
  Move "no merge candidate" warning into git-pull
  Use preprocessor constants for environment variable names.
  Do not create $GIT_DIR/remotes/ directory anymore.
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  git-clone: lose the traditional 'no-separate-remote' layout
  git-clone: lose the artificial "first" fetch refspec
  git-pull: refuse default merge without branch.*.merge
  git-clone: use wildcard specification for tracking branches
2006-12-20 13:56:14 -08:00
Junio C Hamano
1d182bd5f4 compat/inet_ntop: do not use u_int
It is pointless.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 13:45:55 -08:00
Junio C Hamano
ec722203ee spurious .sp in manpages
This cherry-picks 7ef04350 that has been applied to the 'master'
to fix ".sp" in generated manpages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 13:43:03 -08:00
Junio C Hamano
93b0d86aaf git-add: error out when given no arguments.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 13:41:00 -08:00
Junio C Hamano
d5db6c9ee7 revision: --skip=<n>
This adds --skip=<n> option to revision traversal machinery.
Documentation and test were added by Robert Fitzsimons.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 11:26:11 -08:00
Junio C Hamano
54851157ac Merge branch 'maint'
* maint:
  GIT 1.4.4.3
2006-12-20 11:25:25 -08:00
Junio C Hamano
851a911024 GIT 1.4.4.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
v1.4.4.3
2006-12-20 11:23:22 -08:00
Nicolas Pitre
08a19d873c clarify some error messages wrt unknown object types
If ever new object types are added for future extensions then better
have current git version report them as "unknown" instead of
"corrupted".

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 10:46:34 -08:00
Junio C Hamano
85023577a8 simplify inclusion of system header files.
This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 09:51:35 -08:00
Nicolas Pitre
6d2fa7f1b4 index-pack usage of mmap() is unacceptably slower on many OSes other than Linux
It was reported by Randal L. Schwartz <merlyn@stonehenge.com> that
indexing the Linux repository ~150MB pack takes about an hour on OS x
while it's a minute on Linux.  It seems that the OS X mmap()
implementation is more than 2 orders of magnitude slower than the Linux
one.

Linus proposed a patch replacing mmap() with pread() bringing index-pack
performance on OS X in line with the Linux one.  The performances on
Linux also improved by a small margin.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20 00:42:10 -08:00
Robert Fitzsimons
313ce8cee6 gitweb: Show '...' links in "summary" view only if there are more items
Show "..." links in "summary" view to shortlog, heads (if there are
any), and tags (if there are any) only if there are more items to show
than shown already.

This means that "..." link is shown below shortened shortlog if there
are more than 16 commits, "..." link below shortened heads list if
there are more than 16 heads refs (16 branches), "..." link below
shortened tags list if there are more than 16 tags.

Modified patch from Jakub to to apply cleanly to master, also preform
the same "..." link logic to the forks list.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 22:49:59 -08:00
Junio C Hamano
fc1905bb93 config_rename_section: fix FILE* leak
Noticed by SungHyun Nam.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 22:30:59 -08:00
Brian Gernhardt
c17f9f12a4 Remove COLLISION_CHECK from Makefile since it's not used.
It's rather misleading to have configuration options that don't do
anything.  If someone adds collision checking they might also want to
restore this option.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 21:33:35 -08:00
Junio C Hamano
5caf923223 fix populate-filespec
I hand munged the original patch when committing 1510fea78, and
screwed up the conversion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 21:33:24 -08:00
Eric Wong
c6b4fa96cb git-cvsserver: fix breakage when calling git merge-file
In the same vein as 8336afa563fbeff35e531396273065161181f04c,
this fixes the the RCS merge to git-merge-file conversion in
commit e2b70087.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 16:32:18 -08:00
Junio C Hamano
8dce823562 Revert "Make left-right automatic."
This reverts commit 5761231975ceffa531d86d9bab0f9a9a370674f6.

Feeding symmetric difference to gitk is so useful, and it is the
same for other graphical Porcelains.  Rather than forcing them
to pass --no-left-right, making it optional.

Noticed and reported by Jeff King.
2006-12-19 02:28:16 -08:00
Josef Weidendorfer
4363dfbe3d Move "no merge candidate" warning into git-pull
The warning triggered even when running "git fetch" only
when resulting .git/FETCH_HEAD only contained
branches marked as 'not-for-merge'.

Signed-off-by: Josef Weidendorfer <weidendo@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 01:53:02 -08:00
Junio C Hamano
d4ebc36c5e Use preprocessor constants for environment variable names.
We broke the discipline Linus set up to allow compiler help us
avoid typos in environment names in the early days of git over
time.  This defines a handful preprocessor constants for
environment variable names used in relatively core parts of the
system.

I've left out variable names specific to subsystems such as HTTP
and SSL as I do not think they are big problems.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 01:51:51 -08:00
Junio C Hamano
75c384efb5 Do not create $GIT_DIR/remotes/ directory anymore.
Because we do not use --no-separate-remote anymore, there is no
reason to create that directory from the template.

t5510 test is updated to test both $GIT_DIR/remotes/ based
configuration and $GIT_DIR/config variable (credits to
Johannes).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 01:50:37 -08:00
Junio C Hamano
5fed466815 Merge branch 'jc/test-clone' into jc/clone
* jc/test-clone: (35 commits)
  Introduce GIT_TEMPLATE_DIR
  Revert "fix testsuite: make sure they use templates freshly built from the source"
  fix testsuite: make sure they use templates freshly built from the source
  rerere: fix breakage of resolving.
  Add config example with respect to branch
  Add documentation for show-branch --topics
  make git a bit less cryptic on fetch errors
  make patch_delta() error cases a bit more verbose
  racy-git: documentation updates.
  show-ref: fix --exclude-existing
  parse-remote::expand_refs_wildcard()
  vim syntax: follow recent changes to commit template
  show-ref: fix --verify --hash=length
  show-ref: fix --quiet --verify
  avoid accessing _all_ loose refs in git-show-ref --verify
  git-fetch: Avoid reading packed refs over and over again
  Teach show-branch how to show ref-log data.
  markup fix in svnimport documentation.
  Documentation: new option -P for git-svnimport
  Fix mis-mark-up in git-merge-file.txt documentation
  ...
2006-12-19 01:38:18 -08:00
Johannes Schindelin
8683a45d66 Introduce GIT_TEMPLATE_DIR
Instead of passing --template explicitely to init-db and clone, you can
just set the environment variable GIT_TEMPLATE_DIR.

Also make use of it in the tests, to make sure that the templates are
copied.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-19 01:14:59 -08:00
Junio C Hamano
171e800b37 Revert "fix testsuite: make sure they use templates freshly built from the source"
This reverts commit 74d20040cafdced657efbf49795183d209a3a07b.
Version from Johannes to introduce GIT_TEMPLATE_DIR is simpler,
although I unconsciously stayed away from introducing yet another
environment variable.
2006-12-19 01:14:35 -08:00
Junio C Hamano
835b2aeba7 git-add --interactive: hunk splitting
This adds hunk splitting and recounting the patch lines.  The
'patch' subcommand now allows you to split a large hunk at
context lines in the middle.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:28:45 -08:00
Junio C Hamano
5cde71d64a git-add --interactive
A script to be driven when the user says "git add --interactive"
is introduced.

When it is run, first it runs its internal 'status' command to
show the current status, and then goes into its internactive
command loop.

The command loop shows the list of subcommands available, and
gives a prompt "What now> ".  In general, when the prompt ends
with a single '>', you can pick only one of the choices given
and type return, like this:

    *** Commands ***
      1: status       2: update       3: revert       4: add untracked
      5: patch        6: diff         7: quit         8: help
    What now> 1

You also could say "s" or "sta" or "status" above as long as the
choice is unique.

The main command loop has 6 subcommands (plus help and quit).

 * 'status' shows the change between HEAD and index (i.e. what
   will be committed if you say "git commit"), and between index
   and working tree files (i.e. what you could stage further
   before "git commit" using "git-add") for each path.  A sample
   output looks like this:

              staged     unstaged path
     1:       binary      nothing foo.png
     2:     +403/-35        +1/-1 git-add--interactive.perl

   It shows that foo.png has differences from HEAD (but that is
   binary so line count cannot be shown) and there is no
   difference between indexed copy and the working tree
   version (if the working tree version were also different,
   'binary' would have been shown in place of 'nothing').  The
   other file, git-add--interactive.perl, has 403 lines added
   and 35 lines deleted if you commit what is in the index, but
   working tree file has further modifications (one addition and
   one deletion).

 * 'update' shows the status information and gives prompt
   "Update>>".  When the prompt ends with double '>>', you can
   make more than one selection, concatenated with whitespace or
   comma.  Also you can say ranges.  E.g. "2-5 7,9" to choose
   2,3,4,5,7,9 from the list.  You can say '*' to choose
   everything.

   What you chose are then highlighted with '*', like this:

              staged     unstaged path
     1:       binary      nothing foo.png
   * 2:     +403/-35        +1/-1 git-add--interactive.perl

   To remove selection, prefix the input with - like this:

        Update>> -2

   After making the selection, answer with an empty line to
   stage the contents of working tree files for selected paths
   in the index.

 * 'revert' has a very similar UI to 'update', and the staged
   information for selected paths are reverted to that of the
   HEAD version.  Reverting new paths makes them untracked.

 * 'add untracked' has a very similar UI to 'update' and
   'revert', and lets you add untracked paths to the index.

 * 'patch' lets you choose one path out of 'status' like
   selection.  After choosing the path, it presents diff between
   the index and the working tree file and asks you if you want
   to stage the change of each hunk.  You can say:

        y - add the change from that hunk to index
        n - do not add the change from that hunk to index
        a - add the change from that hunk and all the rest to index
        d - do not the change from that hunk nor any of the rest to index
        j - do not decide on this hunk now, and view the next
            undecided hunk
        J - do not decide on this hunk now, and view the next hunk
        k - do not decide on this hunk now, and view the previous
            undecided hunk
        K - do not decide on this hunk now, and view the previous hunk

   After deciding the fate for all hunks, if there is any hunk
   that was chosen, the index is updated with the selected hunks.

 * 'diff' lets you review what will be committed (i.e. between
   HEAD and index).

This is still rough, but does everything except a few things I
think are needed.

 * 'patch' should be able to allow splitting a hunk into
   multiple hunks.

 * 'patch' does not adjust the line offsets @@ -k,l +m,n @@
   in the hunk header.  This does not have major problem in
   practice, but it _should_ do the adjustment.

 * It does not have any explicit support for a merge in
   progress; it may not work at all.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:28:45 -08:00
Junio C Hamano
4c10a5caa7 blame: -b (blame.blankboundary) and --root (blame.showroot)
When blame.blankboundary is set (or -b option is given), commit
object names are blanked out in the "human readable" output
format for boundary commits.

When blame.showroot is not set (or --root is not given), the
root commits are treated as boundary commits.  The code still
attributes the lines to them, but with -b their object names are
not shown.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:28:19 -08:00
Quy Tonthat
b8e9a00d40 git-branch -d: do not stop at the first failure.
If there are more than one branches to be deleted, failure on
one will no longer stop git-branch to process the next ones.
The command still reports failures by exitting non-zero status.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:28:12 -08:00
Junio C Hamano
f3d985c380 Teach git-branch to delete tracking branches with -r -d
Because -r already means "remote" when listing, you can say:

	$ git branch -d -r origin/todo origin/html origin/man

I just twisted it not to check fast-forwardness with the current
branch when you are removing a tracking branch.  Most likely,
removal of a tracking branch is not because you are "done with"
it (for a local branch, it usually means "you merged it up"),
but because you are not even interested in it.  In other words,
remote tracking branches are more like tags than branches.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:28:12 -08:00
Junio C Hamano
74d20040ca fix testsuite: make sure they use templates freshly built from the source
The initial t/trash repository for testing was created properly
but over time we gained many tests that create secondary test
repositories with init-db or clone and they were not careful
enough.

This fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:21:54 -08:00
Junio C Hamano
8336afa563 rerere: fix breakage of resolving.
commit e2b70087 botched the RCS merge to git-merge-file conversion.
There is no command called "git merge-file" (yes, we are using safer
variant of Perl's system(3)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:20:53 -08:00
Aneesh Kumar K.V
910c00c8ca Add config example with respect to branch
Update config.txt with example with respect to branch
config variable. This give a better idea regarding
how branch names are expected.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:05:08 -08:00
Brian Gernhardt
38c594d330 Add documentation for show-branch --topics
Add a quick paragraph explaining the --topics option for show-branch.
The explanation is an abbreviated version of the commit message from
d320a5437f8304cf9ea3ee1898e49d643e005738.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 16:03:39 -08:00
Nicolas Pitre
b3d9899324 make git a bit less cryptic on fetch errors
The remote server might not want to tell why it doesn't like us for
security reasons, but let's make the client report such error in a bit
less confusing way.  The remote failure remains a mystery, but the local
message might be a bit less so.

[jc: with a gentle wording updates from Andy Parkins]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 15:31:28 -08:00
Nicolas Pitre
57b73150c4 make patch_delta() error cases a bit more verbose
It is especially important to distinguish between a malloc() failure
from all the other cases.  An out of memory condition is much less
worrisome than a compatibility/corruption problem.

Also make test-delta compilable again.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 15:30:17 -08:00
Junio C Hamano
e1bb1d31ea racy-git: documentation updates.
We've removed the workaround for runtime penalty that did not
exist in practice some time ago, but the technical paper that
proposed that change still said "we probably should do so".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 14:18:54 -08:00
Junio C Hamano
d8285af481 show-ref: fix --exclude-existing
Do not falsely document --filter-invalid which does not even exist.
Also make sure the line is long enough to have ^{} suffix before
checking for it.

Pointed out by Dscho.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 13:40:25 -08:00
Junio C Hamano
0c7a97fafd parse-remote::expand_refs_wildcard()
Work around dash incompatibility by not using "${name%'^{}'}".

Noticed by Jeff King; dash seems to mistake the closing brace
inside the single quote as the terminating brace for parameter
expansion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 12:13:46 -08:00
Jeff King
ff7f22f36e vim syntax: follow recent changes to commit template
This patch changes the syntax highlighting to correctly match the new
text of the commit message introduced by
  82dca84871637ac9812c0dec27f56d07cfba524c

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 00:00:15 -08:00
Junio C Hamano
64fe031a7a show-ref: fix --verify --hash=length
An earlier optimization for --verify broke a lot of stuff
because it did not take interaction with other flags into
account.

This also fixes an unrelated argument parsing error; --hash=8
should mean the same as "--hash --abbrev=8".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 19:36:50 -08:00
Junio C Hamano
dd9142993c show-ref: fix --quiet --verify
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 18:53:24 -08:00
Junio C Hamano
00bc0ec262 Merge branch 'jc/blame-boundary'
* jc/blame-boundary:
  git-blame: show lines attributed to boundary commits differently.
2006-12-17 18:34:51 -08:00
Junio C Hamano
570c524dd3 Merge branch 'jc/reflog' (early part)
* 'jc/reflog' (early part):
  Teach show-branch how to show ref-log data.
2006-12-17 18:31:24 -08:00
Junio C Hamano
bdf17a02fd Merge branch 'js/branch-config'
* js/branch-config:
  git-branch: rename config vars branch.<branch>.*, too
  add a function to rename sections in the config
2006-12-17 18:27:17 -08:00
Junio C Hamano
9057695012 Merge branch 'jn/web' (early part)
* 'jn/web' (early part):
  gitweb: Add "next" link to commit view
  gitweb: Add title attribute to ref marker with full ref name
  gitweb: Do not show difftree for merges in "commit" view
  gitweb: SHA-1 in commit log message links to "object" view
  gitweb: Hyperlink target of symbolic link in "tree" view (if possible)
  gitweb: Add generic git_object subroutine to display object of any type
  gitweb: Show target of symbolic link in "tree" view
  gitweb: Don't use Content-Encoding: header in git_snapshot
2006-12-17 18:27:17 -08:00