<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>20072</bug_id>
          
          <creation_ts>2009-05-16 22:15:09 +0400</creation_ts>
          <short_desc>stupid messages in a bare repo</short_desc>
          <delta_ts>2014-11-05 20:42:44 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch 4.1</product>
          <component>git</component>
          <version>unspecified</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          
          
          <qa_contact name="qa-4.1@altlinux.org">qa-4.1</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>91294</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2009-05-16 22:15:09 +0400</bug_when>
    <thetext>git-1.5.5.5-alt1

Stpid messages are printed when working in bare repos (they would make sense inside a working dir): 

[imz@localhost repo.git]$ git reset HEAD^ 
f: needs update
[imz@localhost repo.git]$ 

How to reproduce: 

[imz@localhost git-bare-msgs]$ mkdir repo
[imz@localhost git-bare-msgs]$ cd repo/
[imz@localhost repo]$ git init
Initialized empty Git repository in .git/
[imz@localhost repo]$ echo a &gt; f
[imz@localhost repo]$ git add f
[imz@localhost repo]$ git commit -m a.
Created initial commit a6437c2: a.
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 f
[imz@localhost repo]$ echo b &gt; f
[imz@localhost repo]$ git commit -m b. -a
Created commit 59bec0a: b.
 1 files changed, 1 insertions(+), 1 deletions(-)
[imz@localhost repo]$ git clone --bare ./ ../repo.git
Initialized empty Git repository in /home/imz/SAVED-for-me-and-everyone/bugreports/git-bare-msgs/repo.git/
[imz@localhost repo]$ cd ../repo.git
[imz@localhost repo.git]$ git reset HEAD^ --hard
fatal: hard reset makes no sense in a bare repository
[imz@localhost repo.git]$ git reset HEAD^ 
f: needs update
[imz@localhost repo.git]$ git status
fatal: This operation must be run in a work tree
[imz@localhost repo.git]$ ls
branches  config  description  HEAD  hooks  index  info  objects  ORIG_HEAD  refs
[imz@localhost repo.git]$ git --no-pager log
commit a6437c2fa63c06a550b3e3061671c9504f10a318
Author: Ivan Zakharyaschev &lt;imz@altlinux.org&gt;
Date:   Sat May 16 18:06:56 2009 +0000

    a.
[imz@localhost repo.git]$ 

So, the command &quot;git reset HEAD^&quot; took effect (as can be seen from the log), but it printed confusing messages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92509</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2009-06-05 02:16:50 +0400</bug_when>
    <thetext>git-core-1.6.3.1-alt1 has no such problem:

$ git reset HEAD^
fatal: This operation must be run in a work tree
fatal: Could not reset index file to revision &apos;HEAD^&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>148664</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2014-11-05 20:42:44 +0300</bug_when>
    <thetext>В 4.1/branch исправления не будут вноситься уже технически (заглушена очередь на сборку), поэтому прошу ошибки, актуальные для sisyphus/p7/t7, перевесить на текущие ветки или сизиф.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>