git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv5 GSoC] gitweb: Move static files into seperate subdirectory

From
Jakub Narebski <jnareb@gmail.com>
Date
May 25, 2010, 00:37 UTC
Message-ID
<201005250237.53529.jnareb@gmail.com>
In-Reply-To
<AANLkTilqa8HAs9jHJQ5KxWic1IYOZxCj10f11KBRMA-b@mail.gmail.com>
On Mon, 24 May 2010, Pavan Kumar Sunkara wrote:
Show 24 quoted lines
> On Tue, May 25, 2010 at 1:35 AM, Christian Couder <chriscool@tuxfamily.org> wrote:
>> On Monday 24 May 2010 17:22:44 Pavan Kumar Sunkara wrote:
>>>
>>>  gitweb/{ => static}/git-favicon.png |  Bin 115 -> 115 bytes
>>>  gitweb/{ => static}/git-logo.png    |  Bin 207 -> 207 bytes
>>>  gitweb/{ => static}/gitweb.css      |    0
>>>  gitweb/{ => static}/gitweb.js       |    0
>>
>> The patch is supposed to move git-favicon.png and git-logo.png into
>> gitweb/static but it doesn't.
>>
>>>  diff --git a/gitweb/gitweb.css b/gitweb/static/gitweb.css
>>> similarity index 100%
>>> rename from gitweb/gitweb.css
>>> rename to gitweb/static/gitweb.css
>>> diff --git a/gitweb/gitweb.js b/gitweb/static/gitweb.js
>>> similarity index 100%
>>> rename from gitweb/gitweb.js
>>> rename to gitweb/static/gitweb.js
>>
>> Only gitweb.css and gitweb.js are moved into gitweb/static [...]
>
> I don't understand why the binary files aren't moving into static/ dir.
> I haven't faced this type of problem before. Give me some time to figure it out.

You have found a bug in git. When you do a pure rename of a binary file, it doesn't show as a pure rename patch:

  $ git init
  $ echo foo > foo
  $ echo -e "bar\0" > bar
  $ git add .
  $ git commit -m 'Initial commit'
  [master (root-commit) 4bd35b8] Initial commit
   2 files changed, 1 insertions(+), 0 deletions(-)
   create mode 100644 bar
   create mode 100644 foo
  $ mkdir sub
  $ git mv bar foo sub/
  $ git commit -m 'Moved to sub/'
  [master 00356a5] Moved to sub/
   2 files changed, 0 insertions(+), 0 deletions(-)
   rename bar => sub/bar (100%)
   rename foo => sub/foo (100%)
  $ git show -C -C --raw --binary --stat
  commit 00356a5ec458fa64ab3eca2c23ebc53e9f2d54ba
  Author: Jakub Narebski <jnareb@gmail.com>
  Date:   Tue May 25 02:23:26 2010 +0200
  
      Moved to sub/
  ---
  :100644 100644 080090e... 080090e... R100       bar     sub/bar
  :100644 100644 257cc56... 257cc56... R100       foo     sub/foo
  
   bar => sub/bar |  Bin 5 -> 5 bytes
   foo => sub/foo |    0
   2 files changed, 0 insertions(+), 0 deletions(-)
  
  diff --git a/foo b/sub/foo
  similarity index 100%
  rename from foo
  rename to sub/foo
As you can see there is not
  diff --git a/bar b/sub/bar
  similarity index 100%
  rename from bar
  rename to sub/bar
and that adding '--binary' option doesn't help
-- 
Jakub Narebski
Poland
Previous: Pavan Kumar SunkaraNext: Christian Couder
Message 4 of 10 in “[PATCHv5 GSoC] gitweb: Move static files into seperate subdirectory”
  1. Pavan Kumar SunkaraMay 24, 2010
  2. Christian CouderMay 24, 2010
  3. Pavan Kumar SunkaraMay 24, 2010
  4. Jakub NarebskiMay 25, 2010
  5. Christian CouderMay 25, 2010
  6. Pavan Kumar SunkaraMay 25, 2010
  7. Christian CouderMay 25, 2010
  8. Pavan Kumar SunkaraMay 25, 2010
  9. Christian CouderMay 25, 2010
  10. Christian CouderMay 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.