Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6106241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:03:31+00:00 2026-05-23T14:03:31+00:00

I manage a largish (23,000 LOC for includes/src, 5000 LOC for samples), multi-platform, ANSI

  • 0

I manage a largish (23,000 LOC for includes/src, 5000 LOC for samples), multi-platform, ANSI C code library used on everything from an 8-bit embedded processor with 32KB of flash, up to a desktop PC running Windows. This code base will continue to grow, and we’ll be adding more platforms to it.

I’m currently using Subversion to maintain it, but the company is moving to git for all version control.

I need to a way to have different mappings of the directory structure, so that the files can fit into each targeted development environment’s existing structure. I want to be able to check changes in from these mapped directories, since we’ll be doing active development on the library within a given platform’s directory structure. For example, bringing a new platform up may expose errors in the library, and it’s easiest to fix them in place, and commit the changes from that structure.

For example, one platform might have the following structure:

  • src/foo
  • src/foo/platform
  • src/alternate_name_for_bar
  • src/baz
  • include/foo
  • include/bar
  • include/baz
  • samples/foo
  • samples/foo/common

While another might be like this:

  • Lib/Blah/foo
  • Lib/Blah/foo/platform
  • Lib/Blah/bar
  • Lib/Blah/foo/baz (note baz as a subdir of foo instead of same level)
  • include/foo
  • include/bar
  • include/baz
  • Samples/foo
  • Samples/foo/common

And the repository:

  • src/foo
  • src/bar
  • src/baz
  • src/platform1 (maps to foo/platform on platform 1’s source)
  • src/platform2 (maps to foo/platform on platform 2’s source)
  • src/platform3 (maps to foo/platform on platform 3’s source)
  • include/foo
  • include/bar
  • include/baz
  • samples/common
  • samples/platform1 (maps to samples/foo on platform 1)
  • samples/platform2 (maps to samples/foo on platform 2)
  • samples/platform3 (maps to samples/foo on platform 3)

I have flexibility in the repository’s directory structure, but I’d like something that makes sense and is easy to maintain. I also want to keep everything in a single repository, since a changeset can potentially affect one of the header files in include, multiple files in src and multiple sample programs.

With Subversion, I could use svn:externals to do the directory mappings. The repository has all files in a root directory called master, and then additional root directories for each platform that use svn:externals to map files/directories from master to whatever layout is required for the given platform.

I am very new to git, but I have read about submodules and they don’t seem to fit the bill, since they don’t allow directory mapping and you can’t commit a change that spans multiple submodules (AFAIK).

Most of the embedded development takes place on Windows, so symbolic links won’t work for the directory mappings.

There’s a chance I’m looking at this the wrong way, and that I need a repository for each platform that pulls the common code from another repository. But from what I’ve read on git submodules, it won’t be possible to do the directory mapping.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:03:32+00:00Added an answer on May 23, 2026 at 2:03 pm

    So I finally moved from Subversion to git, and per @peachykeen’s comment to my question, I was able to use junction points for my directory mappings. I just created a small batch file that looped through pairs of links and targets and used rmdir to remove old links and mklink /j to create new ones.

    @echo off
    
    :: Expand variables at execution time rather than at parse time.
    setlocal EnableDelayedExpansion
    
    SET MAPPING=    ^
        include\foo:include\foo ^
        include\bar:include\bar ^
        include\baz:include\baz ^
        src\foo:Lib\Blah\foo    ^
        src\bar:Lib\Blah\bar    ^
        src\baz:Lib\Blah\baz    ^
        src\util:Lib\Blah\foo\util  ^
        src\platform:Lib\Blah\foo\platform  ^
        samples\platform:Samples\foo    ^
        samples\common:Samples\foo\common   ^
        test:Test\foo
    
    set PLATFORM=..\..\
    set DRIVER=..\
    
    for %%M in (%MAPPING%) do (
      for /f "tokens=1,2 delims=:" %%a in ("%%M") do (
        set SRC=%%a
        set DST=%%b
        if exist %PLATFORM%!DST! rmdir %PLATFORM%!DST!
        mklink /j %PLATFORM%!DST! %DRIVER%!SRC!
      )
    )
    

    This could even work with the driver as a git submodule. It’s just necessary to run the batch file once to set up the junctions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone manage to write code that uses the mysqlclient library? I can get compiling
I manage a rather large application (50k+ lines of code) by myself, and it
I manage ajax browser history using asp.net's(v. 4.0) EnableHistory=true of the ScriptManager & everything
I manage a web site that used to be hosted on Server A. I
How do you manage generated source code files in you repositories and deployment routines
How do people manage permissions between their code base and the database? For example,
I manage a small group and I'd keep my work breakdown in project. However,
I manage a web application for a client with the following specs: ASP.net 3.5
I manage to identify duplicate records from two different databases: select * from taskperformance
I manage project for JNI for both compilers: MSVC++ 8.0 and 9.0, my cpp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.