1. 16 May, 2007 2 commits
  2. 15 May, 2007 6 commits
  3. 14 May, 2007 6 commits
  4. 13 May, 2007 12 commits
    • Junio C Hamano's avatar
      Merge branch 'maint' · 43d151a1
      Junio C Hamano authored
      * maint:
        git-svn: don't attempt to minimize URLs by default
        git-svn: fix segfaults due to initial SVN pool being cleared
        git-svn: clean up caching of SVN::Ra functions
        git-svn: don't drop the username from URLs when dcommit is run
        RPM spec: include files in technical/ to package.
        Remove stale non-static-inline prototype for tree_entry_extract()
        git-config: test for 'do not forget "a.b.var" ends "a.var" section'.
        git-config: do not forget seeing "a.b.var" means we are out of "a.var" section.
      43d151a1
    • Frank Lichtenheld's avatar
      cvsserver: Limit config parser to needed options · f987afa8
      Frank Lichtenheld authored
      Change the configuration parser so that it ignores
      everything except for ^gitcvs.((ext|pserver).)?
      This greatly reduces the risk of failing while
      parsing some unknown and irrelevant config option.
      
      The bug that triggered this change was that the
      parsing doesn't handle sections that have a
      subsection and a variable with the same name.
      
      While this bug still remains, all remaining
      causes can be attributed to user error, since
      there are no defined variables gitcvs.ext and
      gitcvs.pserver.
      Signed-off-by: default avatarFrank Lichtenheld <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      f987afa8
    • Jakub Narębski's avatar
      gitweb: Check if requested object exists · 198a2a8a
      Jakub Narębski authored
      Try to avoid "Use of uninitialized value ..." errors caused by bad
      revision, incorrect filename, wrong object id, bad file etc. (wrong
      value of 'h', 'hb', 'f', etc. parameters). This avoids polluting web
      server errors log.
      
      Correct git_get_hash_by_path and parse_commit_text (and, in turn,
      parse_commit) to return undef if object does not exist.  Check in
      git_tag if requested tag exists.
      Signed-off-by: Jakub Narębski's avatarJakub Narebski <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      198a2a8a
    • Junio C Hamano's avatar
      Link to HTML version of external doc if available · a2983cb7
      Junio C Hamano authored
      Currently
      
      $ git grep '\([^t]\|^\)'link: user-manual.txt
      
      gives four hits that refer to .txt version of the documentation
      set, but at least "hooks" and "cvs-migration" have HTML variants
      installed, so refer to them instead.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      a2983cb7
    • Eric Wong's avatar
      git-svn: don't attempt to minimize URLs by default · 4a1bb4c3
      Eric Wong authored
      For tracking branches and tags, git-svn prefers to connect
      to the root of the repository or at least the level that
      houses branches and tags as well as trunk.  However, users
      that are accustomed to tracking a single directory have
      no use for this feature.
      
      As pointed out by Junio, users may not have permissions to
      connect to connect to a higher-level path in the repository.
      
      While the current minimize_url() function detects lack of
      permissions to certain paths _after_ successful logins, it
      cannot effectively determine if it is trying to access a
      login-only portion of a repo when the user expects to
      connect to a part where anonymous access is allowed.
      
      For people used to the git-svnimport switches of
      --trunk, --tags, --branches, they'll already pass the
      repository root (or root+subdirectory), so minimize URL
      isn't of too much use to them, either.
      
      For people *not* used to git-svnimport, git-svn also
      supports:
      
       git svn init --minimize-url \
        --trunk http://repository-root/foo/trunk \
        --branches http://repository-root/foo/branches \
        --tags http://repository-root/foo/tags
      
      And this is where the new --minimize-url command-line switch
      comes in to allow for this behavior to continue working.
      4a1bb4c3
    • Eric Wong's avatar
      git-svn: fix segfaults due to initial SVN pool being cleared · 4c03c3eb
      Eric Wong authored
      Some parts of SVN always seem to use it, even if the SVN::Ra
      object we're using is no longer used and we've created a new one
      in its place.  It's also true that only one SVN::Ra connection
      can exist at once...  Using SVN::Pool->new_default when the
      SVN::Ra object is created doesn't seem to help very much,
      either...
      
      Hopefully this fixes all segfault problems users have been
      experiencing over the past few months.
      Signed-off-by: default avatarEric Wong <[email protected]>
      4c03c3eb
    • Eric Wong's avatar
      git-svn: clean up caching of SVN::Ra functions · 0dc03d6a
      Eric Wong authored
      This patch was originally intended to make the Perl GC more
      sensitive to the SVN::Pool objects and not accidentally clean
      them up when they shouldn't be (causing segfaults).  That didn't
      work, but this patch makes the code a bit cleaner regardless
      
      Put our caches for get_dir and check_path calls directly into
      the SVN::Ra object so they auto-expire when it is destroyed.
      
      dirents returned by get_dir() no longer needs the pool object
      stored persistently along with the cache data, as they'll be
      converted to native Perl hash references.
      
      Since calling rev_proplist repeatedly per-revision is no longer
      needed in git-svn, we do not cache calls to it.
      Signed-off-by: default avatarEric Wong <[email protected]>
      0dc03d6a
    • Eric Wong's avatar
      git-svn: don't drop the username from URLs when dcommit is run · 645833b5
      Eric Wong authored
      We no longer store usernames in URLs stored in git-svn-id lines
      for dcommit, so we shouldn't rely on those URLs when connecting
      to the remote repository to commit.
      645833b5
    • Quy Tonthat's avatar
      RPM spec: include files in technical/ to package. · b24dd51b
      Quy Tonthat authored
      Not only that they are interesting to users, some of the
      files are linked to by the included "Git User's Manual"
      Signed-off-by: default avatarQuy Tonthat <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      b24dd51b
    • Matthieu's avatar
      Remove stale non-static-inline prototype for tree_entry_extract() · 0ab311d6
      Matthieu authored
      When 4651ece8 made the function a "static inline", it should
      have removd the stale prototype but everybody missed that.
      
      Thomas Glanzmann noticed this broke compilation with Forte12
      compiler on his Sun boxes.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      0ab311d6
    • Steffen Prohaska's avatar
      git-config: test for 'do not forget "a.b.var" ends "a.var" section'. · b18a2be3
      Steffen Prohaska authored
      Added test for mentioned bugfix.
      Signed-off-by: Steffen Prohaska's avatarSteffen Prohaska <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      b18a2be3
    • Junio C Hamano's avatar
      git-config: do not forget seeing "a.b.var" means we are out of "a.var" section. · ae9ee41d
      Junio C Hamano authored
      Earlier code tried to be half-careful and knew the logic that
      seeing "a.var" after seeing "a.b.var" is a sign of the previous
      "a.b." section has ended, but forgot it has to handle the other
      way.  Seeing "a.b.var" after seeing "a.var" is a sign that "a."
      section has ended, so a new "a.var2" variable should be added
      before the location "a.b.var" appears.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      ae9ee41d
  5. 12 May, 2007 14 commits
    • Jan Hudec's avatar
      Minor fixup to documentation of hooks in git-receive-pack. · 24a0d61e
      Jan Hudec authored
      Small additional changes to the cbb84e5d
      commit, which introduced documentation to pre-receive and post-receive:
       - Mention that stdout and stderr are equivalent.
       - Add one cross-section link and fix one other.
       - Fix information on advantages of post-receive over post-update.
      Signed-off-by: default avatarJan Hudec <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      24a0d61e
    • Junio C Hamano's avatar
      Merge branch 'maint' · 66715252
      Junio C Hamano authored
      * maint:
        checkout: allow detaching to HEAD even when switching to the tip of a branch
        Updated documentation of hooks in git-receive-pack.
        Allow fetching references from any namespace
        tiny fix in documentation of git-clone
        Fix an unmatched comment end in arm/sha1_arm.S
      66715252
    • Junio C Hamano's avatar
      checkout: allow detaching to HEAD even when switching to the tip of a branch · fdc99cbb
      Junio C Hamano authored
      You cannot currently checkout the tip of an existing branch
      without moving to the branch.
      
      This allows you to detach your HEAD and place it at such a
      commit, with:
      
          $ git checkout master^0
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      fdc99cbb
    • Jan Hudec's avatar
      Updated documentation of hooks in git-receive-pack. · cbb84e5d
      Jan Hudec authored
      Added documentation of pre-receive and post-receive hooks and updated
      documentation of update and post-update hooks.
      
      [jc: with minor copy-editing]
      Signed-off-by: default avatarJan Hudec <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      cbb84e5d
    • Junio Hamano's avatar
      t9400: Use the repository config and nothing else. · a25907da
      Junio Hamano authored
      git-cvsserver has a bug in its configuration file output parser
      that makes it choke if the configuration has these:
      
              [diff]
                      color = auto
              [diff.color]
                      whitespace = blue reverse
      
      This needs to be fixed, but thanks to that bug, a separate bug
      in t9400 test script was discovered.  The test discarded
      GIT_CONFIG instead of pointing at the proper one to be used in
      the exoprted repository.  This allowed user's .gitconfig and (if
      exists) systemwide /etc/gitconfig to affect the outcome of the
      test, which is a big no-no.
      
      The patch fixes the problem in the test.  Fixing the
      git-cvsserver's configuration parser is left as an exercise to
      motivated volunteers ;-)
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      a25907da
    • Alex Riesen's avatar
      Allow fetching references from any namespace · 96f12b54
      Alex Riesen authored
      not only from the three defined: heads, tags and remotes.
      
      Noticed when I tried to fetch the references created by git-p4-import.bat:
      they are placed into separate namespace (refs/p4import/, to avoid showing
      them in git-branch output). As canon_refs_list_for_fetch always prepended
      refs/heads/ it was impossible, and annoying: it worked before. Normally,
      the p4import references are useless anywhere but in the directory managed
      by perforce, but in this special case the cloned directory was supposed
      to be a backup, including the p4import branch: it keeps information about
      where the imported perforce state came from.
      Signed-off-by: default avatarAlex Riesen <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      96f12b54
    • Lars Hjemli's avatar
      git-archive: don't die when repository uses subprojects · 02851e0b
      Lars Hjemli authored
      Both archive-tar and archive-zip needed to be taught about subprojects.
      The tar function died when trying to read the subproject commit object,
      while the zip function reported "unsupported file mode".
      
      This fixes both by representing the subproject as an empty directory.
      Signed-off-by: default avatarLars Hjemli <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      02851e0b
    • Steffen Prohaska's avatar
      tiny fix in documentation of git-clone · a6e3768f
      Steffen Prohaska authored
      path in example was missing '../'
      Signed-off-by: Steffen Prohaska's avatarSteffen Prohaska <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      a6e3768f
    • Jakub Narębski's avatar
      gitweb: Test if $from_id and $to_id are defined before comparison · 2206537c
      Jakub Narębski authored
      Get rid of "Use of uninitialized value in string eq at
      gitweb/gitweb.perl line 2320" warning caused by the fact that "empty"
      patches, consisting only of extended git diff header and with patch
      body empty, such as patch for pure rename, does not have "index" line
      in extended diff header.  For such patches $from_id and $to_id, filled
      from parsing extended diff header, are undefined.  But such patches
      cannot be continuation patches.
      
      Test if $from_id and $to_id are defined before comparing them with
      $diffinfo.
      Signed-off-by: Jakub Narębski's avatarJakub Narebski <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      2206537c
    • Marco Costalba's avatar
    • Jeff King's avatar
      git-add: allow path limiting with -u · 93c44d49
      Jeff King authored
      Rather than updating all working tree paths, we limit
      ourselves to paths listed on the command line.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      93c44d49
    • Junio C Hamano's avatar
      read-tree -m -u: avoid getting confused by intermediate symlinks. · 16a4c617
      Junio C Hamano authored
      When switching from a branch with both x86_64/boot/Makefile and
      i386/boot/Makefile to another branch that has x86_64/boot as a
      symlink pointing at ../i386/boot, the code incorrectly removed
      i386/boot/Makefile.
      
      This was because we first removed everything under x86_64/boot
      to make room to create a symbolic link x86_64/boot, then removed
      x86_64/boot/Makefile which no longer exists but now is pointing
      at i386/boot/Makefile, thanks to the symlink we just created.
      
      This fixes it by using the has_symlink_leading_path() function
      introduced previously for git-apply in the checkout codepath.
      Earlier, "git checkout" was broken in t4122 test due to this
      bug, and the test had an extra "git reset --hard" as a
      workaround, which is removed because it is not needed anymore.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      16a4c617
    • Junio C Hamano's avatar
      apply: do not get confused by symlinks in the middle · 64cab591
      Junio C Hamano authored
      HPA noticed that git-rebase fails when changes involve symlinks
      in the middle of the hierarchy.  Consider:
      
       * The tree state before the patch is applied has arch/x86_64/boot
         as a symlink pointing at ../i386/boot/
      
       * The patch tries to remove arch/x86_64/boot symlink, and
         create bunch of files there: .gitignore, Makefile, etc.
      
      git-apply tries to be careful while applying patches; it never
      touches the working tree until it is convinced that the patch
      would apply cleanly.  One of the check it does is that when it
      knows a path is going to be created by the patch, it runs
      lstat() on the path to make sure it does not exist.
      
      This leads to a false alarm.  Because we do not touch the
      working tree before all the check passes, when we try to make
      sure that arch/x86_64/boot/.gitignore does not exist yet, we
      haven't removed the arch/x86_64/boot symlink.  The lstat() check
      ends up seeing arch/i386/boot/.gitignore through the
      yet-to-be-removed symlink, and says "Hey, you already have a
      file there, but what you fed me is a patch to create a new
      file. I am not going to clobber what you have in the working
      tree."
      
      We have similar checks to see a file we are going to modify does
      exist and match the preimage of the diff, which is done by
      directly opening and reading the file.
      
      For a file we are going to delete, we make sure that it does
      exist and matches what is going to be removed (a removal patch
      records the full preimage, so we check what you have in your
      working tree matches it in full -- otherwise we would risk
      losing your local changes), which again is done by directly
      opening and reading the file.
      
      These checks need to be adjusted so that they are not fooled by
      symlinks in the middle.
      
       - To make sure something does not exist, first lstat().  If it
         does not exist, it does not, so be happy.  If it _does_, we
         might be getting fooled by a symlink in the middle, so break
         leading paths and see if there are symlinks involved.  When
         we are checking for a path a/b/c/d, if any of a, a/b, a/b/c
         is a symlink, then a/b/c/d does _NOT_ exist, for the purpose
         of our test.
      
         This would fix this particular case you saw, and would not
         add extra overhead in the usual case.
      
       - To make sure something already exists, first lstat().  If it
         does not exist, barf (up to this, we already do).  Even if it
         does seem to exist, we might be getting fooled by a symlink
         in the middle, so make sure leading paths are not symlinks.
      
         This would make the normal codepath much more expensive for
         deep trees, which is a bit worrisome.
      
      This patch implements the first side of the check "making sure
      it does not exist".  The latter "making sure it exists" check is
      not done yet, so applying the patch in reverse would still
      fail, but we have to start from somewhere.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      64cab591
    • Junio C Hamano's avatar
      Add has_symlink_leading_path() function. · f859c846
      Junio C Hamano authored
      When we are applying a patch that creates a blob at a path, or
      when we are switching from a branch that does not have a blob at
      the path to another branch that has one, we need to make sure
      that there is nothing at the path in the working tree, as such a
      file is a local modification made by the user that would be lost
      by the operation.
      
      Normally, lstat() on the path and making sure ENOENT is returned
      is good enough for that purpose.  However there is a twist.  We
      may be creating a regular file arch/x86_64/boot/Makefile, while
      removing an existing symbolic link at arch/x86_64/boot that
      points at existing ../i386/boot directory that has Makefile in
      it.  We always first check without touching filesystem and then
      perform the actual operation, so when we verify the new file,
      arch/x86_64/boot/Makefile, does not exist, we haven't removed
      the symbolic link arc/x86_64/boot symbolic link yet.  lstat() on
      the file sees through the symbolic link and reports the file is
      there, which is not what we want.
      
      The function has_symlink_leading_path() function takes a path,
      and sees if any of the leading directory component is a symbolic
      link.
      
      When files in a new directory are created, we tend to process
      them together because both index and tree are sorted.  The
      function takes advantage of this and allows the caller to cache
      and reuse which symbolic link on the filesystem caused the
      function to return true.
      
      The calling sequence would be:
      
      	char last_symlink[PATH_MAX];
      
              *last_symlink = '\0';
              for each index entry {
      		if (!lose)
      			continue;
      		if (lstat(it))
      			if (errno == ENOENT)
      				; /* happy */
      			else
      				error;
      		else if (has_symlink_leading_path(it, last_symlink))
      			; /* happy */
      		else
      			error; /* would lose local changes */
      		unlink_entry(it, last_symlink);
      	}
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      f859c846